jibeproject / jibe-vis

Interactive visualisation app for exploring health impacts of urban planning scenarios based on large-scale transport and health simulation modelling.
MIT License
0 stars 0 forks source link

Legend values and bins should be customisable per data story scenario #24

Closed carlhiggs closed 1 month ago

carlhiggs commented 1 month ago

Currently the legend is fixed with four bins labeled 1 to 4, regardless of the scenario: image

For example, that scenario would be better labelled with perhaps 5 bins (0-20 %, 20-40 %, 40-60 %, 60-80 %, 80-100 %), where the last meets the target threshold.

This should be defined within a data story, without a user having to supply html code. e.g. just supply values and optionally corresponding labels. The number of values supplied indicates number of bins (e.g. 4 for LTS, or 5 for 20mnMelbourne).

carlhiggs commented 1 month ago

This is resolved, e.g. image

The data story JSON code to define the above is,

"legend": [
    {"upper":"≤20%"},
    {"upper":"20%", "lower":"to 40%"},
    {"upper":"40%", "lower":"to 60%"},
    {"upper":"60%", "lower":"to 80%"},
    {"upper":"80%", "lower":"to 100%",
     "label": "Target threshold", 
      "title": "80% or greater (policy target)"
    }
],

This should work for basic equal bin size legends with discrete/continuous values