terezka / elm-charts

Create SVG charts in Elm.
https://www.elm-charts.org
BSD 3-Clause "New" or "Revised" License
698 stars 67 forks source link

Are CA.centerAt and CA.orHigher meant to work together? #102

Open tankorsmash opened 2 years ago

tankorsmash commented 2 years ago

My intention here was to have a graph centered around 1.0, but have the ranges go from 0.5 to 1.5 to begin, which works.

The issue is that when I've got a datapoint, say 1.8, the linechart is off-screen. I'd expect the chart to expand to include 1.8, instead of stopping at 1.5.

CA.domain
    [ CA.lowest 0.5 CA.orLower
    , CA.highest 1.5 CA.orHigher
    , CA.centerAt 1.0
    ]

The behaviour seems to be more like it's starting the initial bounds of the range, but not updating the bounds of the new data, after the data changes.