GithubHelp home page GithubHelp logo

bryandevelops / solarsystem Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 0.0 27.82 MB

A data visualization comprised of JavaScript and D3 that allows users to compare planetary data amongst the eight planets of the Solar System.

Home Page: https://bryandevelops.github.io/SolarSystem/

HTML 6.04% JavaScript 81.84% CSS 12.11%
solarsystem data-visualization comparison planets chart

solarsystem's Introduction

SolarSystem is a data visualization project comprised of JavaScript, D3.js, and calls to a third-party REST API.

Background Overview

Aside from coding and technology, I have always had an affinity and small fascination with Astronomy as well. For me, both the known and unknown of our universe has always been very enlightening to think about. Due to this other interest, I took an initiative and created a fun data visualization showing off the different details of the primary eight celestial objects that make up our Solar System. Some of these details include their radius, tilt, gravity, etc. My motivation behind this project was to get users interested in learning more about our home planet as well as the surrounding planets that make up the Solar System. By displaying this information in a simple but visually stimulating way, I hope to garner more people's interest in my favorite natural science.

Functionality & MVPs

SolarSystem users are able to:

  • View relevant planetary information about any of the eight planets by hovering over them
  • Thanks to calls from a public OpenData API, users can click on a planet to display all of the relevant data pertaining to that specific planet. Here's a snippet of how I make this possible:
let elements = Array.from(document.querySelectorAll('.planet'));

elements.forEach(function (el) {
  el.addEventListener("click", () => {
    let list = document.getElementById("more-info");

    while (list.childNodes.length) {
      list.childNodes.forEach(node => {
        list.removeChild(node);
      })
    }

    fetch(`https://api.le-systeme-solaire.net/rest/bodies/${el.__data__.id}?data=englishName,aphelion,perihelion,semimajorAxis,eccentricity,density,gravity,inclination,flattening`)
      .then(function (response) {
        return response.json();
      })
      .then(function (data) {
        let h1;
        let text;

        Object.entries(data).forEach(d => {
          switch (d[0]) {
          
            ...
          
        })
      });
  })
})          
        
  • Click on one of eight slices representing a category of comparison
  • Alternatively a user may use keys 1 though 8 on their keypad to also cycle through categories of comparison
  • Manipulate the Chart and Legend in an engaging way by clicking them and making them change

Solar System Demo

Click the link below to interact with it live!

SolarSystem

Wireframes

When the idea was first being nurtured and planned out, my vision for the visualization was to have it consist of a selection of the eight planets in our solar system (Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Nepturn), a list of the planets data displayed on click, a piechart used for visual comparison between the other planets, a dropdown to refine the data being used for comparison, and lastly a legend to help differentiate any information displayed on the chart.

You can see the direction I wanted to take during the planning stages below by taking a glimpse at the original wireframe I created for myself:

Wireframe

Overall, I was pretty intent with following this vision as closely as I could since I was very confident in the layout for all the elements that would tie in togethter. Changes were made, such as the dropdown never having been incorporated, but these changes were made in order to make the experience more engaging for the user. I thought it would be more creative to have the chart itself handle the selection on top of just displaying the information. The end result came out to look extremely similar and even better then I imagined initially.

Architecture and Technologies

SolarSystem is built with:

  • Vanilla JavaScript for data retrieval and computation
  • d3.js + HTML5 + SVG + CSS3 for visualization and interactivity
  • Webpack + Babel for bundling js files
  • The Solar System OpenData API for all planetary data
Note

~Use fullscreen while using! It is meant to be a fullscreen experience.

Enjoy!

solarsystem's People

Contributors

bryandevelops avatar

Stargazers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.