Posts for Tag: visualization

Planetary Art – Inner Planet Orbital Spirograph

Posted In: Fun
Facebooktwittergoogle_plusredditpinterestlinkedinmail

Earlier, I had made a visualization showing that Mercury is the closest planet to Earth (on average) and not Venus or Mars. To make that, I downloaded a bunch of NASA ephemeris (orbital) data. I realized I could use the same data to make some cool orbital art inspired by a spirograph – a planetary spirograph.

Basically, you get to choose a planet and the visualization will draw a line connecting that planet and Earth every few days. These lines will then build up into a cool pattern over 40 earth years of orbital cycles. Each planet (Mercury, Venus and Mars) has a different orbital period around the sun than Earth does and as a result, interesting patterns emerges.

Orbital periods of the four inner rocky planets:

  • Mercury: 88 days
  • Venus: 225 days
  • Earth:365 days
  • Mars: 687 days

Also evident is that the orbits of some of the planets are not quite circular so the pattern isn’t quite centered on the sun. Venus has the most regular pattern, creating a distinctive 5-lobed design. The other planets also have visually stunning patterns, though they do not repeat perfectly over time.

You can change the planets using the drop down menu as well as change the speed of the spirograph, and hide the planets and the sun.

Data and Tools:
I had thought about simulating the planets but there are plenty of tools out there that generate this orbital data so instead just downloaded 40 years of ephemeris data (data related to positions of astronomical bodies) from NASA website.. I processed the data using javascript and drew the picture using HTML canvas tools.

Planetary Art Spirograph

How do Americans Spend Money? US Household Spending Breakdown by Household Composition

Posted In: Money
spending by household composition
Facebooktwittergoogle_plusredditpinterestlinkedinmail
How much do US households spend and how does it change with household composition?

This visualization is one of a series of visualizations that present US household spending data from the US Bureau of Labor Statistics. This one looks at the marital status and presence of children in the household.

This visualization focuses on how spending varies with the household composition (marital status and presence of children).

I obtained data from the US Bureau of Labor Statistics (BLS), based upon a survey of consumer households and their spending habits. This data breaks down spending and income into many categories that are aggregated and plotted in a Sankey graph.

One of the key factors in financial health of an individual or household is making sure that household spending is equal to or below household income. If your spending is higher than income, you will be drawing down your savings (if you have any) or borrowing money. If your spending is lower than your income, you will presumably be saving money which can provide flexibility in the future, fund your retirement (maybe even early) and generally give you peace of mind.

Instructions:

  • Hover (or on mobile click) on a link to get more information on the definition of a particular spending or income category.
  • Use the dropdown menu to look at averages for different groups of households based on the education level of the primary resident. This data breaks households into the following groups:
    • All
    • Single person households (and other households) – Unfortunately BLS lumps single households with other categories that don’t fit into the remaining three categories (i.e. non-married couple households).
    • Single parent households
    • Married couples with no children
    • Married couples with children

The composition of households and income change as the marital status of and presence of children in the household changes, which in turn affects spending totals and individual categories.

As stated before, one of the keys to financial security is spending less than your income. We can see that on average, income tends to increase the larger the number of children and adults in the household. Married couples with children have the highest incomes and greatest spending, but they also save the most money.

Households with a single occupant (and also single parent households) have lower incomes than married couples and on average need to borrow or draw down on savings to live their lifestyle.

How does your overall spending compare with those that have the same household composition as you? How about spending in individual categories like housing, vehicles, food, clothing, etc…?

Probably one of the best things you can do from a financial perspective is to go through your spending and understand where your money is going. These sankey diagrams are one way to do it and see it visually, but of course, you can also make a table or pie chart (Honestly, whatever gets you to look at your income and expenses is a good thing).

The main thing is to understand where your money is going. Once you’ve done this you can be more conscious of what you are spending your money on, and then decide if you are spending too much (or too little) in certain categories. Having context of what other people spend money on is helpful as well, and why it is useful to compare to these averages, even though the income level, regional cost of living, and household composition won’t look exactly the same as your household.

**Click Here to view other financial-related tools and data visualizations from engaging-data**

Here is more information about the Consumer Expenditure Surveys from the BLS website:

The Consumer Expenditure Surveys (CE) collect information from the US households and families on their spending habits (expenditures), income, and household characteristics. The strength of the surveys is that it allows data users to relate the expenditures and income of consumers to the characteristics of those consumers. The surveys consist of two components, a quarterly Interview Survey and a weekly Diary Survey, each with its own questionnaire and sample.

Data and Tools:
Data on 2017 consumer spending was obtained from the BLS Consumer Expenditure Surveys, and aggregation and calculations were done using javascript and code modified from the Sankeymatic plotting website. I aggregated many of the survey output categories so as to make the graph legible, otherwise there’d be 4x as many spending categories and all very small and difficult to read.

household spending household composition

Cumulative CO2 emissions calculator

Posted In: Environment
CO2 emissions
Facebooktwittergoogle_plusredditpinterestlinkedinmail

CO2 emissions are the primary contributor to our current ‘climate crisis’. Because of buildup of heat-trapping nature of CO2 and other greenhouse gases in the atmosphere, temperatures are rising and weather and precipitation patterns are changing. Changes in climate will have profound impacts on both natural systems and our human landscapes.

Significant emissions of CO2 really started in the industrial revolution. This is when humans really started using significant quantities of non-renewable energy sources, mainly fossil fuels such as coal and later natural gas and oil. The increase in the burning of hydrocarbon energy sources for powering factories and transportation lead to growing CO2 emissions. The following graph shows the annual emissions of CO2 since 1750, before the start of the industrial revolution. In this period of 269 years, humans have emitted 1600 billion tonnes of CO2 (1600 gigatonnes). One incredible fact is that due to rapid growth in population and energy use per capita over time, we are emitting more and more CO2 each year and that humans have emitted as much in the last 28 years than in the 240 years prior to that.

Calculate CO2 emissions since <insert date>



 

Instructions

  • The interactive visualization lets you enter any year between 1750 and 2017 and it will show the relative proportion of human CO2 before and after that year.
  • You can also use the left and right arrow keys to change the year up and down
  • If you hover over the graph you can see the annual and cumulative emission for each individual year in the graph
  • If you want to share the visualization with a specific year highlighted, you can add the following to the URL “?yr=yyyy” where yyyy is the four digit year (e.g. https://engaging-data.com/most-emissions-last-30-years/?yr=1980).

     

    The global median age is around 30 years old (i.e. half the people on earth were born after 1989). This means that more than half of the earth’s population has seen the global cumulative CO2 emissions double in their lifetime. Also very striking is that in my children’s lifetimes (around a decade), humanity has added nearly 1/5 of all human produced CO2 ever to the atmosphere.

    Notes: Emissions are in units of gigatonnes of CO2. To convert to gigatons of carbon, another common unit of measuring carbon emissions, divide by 3.666.

    Data source and Tools
    Annual emissions data is from the Global Carbon Project. The data is processed in javascript and plotted using the open-source, javascript plotting library, Plotly.

    Historical CO2 emissions

  • Where on Earth is all the water? From the solar system to living things

    Posted In: Science | Water
    Facebooktwittergoogle_plusredditpinterestlinkedinmail

    Earth is known as the blue planet, because it’s covered with quite a bit of water. But do you know where all that water on Earth is located? This interactive visualization will show the various amounts of water in its many forms on Earth: Oceans, Lakes, Rivers, Ice, Groundwater, etc….

    If you hover over a part of the circular, sunburst graph, it will show you the amount of water that is in each of the various forms shown. If the label for that form is bolded, you can click on it and see further subdivisions beyond that broad category. For example, if you click on Oceans, it will show you how the water in the oceans is distributed among the five main oceans on Earth. As you move towards more focused views on the graph, you can click on the center of the circle to move back out to larger categories and see the big picture again.

    As you can see, most of the water on Earth is found in a salty form, and most of that is in the oceans. It can be hard to click through to see freshwater lakes and rivers, as you have to be very precise to expand the “Surface Water” wedge, when you are looking at all “Freshwater”.

    Even smaller, on that same visualization, is the “Living things” wedge is basically invisible. You can further explore the details of the living things category by clicking on the button that appears on the freshwater graph.

    Checking the Group Rivers and Lakes checkbox will group rivers by continent and lakes by major groups.

    It is interesting to see how much water there is on Earth (about 1.4 billion cubic kilometers of water), but how little of it is non-salty, liquid freshwater at the surface (about 100,000 cubic kilometers, though that is still quite a lot) but it only makes up about 0.008% of all water on Earth. That means for every 10,000 gallons of water on Earth, only one of those gallons is freshwater in a lake or river that we can easily access.

    It is also believed that there is more water deep in the Earth’s interior (i.e. the mantle) than on the surface or near-subsurface, but estimates of that are highly uncertain and are not included in this graph.

    If you click out past Earth’s water to look at water in the solar system, the estimates shown in this visualization are only including liquid water and do not include estimates of ice (which I haven’t been able to find estimates of). The amount of water in living things is estimated assuming that the ratio of organic carbon to liquid water is more or less the same across all different types of living things (i.e. viruses, bacteria, fungi, plants, animals, etc.). This isn’t a great assumption but the estimates, which come from estimates of the dry carbon weight of these organisms, vary across many orders of magnitude so being off in liquid water weight/volume by a factor of two or so isn’t a huge problem.

    Tools and Data Sources
    The sunburst chart is made using the open source, javascript Plot.ly graphing library. Data on water distributions is primarily from Wikipedia – Distribution of WaterList of Rivers by DischargeList of Lakes Weight of Living BiomassExtra-terrestrial water estimates

    water on earth

    National Park Service Voronoi Map

    Posted In: Maps
    National Park Voronoi Map
    Facebooktwittergoogle_plusredditpinterestlinkedinmail

    This map divides up the Continental United States into different regions depending on which National Park (or other National Park Service site) is closest to it. It is based on a straight-line (‘as the crow flies’) distance between locations rather than along road networks. It is an example of a Voronoi Diagram, which is subdivided into different regions based upon the distance between points of interest. Everything within a subregion is closer to the point defining the region than any other point.

    Hover over the circle points to see the name of the park. The map has a dropdown menu that lets you choose between the following types of locations in the National Park Service:

    • National Parks
    • National Historic Sites
    • National Memorial Sites
    • National Monuments
    • National Seashores/Lakeshores
    • National Recreation Areas
    • National Battlefields
    • National Military Sites
    • National Scenic Areas

    For National Parks, there is a high concentration of National Parks in the Western US, especially around the Southwestern US and running up the Pacific Coast. As a result, in these areas, the Voronoi regions are fairly small. The Southwest is also home to a high concentration of National Monuments. There are only few parks in the Eastern US and so the Voronoi regions are correspondingly large. Looking at National Historic Sites, the situation is flipped somewhat, with a high concentration of historic sites in the eastern US, and specifically the Northeast.

    Let me know in the comments which park you are closest to and which park you last visited.

    Tools and Data Sources
    Locations of each of the National Park Service sites comes from the National Park Service. The map was created using the Leaflet javascript mapping library and the Voronoi diagram using the Turfjs javascript, geospatial analysis library.

    National Park Voronoi Map

    Zip Code Map of the United States

    Posted In: Maps
    US zip code map
    Facebooktwittergoogle_plusredditpinterestlinkedinmail

    This zip code map of the United States visualizes over 42,000 zip codes in the 50 states. Zip codes are five digit postal codes used for mail delivery in the US. The points on the map show the geographic center of each zip code. The interactive visualization lets you type in a zip code and will show you where that zip code lies on the map. As you begin to type in the zip code, the map will highlight all the zip codes that begin with those numbers.

    For example, if you type in “0”, you will highlight all zip codes that start with the zero in the Northeastern US. This will represent about 10% of the zip codes in the US. When you type in another number, it will narrow down the zip codes that begin with those two digits (approximately 1% of zip codes). It will progressively narrow down the number of zip codes as you type in more numbers, until you get to a full 5 digit zip code that represents 1 out of almost 43,000 zip codes (0.002% of zip codes). The map will then tell you the name of the city that that zip code is in.

    You can explore how zip codes are distributed across the US by typing in different 1 and 2 digit numbers. You can also click on the check box to show or hide the outlines of the states.

    Sources and Tools:

    Zip code data was downloaded from opendatasoft.com. And the visualization was created using javascript and the open source leaflet javascript mapping library.

    US zip code map