Render a Histogram of salaries
Knowing the median salary is great and all, but it doesn’t tell you much about what you can expect. You need to know the distribution to see if it’s more likely you’ll get 140k or 70k.
That’s what histograms are for. Give them a bunch of data, and they show its distribution. We’re going to build one like this:
In the shortened dataset, 35% of tech salaries fall between 80k, 26% between 100k etc. Throwing a random dice using this as your random distribution, you’re far more likely to get 60k-80k than 120k-140k. Turns out this is a great way to gauge situations.
It’s where fun statistics like “More people die from vending machines than shark attacks” come from. Which are you afraid of, vending machines or sharks? Stats say your answer should be heart disease. ;)
Anyway, let’s build a histogram. We’ll start with changes in App.js
, make a Histogram
component using the full-feature approach, then add an Axis
using the blackbox HOC approach. We’re also going to add some CSS, finally.
Step 1: Prep App.js
You know the drill, don’t you? Import some stuff, add it ...