BuildingCityDashboards / bcd-dd-v2.1

MIT License
7 stars 5 forks source link

stacked area chart 'offset' produces misleading charts + EDIT #4

Open samstehle opened 4 years ago

samstehle commented 4 years ago

Stacking area chart data includes an 'offset' function which puts each new data series on top of the previous one by adding the values together. See the plot for monthly housing unit completions. It appears as if there were around 300 units in South Dublin, but that is the total of all 4 local authorities.

Removing the offset function (line 15708 in d3.js) produces the second graphic, which is representative of the housing completions data. BUT - the bikes plot now looks like the 3rd graphic, which no longer shows a total number of bikes in the system, but displays bikes available and bikes in use as inverses of each other (which very well may be what should be showed)

I propose adding a yes/no parameter to the stack function which enables the offset function on true. Or removing it altogether, as stacking may be misleading in some cases.

I'm happy to be assigned this issue!

HouseUnitCompletions_Offset

HouseUnitCompletions_noOffset

bikes_noOffset

samstehle commented 4 years ago

EDIT: so now that I've read up on these stacked area charts, the offset is the appropriate use of the plot. That is kind of confusing to me, as the Y axis labels are rendered useless for anything except the bottom most stacked series. For example, the plot below I have recreated for the number of sound sensors above 3 decibel threshholds. There are only 14 sensors, yet the Y axis has 26 labels.

This is maybe something that we should talk about as far interpretability of the plots and/or appropriateness of the stacked area chart.

SoundStations_Offset

LiamOSullivan commented 4 years ago

Thanks Sam. Let me digest this and get back to you. The classes that create 'reusable' charts with d3 are fundamentally flawed, I think, and need a redesign with a coherent and consistent pattern. They don't scale well at all and require too much specialise tweaking, often with magic variables. We're going to need to recreate these using e.g. Plotly as an alternative, as they are maintenance heavy in pure d3. I'll come up with a sprint approach today and we can talk if needs be.