finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
8.46k stars 1.18k forks source link

Step plot #2442

Open limx0 opened 11 months ago

limx0 commented 11 months ago

Feature Request

Description of Problem:

When viewing financial market data, it often makes sense to view a line plot as a "step" plot rather than a plain line plot (see example below), because it fits more accurately with our view of the values; an ask price that moves from 19 to 20 does not move in an interpolated fashion as the line plot shows, it is 19 until an order is cancelled or fill and then is is 20.

Screenshot 2023-11-20 at 12 15 09 pm

Plot source: https://hvplot.holoviz.org/user_guide/Plotting.html#step

It would be a great feature if perspective could support these kinds of plots.

Potential Solutions:

N/A

timkpaine commented 11 months ago

Unclear if this should be a separate chart or an option on line, I'd opt for the latter now that we have a nice UI for it? https://github.com/d3fc/d3fc/issues/698

    line.interpolate('step');
texodus commented 11 months ago

Ah this may be easy then. We are lacking real estate for column-unaffiliated plugin settings at the moment.

timkpaine commented 11 months ago

Should it be column unaffiliated? I know there are at least 3 interpolations which are useful, but I don't think you'd mix them. But it's a minor inconvenience to set per-column manually.

Edit: A nice reference: http://nickqizhu.github.io/d3-cookbook/src/chapter7/line-interpolation.html I would use linear obviously, plus step and monotone

limx0 commented 11 months ago

Good resource; for clarification on the issue, I'm specifically looking for step-after.