Skip to content

Instantly share code, notes, and snippets.

@fabiovalse
Last active November 8, 2019 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fabiovalse/96f1c7575f6a66facc34a7d8408287f0 to your computer and use it in GitHub Desktop.
Save fabiovalse/96f1c7575f6a66facc34a7d8408287f0 to your computer and use it in GitHub Desktop.
Solar System Overview

An overview diagram of the solar system. The sun is placed on the left and every planet rotating around it is placed on the right along its own orbit. Some planets, such as Jupiter or Saturn, have in turn moons drawn around them.

The color of the planets indicates the type of celestial body such as terrestrial, gas giant, ice giant, asteroid, plutoid and satellite.

Except the sun, planet dimensions have been computed using the same scale (i.e., power scale with a 0.4 exponent). Also the planet distance from the sun and the moon distance from their primary planet have been calculated using the same scale (i.e., power scale with a 0.33 exponent).

Data have been taken from Wikipedia.

label subtitle description primary type subtype symbol distance_from_primary_km equatorial_radius_km mass_kg volume_km3 orbital_period_years inclination_degrees axial_tilt_degrees surface_area_km2 density_g/cm3 equatorial gravity_m/s2 escape_velocity_km/s rotation_period_days mean_orbital_speed_km/s eccentricity mean_surface_temperature_K atmospheric_composition rings?
Sun The star at the center of the Solar System The Sun is the star at the center of the Solar System. It is a nearly perfect sphere of hot plasma, with internal convective motion that generates a magnetic field via a dynamo process. It is by far the most important source of energy for life on Earth. Its diameter is about 109 times that of Earth, and its mass is about 330,000 times that of Earth, accounting for about 99.86% of the total mass of the Solar System.About three quarters of the Sun's mass consists of hydrogen (~73%); the rest is mostly helium (~25%), with much smaller quantities of heavier elements, including oxygen, carbon, neon, and iron. The Sun is a G-type main-sequence star (G2V) based on its spectral class, and is informally referred to as a yellow dwarf. It formed approximately 4.6 billion years ago from the gravitational collapse of matter within a region of a large molecular cloud. Most of this matter gathered in the center, whereas the rest flattened into an orbiting disk that became the Solar System. The central mass became so hot and dense that it eventually initiated nuclear fusion in its core. It is thought that almost all stars form by this process. The Sun is roughly middle-aged: it has not changed dramatically for more than four billion years, and will remain fairly stable for more than another five billion years. After hydrogen fusion in its core has stopped, the Sun will undergo severe changes and become a red giant. It is calculated that the Sun will become sufficiently large to engulf the current orbits of Mercury, Venus, and possibly Earth. The enormous effect of the Sun on Earth has been recognized since prehistoric times, and the Sun has been regarded by some cultures as a deity. The synodic rotation of Earth and its orbit around the Sun are the basis of the solar calendar, which is the predominant calendar in use today. NULL star NULL NULL 695700.00 1988550000000000000000000000000.00 1410000000000000000.00 NULL NULL NULL 6087700000000 1409 274 617.7 25.38 -220 NULL 5778 H, He, O, C, Fe, S No
Mercury The smallest planet of the Solar System Mercury is the smallest and innermost planet in the Solar System. Its orbital period (about 88 Earth days) is less than any other planet in the Solar System. Seen from Earth, it appears to move around its orbit in about 116 days. It has no known natural satellites. It is named after the Roman deity Mercury, the messenger to the gods. Partly because it has almost no atmosphere to retain heat, Mercury's surface temperature varies diurnally more than any other planet in the Solar System, ranging from 100 K (−173 °C; −280 °F) at night to 700 K (427 °C; 800 °F) during the day in some equatorial regions. The poles are constantly below 180 K (−93 °C; −136 °F). Mercury's axis has the smallest tilt of any of the Solar System's planets (about  1⁄30 degree), and its orbital eccentricity is the largest of all known planets in the Solar System. At aphelion, Mercury is about 1.5 times as far from the Sun as it is at perihelion. Mercury's surface is heavily cratered and similar in appearance to the Moon, indicating that it has been geologically inactive for billions of years. Mercury is tidally or gravitationally locked with the Sun in a 3:2 resonance, and rotates in a way that is unique in the Solar System. As seen relative to the fixed stars, it rotates on its axis exactly three times for every two revolutions it makes around the Sun. As seen from the Sun, in a frame of reference that rotates with the orbital motion, it appears to rotate only once every two Mercurian years. An observer on Mercury would therefore see only one day every two years. Because Mercury orbits the Sun within Earth's orbit (as does Venus), it can appear in Earth's sky in the morning or the evening, but not in the middle of the night. Also, like Venus and the Moon, it displays a complete range of phases as it moves around its orbit relative to Earth. Although Mercury can appear as a bright object when viewed from Earth, its proximity to the Sun makes it more difficult to see than Venus. Two spacecraft have visited Mercury: Mariner 10 flew by in 1974 and 1975; and MESSENGER, launched in 2004, orbited Mercury over 4,000 times in four years, before exhausting its fuel and crashing into the planet's surface on April 30, 2015. Sun planet terrestrial 57909175.00 2439.64 330200000000000000000000.00 60830000000.00 0.24 7.00 0.00 75,000,000 5.43 3.7 4.25 58.646225 47.8725 0.20563069 440–100 He, Na+, P+ No
Venus The second planet of the Solar System Venus is the second planet from the Sun, orbiting it every 224.7 Earth days. It has the longest rotation period (243 days) of any planet in the Solar System and rotates in the opposite direction to most other planets. It has no natural satellites. It is named after the Roman goddess of love and beauty. It is the second-brightest natural object in the night sky after the Moon, reaching an apparent magnitude of −4.6 – bright enough to cast shadows at night and, rarely, visible to the naked eye in broad daylight. Orbiting within Earth's orbit, Venus is an inferior planet and never appears to venture far from the Sun; its maximum angular distance from the Sun (elongation) is 47.8°. Sun planet terrestrial 108208930.00 6051.59 4869000000000000000000000.00 928000000000.00 0.62 3.39 177.30 460,000,000 5.24 8.87 10.36 −243.0187 35.0214 0.00677323 730 CO2, N2, SO2 No
Earth Our planet, the third one of the Solar System Earth is the third planet from the Sun, the densest planet in the Solar System, the largest of the Solar System's four terrestrial planets, and the only astronomical object known to harbor life. According to radiometric dating and other sources of evidence, Earth formed about 4.54 billion years ago. Earth gravitationally interacts with other objects in space, especially the Sun and the Moon. During one orbit around the Sun, Earth rotates about its axis 366.26 times, creating 365.26 solar days or one sidereal year. Earth's axis of rotation is tilted 23.4° away from the perpendicular of its orbital plane, producing seasonal variations on the planet's surface within a period of one tropical year (365.24 solar days). The Moon is the Earth's only permanent natural satellite; their gravitational interaction causes ocean tides, stabilizes the orientation of Earth's rotational axis, and gradually slows Earth's rotational rate. Earth's lithosphere is divided into several rigid tectonic plates that migrate across the surface over periods of many millions of years. 71% of Earth's surface is covered with water. The remaining 29% is land mass—consisting of continents and islands—that together has many lakes, rivers, and other sources of water that contribute to the hydrosphere. The majority of Earth's polar regions are covered in ice, including the Antarctic ice sheet and the sea ice of the Arctic ice pack. Earth's interior remains active with a solid iron inner core, a liquid outer core that generates the Earth's magnetic field, and a convecting mantle that drives plate tectonics. Within the first billion years of Earth's history, life appeared in the oceans and began to affect the atmosphere and surface, leading to the proliferation of aerobic and anaerobic organisms. Since then, the combination of Earth's distance from the Sun, physical properties, and geological history have allowed life to evolve and thrive. Life arose on Earth by 3.5 billion years ago, though some geological evidence indicates that life may have arisen as much as 4.1 billion years ago. In the history of the Earth, biodiversity has gone through long durations of expansion but occasionally punctuated by mass extinction events. Over 99% of all species of life that ever lived on Earth are extinct. Estimates of the number of species on Earth today vary widely; most species have not been described. Over 7.3 billion humans live on Earth and depend on its biosphere and minerals for their survival. Humanity has developed diverse societies and cultures; politically, the world is divided into about 200 sovereign states. Sun planet terrestrial 149597890.00 6378.10 5974200000000000000000000.00 1083000000000.00 1.00 0.00 23.44 510,000,000 5.515 9.81 11.18 0.99726968 29.7859 0.01671022 287 N2, O2, Ar, CO2 No
Mars The fourth planet of the Solar System Mars is the fourth planet from the Sun and the second-smallest planet in the Solar System, after Mercury. Named after the Roman god of war, it is often referred to as the "Red Planet" because the iron oxide prevalent on its surface gives it a reddish appearance. Mars is a terrestrial planet with a thin atmosphere, having surface features reminiscent both of the impact craters of the Moon and the valleys, deserts, and polar ice caps of Earth. The rotational period and seasonal cycles of Mars are likewise similar to those of Earth, as is the tilt that produces the seasons. Mars is the site of Olympus Mons, the largest volcano and second-highest known mountain in the Solar System, and of Valles Marineris, one of the largest canyons in the Solar System. The smooth Borealis basin in the northern hemisphere covers 40% of the planet and may be a giant impact feature. Mars has two moons, Phobos and Deimos, which are small and irregularly shaped. These may be captured asteroids, similar to 5261 Eureka, a Mars trojan. There are ongoing investigations assessing the past habitability potential of Mars, as well as the possibility of extant life. Future astrobiology missions are planned, including the Mars 2020 and ExoMars rovers. Liquid water cannot exist on the surface of Mars due to low atmospheric pressure, which is about  6⁄1000 that of the Earth's, except at the lowest elevations for short periods. The two polar ice caps appear to be made largely of water. The volume of water ice in the south polar ice cap, if melted, would be sufficient to cover the entire planetary surface to a depth of 11 meters (36 ft). Mars can easily be seen from Earth with the naked eye, as can its reddish coloring. Its apparent magnitude reaches −2.91, which is surpassed only by Jupiter, Venus, the Moon, and the Sun. Optical ground-based telescopes are typically limited to resolving features about 300 kilometers (190 mi) across when Earth and Mars are closest because of Earth's atmosphere. Sun planet terrestrial 227936640.00 3397.00 641910000000000000000000.00 163180000000.00 1.88 1.85 25.19 140,000,000 3.94 3.71 5.02 1.02595675 24.1309 0.09341233 227 CO2, N2 Ar No
Jupiter The fifth and largest planet of the Solar System Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a giant planet with a mass one-thousandth that of the Sun, but two and a half times that of all the other planets in the Solar System combined. Jupiter is a gas giant, along with Saturn, with the other two giant planets, Uranus and Neptune, being ice giants. Jupiter was known to astronomers of ancient times. The Romans named it after their god Jupiter. When viewed from Earth, Jupiter can reach an apparent magnitude of −2.94, bright enough for its reflected light to cast shadows, and making it on average the third-brightest object in the night sky after the Moon and Venus. Jupiter is primarily composed of hydrogen with a quarter of its mass being helium, though helium comprises only about a tenth of the number of molecules. It may also have a rocky core of heavier elements, but like the other giant planets, Jupiter lacks a well-defined solid surface. Because of its rapid rotation, the planet's shape is that of an oblate spheroid (it has a slight but noticeable bulge around the equator). The outer atmosphere is visibly segregated into several bands at different latitudes, resulting in turbulence and storms along their interacting boundaries. A prominent result is the Great Red Spot, a giant storm that is known to have existed since at least the 17th century when it was first seen by telescope. Surrounding Jupiter is a faint planetary ring system and a powerful magnetosphere. Jupiter has at least 67 moons, including the four large Galilean moons discovered by Galileo Galilei in 1610. Ganymede, the largest of these, has a diameter greater than that of the planet Mercury. Jupiter has been explored on several occasions by robotic spacecraft, most notably during the early Pioneer and Voyager flyby missions and later by the Galileo orbiter. In late February 2007, Jupiter was visited by the New Horizons probe, which used Jupiter's gravity to increase its speed and bend its trajectory en route to Pluto. The latest probe to visit the planet is Juno, which entered into orbit around Jupiter on July 4, 2016. Future targets for exploration in the Jupiter system include the probable ice-covered liquid ocean of its moon Europa. Sun planet gas_giant 778412010.00 71492.68 1898700000000000000000000000.00 1431000000000000.00 11.86 1.31 3.12 64,000,000,000 1.33 23.12 59.54 0.41354 13.0697 0.04839266 152 H2, He Yes
Saturn The sixth planet of the Solar System Saturn is the sixth planet from the Sun and the second-largest in the Solar System, after Jupiter. It is a gas giant with an average radius about nine times that of Earth. Although only one-eighth the average density of Earth, with its larger volume Saturn is just over 95 times more massive. Saturn is named after the Roman god of agriculture; its astronomical symbol (♄) represents the god's sickle. Saturn's interior is probably composed of a core of iron–nickel and rock (silicon and oxygen compounds). This core is surrounded by a deep layer of metallic hydrogen, an intermediate layer of liquid hydrogen and liquid helium, and finally outside the Frenkel line a gaseous outer layer. Saturn has a pale yellow hue due to ammonia crystals in its upper atmosphere. Electrical current within the metallic hydrogen layer is thought to give rise to Saturn's planetary magnetic field, which is weaker than Earth's, but has a magnetic moment 580 times that of Earth due to Saturn's larger size. Saturn's magnetic field strength is around one-twentieth of Jupiter's. The outer atmosphere is generally bland and lacking in contrast, although long-lived features can appear. Wind speeds on Saturn can reach 1,800 km/h (500 m/s), higher than on Jupiter, but not as high as those on Neptune. Saturn has a prominent ring system that consists of nine continuous main rings and three discontinuous arcs and that is composed mostly of ice particles with a smaller amount of rocky debris and dust. Sixty-two moons are known to orbit Saturn, of which fifty-three are officially named. This does not include the hundreds of moonlets comprising the rings. Titan, Saturn's largest moon, and the second-largest in the Solar System, is larger than the planet Mercury, although less massive, and is the only moon in the Solar System to have a substantial atmosphere. Sun planet gas_giant 1426725400.00 60267.14 568510000000000000000000000.00 827000000000000.00 29.45 2.48 26.73 44,000,000,000 0.7 10.44 35.49 0.44401 9.6724 0.0541506 134 H2, He Yes
Uranus The seventh planet of the Solar System Uranus is the seventh planet from the Sun. It has the third-largest planetary radius and fourth-largest planetary mass in the Solar System. Uranus is similar in composition to Neptune, and both have different bulk chemical composition from that of the larger gas giants Jupiter and Saturn. For this reason, scientists often classify Uranus and Neptune as "ice giants" to distinguish them from the gas giants. Uranus's atmosphere is similar to Jupiter's and Saturn's in its primary composition of hydrogen and helium, but it contains more "ices" such as water, ammonia, and methane, along with traces of other hydrocarbons. It is the coldest planetary atmosphere in the Solar System, with a minimum temperature of 49 K (−224.2 °C), and has a complex, layered cloud structure with water thought to make up the lowest clouds and methane the uppermost layer of clouds. The interior of Uranus is mainly composed of ices and rock. Uranus is the only planet whose name is derived from a figure from Greek mythology, from the Latinised version of the Greek god of the sky Ouranos. Like the other giant planets, Uranus has a ring system, a magnetosphere, and numerous moons. The Uranian system has a unique configuration among those of the planets because its axis of rotation is tilted sideways, nearly into the plane of its solar orbit. Its north and south poles, therefore, lie where most other planets have their equators. In 1986, images from Voyager 2 showed Uranus as an almost featureless planet in visible light, without the cloud bands or storms associated with the other giant planets. Observations from Earth have shown seasonal change and increased weather activity as Uranus approached its equinox in 2007. Wind speeds can reach 250 metres per second (900 km/h, 560 mph). Sun planet ice_giant 2870972200.00 25557.25 86849000000000000000000000.00 68340000000000.00 84.02 0.76 97.86 8,100,000,000 1.3 8.69 21.29 −0.71833 6.8352 0.04716771 76 H2, He, CH4 Yes
Neptune The eighth and farthest planet of the the Solar System Neptune is the eighth and farthest known planet from the Sun in the Solar System. In the Solar System, it is the fourth-largest planet by diameter, the third-most-massive planet, and the densest giant planet. Neptune is 17 times the mass of Earth and is slightly more massive than its near-twin Uranus, which is 15 times the mass of Earth and slightly larger than Neptune. Neptune orbits the Sun once every 164.8 years at an average distance of 30.1 astronomical units (4.50×109 km). It is named after the Roman god of the sea and has the astronomical symbol ♆, a stylised version of the god Neptune's trident. Neptune is not visible to the unaided eye and is the only planet in the Solar System found by mathematical prediction rather than by empirical observation. Unexpected changes in the orbit of Uranus led Alexis Bouvard to deduce that its orbit was subject to gravitational perturbation by an unknown planet. Neptune was subsequently observed with a telescope on 23 September 1846 by Johann Galle within a degree of the position predicted by Urbain Le Verrier. Its largest moon, Triton, was discovered shortly thereafter, though none of the planet's remaining known 14 moons were located telescopically until the 20th century. The planet's distance from Earth gives it a very small apparent size, making it challenging to study with Earth-based telescopes. Neptune was visited by Voyager 2, when it flew by the planet on 25 August 1989. The advent of the Hubble Space Telescope and large ground-based telescopes with adaptive optics has recently allowed for additional detailed observations from afar. Neptune's composition is similar to that of Uranus and unlike those of the larger gas giants, Jupiter and Saturn. Like Jupiter's and Saturn's, Neptune's atmosphere is composed primarily of hydrogen and helium, along with traces of hydrocarbons and possibly nitrogen, but contains a higher proportion of "ices" such as water, ammonia, and methane. However, its interior, like that of Uranus, is primarily composed of ices and rock, which is why Uranus and Neptune are normally considered "ice giants" to emphasise this distinction. Traces of methane in the outermost regions in part account for the planet's blue appearance. In contrast to the hazy, relatively featureless atmosphere of Uranus, Neptune's atmosphere has active and visible weather patterns. For example, at the time of the Voyager 2 flyby in 1989, the planet's southern hemisphere had a Great Dark Spot comparable to the Great Red Spot on Jupiter. These weather patterns are driven by the strongest sustained winds of any planet in the Solar System, with recorded wind speeds as high as 2,100 kilometres per hour (580 m/s; 1,300 mph). Because of its great distance from the Sun, Neptune's outer atmosphere is one of the coldest places in the Solar System, with temperatures at its cloud tops approaching 55 K (−218 °C). Temperatures at the planet's centre are approximately 5,400 K (5,100 °C). Neptune has a faint and fragmented ring system (labelled "arcs"), which was first detected during the 1960s and confirmed by Voyager 2. Sun planet ice_giant 4498252900.00 24766.36 102440000000000000000000000.00 62540000000000.00 164.79 1.77 29.58 7,700,000,000 1.76 11 23.71 0.67125 5.4778 0.00858587 73 H2, He, CH4 Yes
Ceres A dwarf planet in the asteroid belt Ceres is the largest object in the asteroid belt that lies between the orbits of Mars and Jupiter. Its diameter is approximately 945 kilometers (587 miles), making it the largest of the minor planets within the orbit of Neptune. The 33rd-largest known body in the Solar System, it is the only dwarf planet within the orbit of Neptune. Composed of rock and ice, Ceres is estimated to compose approximately one third of the mass of the entire asteroid belt. Ceres is the only object in the asteroid belt known to be rounded by its own gravity (though detailed analysis was required to exclude 4 Vesta). From Earth, the apparent magnitude of Ceres ranges from 6.7 to 9.3, and hence even at its brightest it is too dim to be seen with the naked eye except under extremely dark skies. Ceres was the first asteroid to be discovered (by Giuseppe Piazzi at Palermo on 1 January 1801). It was originally considered a planet, but was reclassified as an asteroid in the 1850s after many other objects in similar orbits were discovered. Sun dwarf_planet asteroid 413700000.00 473.00 939000000000000000000.00 421000000.00 4.60 10.59 4.00 2,770,000 16 0.27 0.51 0.3781 17.882 0.08 167 H2O No
Pluto Pluto is a dwarf planet in the Kuiper belt, a ring of bodies beyond Neptune. It was the first Kuiper belt object to be discovered. Pluto was discovered by Clyde Tombaugh in 1930 and was originally considered to be the ninth planet from the Sun. After 1992, its planethood was questioned following the discovery of several objects of similar size in the Kuiper belt. In 2005, Eris, a dwarf planet in the scattered disc which is 27% more massive than Pluto, was discovered. This led the International Astronomical Union (IAU) to define the term "planet" formally in 2006, during their 26th General Assembly. That definition excluded Pluto and reclassified it as a dwarf planet. Sun dwarf_planet plutoid 5906380000.00 1186.00 13050000000000000000000.00 6990000000.00 247.92 17.14 119.59 17,700,000 1.87 0.62 1.21 −6.38723 4.749 0.24880766 40 N2, CH4, CO No
Haumea Haumea is a dwarf planet located beyond Neptune's orbit. It was discovered in 2004 by a team headed by Mike Brown of Caltech at the Palomar Observatory in the United States and independently in 2005, by a team headed by José Luis Ortiz Moreno at the Sierra Nevada Observatory in Spain, though the latter claim has been contested. On September 17, 2008, it was recognized as a dwarf planet by the International Astronomical Union (IAU) and named after Haumea, the Hawaiian goddess of childbirth. Sun dwarf_planet plutoid NULL 6484000000.00 650.00 4010000000000000000000.00 1500000000.00 285.40 28.19 NULL 6,800,000 2.6 0.63 0.91 0.167 4.484 0.18874 <50 NULL No
Makemake Makemake is a dwarf planet and perhaps the largest Kuiper belt object in the classical population, with a diameter approximately two thirds that of Pluto. Makemake has one known satellite, S/2015 (136472) 1. Makemake’s extremely low average temperature, about 30 K (−243.2 °C), means its surface is covered with methane, ethane, and possibly nitrogen ices. Makemake was discovered on March 31, 2005, by a team led by Michael E. Brown, and announced on July 29, 2005. Initially, it was known as 2005 FY9 and later given the minor-planet number 136472. Makemake was recognized as a dwarf planet by the International Astronomical Union (IAU) in July 2008. Its name derives from Makemake in the mythology of the Rapa Nui people of Easter Island. Sun dwarf_planet plutoid NULL 6850000000.00 715.00 NULL 1500000000.00 309.90 28.96 NULL 6,400,000 NULL NULL NULL NULL 4.4 0.159 30 N2, CH4 No
Eris Eris is the most massive and second-largest dwarf planet known in the Solar System. Eris was discovered in January 2005 by a Palomar Observatory-based team led by Mike Brown, and its identity was verified later that year. In September 2006 it was named after Eris, the Greek goddess of strife and discord. Among known bodies of the Solar System, Eris is the ninth most massive directly orbiting the Sun, and the 16th most massive overall, because seven moons are more massive than all known dwarf planets. It is also the largest which has not yet been visited by a spacecraft. Eris was measured to be 2,326 ± 12 kilometers (1,445.3 ± 7.5 mi) in diameter. Eris' mass is about 0.27% of the Earth mass, about 27% more than dwarf planet Pluto, although Pluto is slightly larger by volume. Sun dwarf_planet plutoid NULL 10210000000.00 1163.00 17000000000000000000000.00 6590000000.00 557.00 44.19 NULL 17,000,000 2.25 0.8 1.37 NULL 3.436 0.44177 30 N2, CH4 No
Moon The Moon is an astronomical body that orbits planet Earth, being Earth's only permanent natural satellite. It is the fifth-largest natural satellite in the Solar System, and the largest among planetary satellites relative to the size of the planet that it orbits (its primary). Following Jupiter's satellite Io, the Moon is second-densest satellite among those whose densities are known. The Moon is thought to have formed about 4.51 billion years ago, not long after Earth. There are several hypotheses for its origin; the most widely accepted explanation is that the Moon formed from the debris left over after a giant impact between Earth and a Mars-sized body called Theia. Earth satellite NULL 384399.00 1737.10 73477000000000000000000.00 22000000000.00 27.32 23.44 6.68 37,930,000 3.3464 1.622 2.38 27.321582 1.022 0.0549 220 Ar, He, Na, K, H No
Io The fifth moon orbiting Jupiter, high-density and geologically active Io is the innermost of the four Galilean moons of the planet Jupiter. It is the fourth-largest moon, has the highest density of all the moons, and has the least amount of water of any known astronomical object in the Solar System. It was discovered in 1610 and was named after the mythological character Io, a priestess of Hera who became one of Zeus's lovers. With over 400 active volcanoes, Io is the most geologically active object in the Solar System. Jupiter satellite NULL NULL 421600.00 1815.00 89400000000000000000000.00 25300000000.00 1.77 0.04 0.00 41,910,000 3.528 1.796 2.56 1.7691378 17.34 0.0041 130 SO2 No
Europa The sixth moon of Jupiter, with an icy and smooth crust Europa (Jupiter II), is the smallest of the four Galilean moons orbiting Jupiter, and the sixth-closest to the planet. It is also the sixth-largest moon in the Solar System. Europa was discovered in 1610 by Galileo Galilei and was named after Europa, the legendary mother of King Minos of Crete and lover of Zeus (the Greek equivalent of the Roman god Jupiter). Slightly smaller than Earth's Moon, Europa is primarily made of silicate rock and has a water-ice crust and probably an iron–nickel core. It has a tenuous atmosphere composed primarily of oxygen. Its surface is striated by cracks and streaks, whereas craters are relatively rare. In addition to Earth-bound telescope observations, Europa has been examined by a succession of space probe flybys, the first occurring in the early 1970s. Jupiter satellite NULL NULL 670900.00 1569.00 48000000000000000000000.00 15900000000.00 3.55 0.47 0.00 30,900,000 3.01 1.314 2.025 3.551181 13.74 0.009 102 O2 No
Ganymede The seventh moon of Jupiter, also the largest and heaviest Ganymede (Jupiter III) is the largest and most massive moon of Jupiter and in the Solar System. The ninth largest object in the Solar System, it is the largest without a substantial atmosphere. It has a diameter of 5,268 km (3,273 mi) and is 8% larger than the planet Mercury, although only 45% as massive. Possessing a metallic core, it has the lowest moment of inertia factor of any solid body in the Solar System and is the only moon known to have a magnetic field. It is the third of the Galilean moons, the first group of objects discovered orbiting another planet, and the seventh satellite outward from Jupiter, Ganymede orbits Jupiter in roughly seven days and is in a 1:2:4 orbital resonance with the moons Europa and Io, respectively. Jupiter satellite NULL NULL 1070400.00 2634.10 148190000000000000000000.00 76000000000.00 7.15 1.85 0.33 87,000,000 1.936 1.428 2.741 7.154553 10.88 0.0013 110 O2 No
Callisto The eight moon around Jupiter, with a old, heavily cratered surface Callisto (Jupiter IV) is the second-largest moon of Jupiter, after Ganymede. It is the third-largest moon in the Solar System after Ganymede and Saturn's largest moon Titan, and the largest object in the Solar System not to be properly differentiated. Callisto was discovered in 1610 by Galileo Galilei. At 4821 km in diameter, Callisto has about 99% the diameter of the planet Mercury but only about a third of its mass. It is the fourth Galilean moon of Jupiter by distance, with an orbital radius of about 1883000 km. It is not in an orbital resonance like the three other Galilean satellites—Io, Europa, and Ganymede—and is thus not appreciably tidally heated. Callisto's rotation is tidally locked to its orbit around Jupiter, so that the same hemisphere always faces inward; Jupiter appears to stand nearly still in Callisto's sky. It is less affected by Jupiter's magnetosphere than the other inner satellites because of its more remote orbit, located just outside Jupiter's main radiation belt. Jupiter satellite NULL NULL 1882700.00 2410.30 107580000000000000000000.00 59000000000.00 16.69 0.20 0.00 73,000,000 1.83 1.235 2.44 16.68902 8.204 0.0074 134 O2, CO2 No
Mimas Mimas is a moon of Saturn which was discovered in 1789 by William Herschel. It is named after Mimas, a son of Gaia in Greek mythology, and is also designated Saturn I. With a diameter of 396 kilometres (246 mi) it is the smallest astronomical body that is known to be rounded in shape because of self-gravitation. Mimas was discovered by the astronomer William Herschel on 17 September 1789. He recorded his discovery as follows: "The great light of my forty-foot telescope was so useful that on the 17th of September, 1789, I remarked the seventh satellite, then situated at its greatest western elongation." Saturn satellite NULL NULL 185520.00 198.30 37500000000000000000.00 33000000.00 0.94 1.51 0.00 490,000 1.15 0.0636 0.159 0.942422 14.32 0.0202 64 NULL No
Enceladus Enceladus is the sixth-largest moon of Saturn. It is about 500 kilometers (310 mi) in diameter, about a tenth of that of Saturn's largest moon, Titan. Enceladus is mostly covered by fresh, clean ice, making it one of the most reflective bodies of the solar system. Consequently, its surface temperature at noon only reaches −198 °C (−324 °F), far colder than a light-absorbing body would be. Despite its small size, Enceladus has a wide range of surface features, ranging from old, heavily cratered regions to young, tectonically deformed terrains that formed as recently as 100 million years ago. Enceladus was discovered on August 28, 1789, by William Herschel Saturn satellite NULL NULL 237948.00 252.10 108000000000000000000.00 67000000.00 1.37 0.02 0.00 799,000 1.61 0.111 0.239 1.370218 12.63 0.0047 75 H2O, N2, CO2, CH4 No
Tethys Tethys (or Saturn III) is a mid-sized moon of Saturn about 1,060 km (660 mi) across. It was discovered by G. D. Cassini in 1684 and is named after the titan Tethys of Greek mythology. Tethys has a low density of 0.98 g/cm3, the lowest of all the major moons in the Solar System, indicating that it is made of water ice with just a small fraction of rock. This is confirmed by the spectroscopy of its surface, which identified water ice as the dominant surface material. A small amount of an unidentified dark material is present as well. The surface of Tethys is very bright, being the second-brightest of the moons of Saturn after Enceladus, and neutral in color. Saturn satellite NULL NULL 294619.00 533.00 617400000000000000000.00 630000000.00 1.89 1.51 0.00 3,570,000 0.98 0.145 0.393 1.887802 11.35 0.02 64 NULL No
Dione Dione is a moon of Saturn. It was discovered by Italian astronomer Giovanni Domenico Cassini in 1684. It is named after the Titaness Dione of Greek mythology. It is also designated Saturn IV. Giovanni Domenico Cassini named the four moons he discovered (Tethys, Dione, Rhea and Iapetus) Sidera Lodoicea ("the stars of Louis") to honor king Louis XIV. Cassini found Dione in 1684 using a large aerial telescope he set up on the grounds of the Paris Observatory. The satellites of Saturn were not named until 1847, when William Herschel's son John Herschel published Results of Astronomical Observations made at the Cape of Good Hope, suggesting that the names of the Titans (sisters and brothers of Cronus) be used. Saturn satellite NULL NULL 377396.00 561.70 1095000000000000000000.00 740000000.00 2.74 0.02 0.00 3,965,000 1.48 0.231 0.51 2.736915 10.03 0.002 87 NULL No
Rhea Rhea is the second-largest moon of Saturn and the ninth-largest moon in the Solar System. It is the second smallest body in the Solar System, after the asteroid and dwarf planet Ceres, for which precise measurements have confirmed a shape consistent with hydrostatic equilibrium. It was discovered in 1672 by Giovanni Domenico Cassini. Rhea was discovered by Giovanni Domenico Cassini on 23 December 1672. It was the third moon discovered around Saturn and the second by him. Rhea is named after the Titan Rhea of Greek mythology, the "mother of the gods". It is also designated Saturn V (being the fifth major moon going outward from the planet) Saturn satellite NULL NULL 527108.00 764.30 2306000000000000000000.00 1900000000.00 4.52 0.35 0.00 7,337,000 1.23 0.264 0.635 4.518212 8.48 0.001 76 NULL Yes?
Titan Titan is the largest moon of Saturn. It is the only moon known to have a dense atmosphere, and the only object in space other than Earth where clear evidence of stable bodies of surface liquid has been found. Titan is the sixth ellipsoidal moon from Saturn. Frequently described as a planet-like moon, Titan is 50% larger than Earth's Moon, and it is 80% more massive. It is the second-largest moon in the Solar System, after Jupiter's moon Ganymede, and is larger than the smallest planet, Mercury, but only 40% as massive. Discovered in 1655 by the Dutch astronomer Christiaan Huygens, Titan was the first known moon of Saturn, and the sixth known planetary satellite (after Earth's Moon and the four Galilean moons of Jupiter). Titan orbits Saturn at 20 Saturn radii. From Titan's surface, Saturn subtends an arc of 5.09 degrees and would appear 11.4 times larger in the sky than the Moon from Earth. Saturn satellite NULL NULL 1221870.00 2576.00 134520000000000000000000.00 71600000000.00 15.95 0.33 0.00 83,000,000 1.88 1.35 2.64 15.945 5.57 0.0288 93.7 N2, CH4 No
Iapetus Iapetus is the third-largest natural satellite of Saturn, eleventh-largest in the Solar System, and the largest body in the Solar System known not to be in hydrostatic equilibrium. Iapetus is best known for its dramatic "two-tone" coloration. Discoveries by the Cassini mission in 2007 revealed several other unusual features, such as a massive equatorial ridge running three-quarters of the way around the moon. Iapetus was discovered by Giovanni Domenico Cassini, an Italian astronomer, in October 1671. Saturn satellite NULL NULL 3560820.00 735.60 1805300000000000000000.00 1670000000.00 79.32 14.72 0.00 6,700,000 1.08 0.22 0.57 79.322 3.265 0.0286 130 NULL No
Miranda Miranda or Uranus V is the smallest and innermost of Uranus's five round satellites. Like the other large moons of Uranus, Miranda orbits close to its planet's equatorial plane. Because Uranus orbits the Sun on its side, Miranda's orbit is perpendicular to the ecliptic and shares Uranus's extreme seasonal cycle. At just 470 km in diameter, Miranda is one of the smallest objects in the Solar System known to be in hydrostatic equilibrium (spherical under its own gravity)—only Saturn's moon Mimas is smaller. Uranus satellite NULL NULL 129390.00 235.80 65900000000000000000.00 55000000.00 1.41 4.22 0.00 700,000 1.2 0.08 0.19 1.414 6.657 0.0013 59 NULL No
Ariel Ariel is the fourth-largest of the 27 known moons of Uranus. Ariel orbits and rotates in the equatorial plane of Uranus, which is almost perpendicular to the orbit of Uranus, and so has an extreme seasonal cycle. It was discovered in October 1851 by William Lassell, and named for a character in two different pieces of literature. As of 2012, much of the detailed knowledge of Ariel derives from a single flyby of Uranus performed by the spacecraft Voyager 2 in 1986, which managed to image around 35% of the moon's surface. There are no active plans at present to return to study the moon in more detail, although various concepts such as a Uranus orbiter and probe are proposed from time to time. Uranus satellite NULL NULL 190900.00 578.90 1350000000000000000000.00 810000000.00 2.52 0.31 0.00 4,211,300 1.67 0.27 0.56 2.52 5.50898 0.0012 58 NULL No
Umbriel Umbriel is a moon of Uranus discovered on October 24, 1851, by William Lassell. It was discovered at the same time as Ariel and named after a character in Alexander Pope's poem The Rape of the Lock. Umbriel consists mainly of ice with a substantial fraction of rock, and may be differentiated into a rocky core and an icy mantle. The surface is the darkest among Uranian moons, and appears to have been shaped primarily by impacts. However, the presence of canyons suggests early endogenic processes, and the moon may have undergone an early endogenically driven resurfacing event that obliterated its older surface. Covered by numerous impact craters reaching 210 km (130 mi) in diameter, Umbriel is the second most heavily cratered satellite of Uranus after Oberon. The most prominent surface feature is a ring of bright material on the floor of Wunda crater. This moon, like all moons of Uranus, probably formed from an accretion disk that surrounded the planet just after its formation. The Uranian system has been studied up close only once, by the spacecraft Voyager 2 in January 1986. It took several images of Umbriel, which allowed mapping of about 40% of the moon’s surface. Uranus satellite NULL NULL 266000.00 584.70 1200000000000000000000.00 840000000.00 4.14 0.36 0.00 4,296,000 1.4 0.23 0.52 4.144 4.66797 0.005 61 NULL No
Titania Titania is the largest of the moons of Uranus and the eighth largest moon in the Solar System at a diameter of 1,578 kilometres (981 mi). Discovered by William Herschel in 1787, Titania is named after the queen of the fairies in Shakespeare's A Midsummer Night's Dream. Its orbit lies inside Uranus's magnetosphere. Titania consists of approximately equal amounts of ice and rock, and is probably differentiated into a rocky core and an icy mantle. A layer of liquid water may be present at the core–mantle boundary. The surface of Titania, which is relatively dark and slightly red in color, appears to have been shaped by both impacts and endogenic processes. It is covered with numerous impact craters reaching up to 326 kilometres (203 mi) in diameter, but is less heavily cratered than Oberon, outermost of the five large moons of Uranus. Titania probably underwent an early endogenic resurfacing event which obliterated its older, heavily cratered surface. Titania's surface is cut by a system of enormous canyons and scarps, the result of the expansion of its interior during the later stages of its evolution. Like all major moons of Uranus, Titania probably formed from an accretion disk which surrounded the planet just after its formation. Uranus satellite NULL NULL 436300.00 788.90 3500000000000000000000.00 2060000000.00 8.71 0.14 0.00 7,820,000 1.72 0.39 0.77 8.706 3.644 0.0011 60 NULL No
Oberon Oberon, also designated Uranus IV, is the outermost major moon of the planet Uranus. It is the second-largest and second most massive of the Uranian moons, and the ninth most massive moon in the Solar System. Discovered by William Herschel in 1787, Oberon is named after the mythical king of the fairies who appears as a character in Shakespeare's A Midsummer Night's Dream. Its orbit lies partially outside Uranus's magnetosphere. It is likely that Oberon formed from the accretion disk that surrounded Uranus just after the planet's formation. The moon consists of approximately equal amounts of ice and rock, and is probably differentiated into a rocky core and an icy mantle. A layer of liquid water may be present at the boundary between the mantle and the core. The surface of Oberon, which is dark and slightly red in color, appears to have been primarily shaped by asteroid and comet impacts. It is covered by numerous impact craters reaching 210 km in diameter. Oberon possesses a system of chasmata (graben or scarps) formed during crustal extension as a result of the expansion of its interior during its early evolution. Uranus satellite NULL NULL 583519.00 761.40 3014000000000000000000.00 1850000000.00 13.46 0.10 0.00 7,285,000 1.63 0.35 0.73 13.46 3.152 0.0014 61 NULL No
Triton Triton is the largest natural satellite of the planet Neptune. It was discovered on October 10, 1846, by English astronomer William Lassell. It is the only large moon in the Solar System with a retrograde orbit, an orbit in the opposite direction to its planet's rotation. At 2,700 kilometres (1,700 mi) in diameter, it is the seventh-largest moon in the Solar System. Because of its retrograde orbit and composition similar to Pluto's, Triton is thought to have been a dwarf planet captured from the Kuiper belt. Triton has a surface of mostly frozen nitrogen, a mostly water-ice crust, an icy mantle and a substantial core of rock and metal. The core makes up two-thirds of its total mass. Triton has a mean density of 2.061 g/cm3 and is composed of approximately 15–35% water ice. Triton is one of the few moons in the Solar System known to be geologically active (the others being Jupiter's Io and Saturn's Enceladus). As a consequence, its surface is relatively young with sparse impact craters, and a complex geological history revealed in intricate cryovolcanic and tectonic terrains. Part of its surface has geysers erupting sublimated nitrogen gas, contributing to a tenuous nitrogen atmosphere less than 1/70,000 the pressure of Earth's atmosphere at sea level. Neptune satellite NULL NULL 354759.00 1353.40 21400000000000000000000.00 10000000000.00 -5.88 157.00 0.00 23,018,000 2.061 0.78 1.46 5.877 4.39 0.00002 38 N2, CH4 No
Charon Charon, also known as Pluto I, is the largest of the five known natural satellites of the dwarf planet Pluto. It was discovered in 1978 at the United States Naval Observatory in Washington, D.C., using photographic plates taken at the United States Naval Observatory Flagstaff Station (NOFS). With half the diameter and one eighth the mass of Pluto, it is a very large moon in comparison to its parent body. Its gravitational influence is such that the barycenter of the Pluto–Charon system lies outside Pluto. In September 2016, astronomers announced that the reddish-brown cap of the north pole of Charon is composed of tholins, organic macromolecules that may be essential ingredients of life, and produced from methane, nitrogen and related gases released from the atmosphere of Pluto and transferred over about 19,000 km (12,000 mi) distance to the orbiting moon. The New Horizons spacecraft is the only probe that has visited the Pluto system. It approached Charon to within 27,000 km (17,000 mi). Pluto satellite NULL NULL 17536.00 603.50 1520000000000000000000.00 920000000.00 6.39 NULL NULL 4,580,000 1.65 0.28 0.58 6.387 0.2 0.0022 53 NULL No
sun_radius = 30
margin = 15
celestial_body_types = [
{label: '', value: 'NULL', color: '#ffc252'},
{label: 'Terrestrial', value: 'terrestrial', color: '#e5d8bd'},
{label: 'Gas giant', value: 'gas_giant', color: 'lightgray'},
{label: 'Ice giant', value: 'ice_giant', color: '#b3cde3'},
{label: 'Asteroid', value: 'asteroid', color: '#fbb4ae'},
{label: 'Plutoid', value: 'plutoid', color: '#decbe4'},
{label: 'Satellite', value: 'satellite', color: 'gray'}
]
color = d3.scaleOrdinal()
.domain celestial_body_types.map (d) -> d.value
.range celestial_body_types.map (d) -> d.color
svg = d3.select 'svg'
width = svg.node().getBoundingClientRect().width
height = svg.node().getBoundingClientRect().height
vis = svg.append 'g'
.attrs
transform: "translate(0, #{height/2})"
d3.csv 'data.csv', (data) ->
data = data.sort (a,b) -> a.distance_from_primary_km - b.distance_from_primary_km
solar_system = (d3.stratify()
.id (d) -> if d.label is 'NULL' then '' else d.label
.parentId (d) -> if d.primary is 'NULL' then '' else d.primary)(data)
distance = d3.scalePow()
.exponent 0.33
.domain [8000000, d3.max solar_system.children, (d) -> +d.data.distance_from_primary_km]
.range [0, width-sun_radius/2-margin]
radius = d3.scalePow()
.exponent 0.4
.domain [0, d3.max solar_system.children, (d) -> +d.data.equatorial_radius_km]
.range [0, 20]
### Sun
###
vis.append 'circle'
.attrs
r: sun_radius*2
cx: -sun_radius/1.5
fill: (d) -> color solar_system.data.subtype
stroke: '#ffe27a'
'stroke-width': '5px'
### Orbits
###
orbits = vis.selectAll '.orbit'
.data solar_system.children
en_orbits = orbits.enter().append 'g'
.attrs
class: 'orbit'
all_orbits = en_orbits.merge(orbits)
all_orbits.append 'circle'
.attrs
r: (d) -> distance d.data.distance_from_primary_km
orbits.exit().remove()
### Sub-orbits
###
angles = [45,22.5,0,-22.5,-45,-22.5,0,11,0,-11,0,11,0] # FIXME: better to insert into the data
suborbits = all_orbits.selectAll '.suborbit'
.data (d) -> if d.children? then d.children else []
en_suborbits = suborbits.enter().append 'g'
.attrs
class: 'suborbit'
transform: (d) ->
i = d.parent.parent.children.indexOf(d.parent)
x = distance(d.parent.data.distance_from_primary_km) * Math.cos(angles[i]*Math.PI/180)
y = distance(d.parent.data.distance_from_primary_km) * Math.sin(angles[i]*Math.PI/180)
return "translate(#{x}, #{y})"
all_suborbits = en_suborbits.merge(suborbits)
all_suborbits.append 'circle'
.attrs
r: (d,i) -> radius(d.data.distance_from_primary_km)
suborbits.exit().remove()
### Planets
###
planets = vis.selectAll '.planet'
.data solar_system.children
en_planets = planets.enter().append 'g'
.attrs
class: 'planet'
transform: (d,i) ->
x = distance(d.data.distance_from_primary_km) * Math.cos(angles[i]*Math.PI/180)
y = distance(d.data.distance_from_primary_km) * Math.sin(angles[i]*Math.PI/180)
return "translate(#{x}, #{y})"
all_planets = en_planets.merge(planets)
all_planets.append 'circle'
.attrs
class: 'halo'
r: (d) -> radius(d.data.equatorial_radius_km) + 3
all_planets.append 'circle'
.attrs
r: (d) -> radius d.data.equatorial_radius_km
.styles
fill: (d) -> color d.data.subtype
.append 'title'
.text (d) -> d.data.label
all_planets.append 'text'
.attrs
'text-anchor': 'middle'
y: (d,i) -> -radius(d.data.equatorial_radius_km) - 5
.text (d) -> d.id
planets.exit().remove()
### Sub-planets
###
subplanets = all_planets.selectAll '.subplanet'
.data (d) -> if d.children? then d.children else []
en_subplanets = subplanets.enter().append 'g'
.attrs
class: 'subplanet'
all_subplanets = en_subplanets.merge(subplanets)
all_subplanets.append 'circle'
.attrs
class: 'halo'
r: (d) -> radius d.data.equatorial_radius_km
cx: (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.cos((i*30+60)*Math.PI/180)
return r*a
cy: (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.sin((i*30+60)*Math.PI/180)
return r*a
all_subplanets.append 'circle'
.attrs
r: (d) -> radius d.data.equatorial_radius_km
cx: (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.cos((i*30+60)*Math.PI/180)
return r*a
cy: (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.sin((i*30+60)*Math.PI/180)
return r*a
.styles
fill: (d) -> color d.data.type
.append 'title'
.text (d) -> d.data.label
all_subplanets.append 'text'
.attrs
'text-anchor': (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.cos((i*30+60)*Math.PI/180)
return if r*a < 0 then 'end' else 'start'
x: (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.cos((i*30+60)*Math.PI/180)
return r*a
y: (d,i) ->
r = radius(d.data.distance_from_primary_km)
a = Math.sin((i*30+60)*Math.PI/180)
return r*a+15
.text (d) -> d.id
subplanets.exit().remove()
### Legend
###
leg = vis.append 'g'
.attrs
class: 'legend'
transform: "translate(15, #{height/2-105})"
leg.insert 'rect'
.attrs
x: -7
y: -7
width: 105
height: 110
legend = leg.selectAll '.item'
.data celestial_body_types.slice(1)
en_legend = legend.enter().append 'g'
.attrs
class: 'item'
all_legend = en_legend.merge(legend)
all_legend.append 'circle'
.attrs
r: 7
cx: 0
cy: (d,i) -> i*18
.styles
fill: (d) -> d.color
all_legend.append 'text'
.attrs
x: 12
y: (d,i) -> i*18
dy: '0.35em'
.text (d) -> d.label.toUpperCase()
legend.exit().remove()
:root {
--background-color: floralwhite;
}
body, html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
font-family: sans-serif;
font-weight: lighter;
font-size: 14px;
}
svg {
width: 100%;
height: 100%;
background: var(--background-color);
}
text {
pointer-events: none;
}
.planet .halo, .subplanet .halo {
fill: var(--background-color);
}
.planet line {
stroke: #000;
}
.subplanet text {
font-size: 11px;
fill: #606060;
}
.orbit circle {
fill: transparent;
stroke: rgba(0,0,0,0.2);
stroke-width: 1;
}
.suborbit circle {
fill: transparent;
stroke: rgba(0,0,0,0.1);
stroke-width: 1;
}
.legend rect {
fill: var(--background-color);
fill-opacity: 0.8;
}
.legend .item text {
font-size: 12px;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Solar System</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v0.4.min.js"></script>
<link rel="stylesheet" href="index.css">
</head>
<body>
<svg></svg>
<script src="index.js"></script>
</body>
</html>
// Generated by CoffeeScript 1.10.0
(function() {
var celestial_body_types, color, height, margin, sun_radius, svg, vis, width;
sun_radius = 30;
margin = 15;
celestial_body_types = [
{
label: '',
value: 'NULL',
color: '#ffc252'
}, {
label: 'Terrestrial',
value: 'terrestrial',
color: '#e5d8bd'
}, {
label: 'Gas giant',
value: 'gas_giant',
color: 'lightgray'
}, {
label: 'Ice giant',
value: 'ice_giant',
color: '#b3cde3'
}, {
label: 'Asteroid',
value: 'asteroid',
color: '#fbb4ae'
}, {
label: 'Plutoid',
value: 'plutoid',
color: '#decbe4'
}, {
label: 'Satellite',
value: 'satellite',
color: 'gray'
}
];
color = d3.scaleOrdinal().domain(celestial_body_types.map(function(d) {
return d.value;
})).range(celestial_body_types.map(function(d) {
return d.color;
}));
svg = d3.select('svg');
width = svg.node().getBoundingClientRect().width;
height = svg.node().getBoundingClientRect().height;
vis = svg.append('g').attrs({
transform: "translate(0, " + (height / 2) + ")"
});
d3.csv('data.csv', function(data) {
var all_legend, all_orbits, all_planets, all_suborbits, all_subplanets, angles, distance, en_legend, en_orbits, en_planets, en_suborbits, en_subplanets, leg, legend, orbits, planets, radius, solar_system, suborbits, subplanets;
data = data.sort(function(a, b) {
return a.distance_from_primary_km - b.distance_from_primary_km;
});
solar_system = (d3.stratify().id(function(d) {
if (d.label === 'NULL') {
return '';
} else {
return d.label;
}
}).parentId(function(d) {
if (d.primary === 'NULL') {
return '';
} else {
return d.primary;
}
}))(data);
distance = d3.scalePow().exponent(0.33).domain([
8000000, d3.max(solar_system.children, function(d) {
return +d.data.distance_from_primary_km;
})
]).range([0, width - sun_radius / 2 - margin]);
radius = d3.scalePow().exponent(0.4).domain([
0, d3.max(solar_system.children, function(d) {
return +d.data.equatorial_radius_km;
})
]).range([0, 20]);
/* Sun
*/
vis.append('circle').attrs({
r: sun_radius * 2,
cx: -sun_radius / 1.5,
fill: function(d) {
return color(solar_system.data.subtype);
},
stroke: '#ffe27a',
'stroke-width': '5px'
});
/* Orbits
*/
orbits = vis.selectAll('.orbit').data(solar_system.children);
en_orbits = orbits.enter().append('g').attrs({
"class": 'orbit'
});
all_orbits = en_orbits.merge(orbits);
all_orbits.append('circle').attrs({
r: function(d) {
return distance(d.data.distance_from_primary_km);
}
});
orbits.exit().remove();
/* Sub-orbits
*/
angles = [45, 22.5, 0, -22.5, -45, -22.5, 0, 11, 0, -11, 0, 11, 0];
suborbits = all_orbits.selectAll('.suborbit').data(function(d) {
if (d.children != null) {
return d.children;
} else {
return [];
}
});
en_suborbits = suborbits.enter().append('g').attrs({
"class": 'suborbit',
transform: function(d) {
var i, x, y;
i = d.parent.parent.children.indexOf(d.parent);
x = distance(d.parent.data.distance_from_primary_km) * Math.cos(angles[i] * Math.PI / 180);
y = distance(d.parent.data.distance_from_primary_km) * Math.sin(angles[i] * Math.PI / 180);
return "translate(" + x + ", " + y + ")";
}
});
all_suborbits = en_suborbits.merge(suborbits);
all_suborbits.append('circle').attrs({
r: function(d, i) {
return radius(d.data.distance_from_primary_km);
}
});
suborbits.exit().remove();
/* Planets
*/
planets = vis.selectAll('.planet').data(solar_system.children);
en_planets = planets.enter().append('g').attrs({
"class": 'planet',
transform: function(d, i) {
var x, y;
x = distance(d.data.distance_from_primary_km) * Math.cos(angles[i] * Math.PI / 180);
y = distance(d.data.distance_from_primary_km) * Math.sin(angles[i] * Math.PI / 180);
return "translate(" + x + ", " + y + ")";
}
});
all_planets = en_planets.merge(planets);
all_planets.append('circle').attrs({
"class": 'halo',
r: function(d) {
return radius(d.data.equatorial_radius_km) + 3;
}
});
all_planets.append('circle').attrs({
r: function(d) {
return radius(d.data.equatorial_radius_km);
}
}).styles({
fill: function(d) {
return color(d.data.subtype);
}
}).append('title').text(function(d) {
return d.data.label;
});
all_planets.append('text').attrs({
'text-anchor': 'middle',
y: function(d, i) {
return -radius(d.data.equatorial_radius_km) - 5;
}
}).text(function(d) {
return d.id;
});
planets.exit().remove();
/* Sub-planets
*/
subplanets = all_planets.selectAll('.subplanet').data(function(d) {
if (d.children != null) {
return d.children;
} else {
return [];
}
});
en_subplanets = subplanets.enter().append('g').attrs({
"class": 'subplanet'
});
all_subplanets = en_subplanets.merge(subplanets);
all_subplanets.append('circle').attrs({
"class": 'halo',
r: function(d) {
return radius(d.data.equatorial_radius_km);
},
cx: function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.cos((i * 30 + 60) * Math.PI / 180);
return r * a;
},
cy: function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.sin((i * 30 + 60) * Math.PI / 180);
return r * a;
}
});
all_subplanets.append('circle').attrs({
r: function(d) {
return radius(d.data.equatorial_radius_km);
},
cx: function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.cos((i * 30 + 60) * Math.PI / 180);
return r * a;
},
cy: function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.sin((i * 30 + 60) * Math.PI / 180);
return r * a;
}
}).styles({
fill: function(d) {
return color(d.data.type);
}
}).append('title').text(function(d) {
return d.data.label;
});
all_subplanets.append('text').attrs({
'text-anchor': function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.cos((i * 30 + 60) * Math.PI / 180);
if (r * a < 0) {
return 'end';
} else {
return 'start';
}
},
x: function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.cos((i * 30 + 60) * Math.PI / 180);
return r * a;
},
y: function(d, i) {
var a, r;
r = radius(d.data.distance_from_primary_km);
a = Math.sin((i * 30 + 60) * Math.PI / 180);
return r * a + 15;
}
}).text(function(d) {
return d.id;
});
subplanets.exit().remove();
/* Legend
*/
leg = vis.append('g').attrs({
"class": 'legend',
transform: "translate(15, " + (height / 2 - 105) + ")"
});
leg.insert('rect').attrs({
x: -7,
y: -7,
width: 105,
height: 110
});
legend = leg.selectAll('.item').data(celestial_body_types.slice(1));
en_legend = legend.enter().append('g').attrs({
"class": 'item'
});
all_legend = en_legend.merge(legend);
all_legend.append('circle').attrs({
r: 7,
cx: 0,
cy: function(d, i) {
return i * 18;
}
}).styles({
fill: function(d) {
return d.color;
}
});
all_legend.append('text').attrs({
x: 12,
y: function(d, i) {
return i * 18;
},
dy: '0.35em'
}).text(function(d) {
return d.label.toUpperCase();
});
return legend.exit().remove();
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment