plouc/nivo

Treat Line x values as linear scale? (Timeline functionality)

Closed this issue · 5 comments

It may be that I haven't figured out the proper combo of options and data setup, but is there a way when using @nivo/line to treat the x-axis as a number line, where the x values are placed from low to high on the axis corresponding to their actual position, instead of being equally distributed?

The use case here is rendering a contiguous line chart with the x-axis being time with irregular values. So far, the only solution I've come up with is filling in my data values with copies for all missing timestamps, but that gets difficult when values don't land evenly.

(For reference, Chartist has a decent generic implementation of this with fixedscaleaxis.js)

Thanks for the amazing library @plouc!

plouc commented

Hi @jlyman,

There's no support for continuous scales on the line package, I've previously tried to add this functionality but without success for now, my major problem was to be able to provide the same defaults/easy to use components without introducing too much of setup.

Line supports stacked lines via slice selection (to be able to provide the stacked tooltip for example),
I must find a way to provide more low level components to cover such cases or rethink the whole package.

The scatterplot package partially supports this, but I've coded it after the line package, so it does not provides functionality depending on a specific scale type.

I'm very concerned about this feature, it's a limitation for many chart types, I'm currently working on improving legends support for all components, my next big thing on the project might be to fix this, probably with a bunch of BC breaks though :)

Awesome, thanks for the notes @plouc.

Currently wrapping up a couple of very busy projects, but once those settle down if there's a chance for the community to get involved on a PR with this one I'd be happy to contribute.

plouc commented

That would be awesome :)

Any updates? It would be a really nice feature!!

plouc commented

Implemented via #275