Open leeoniya opened 2 years ago
one significant hurdle with doing this is that scales must be computed before the paths are built, so it becomes impossible to properly determine scales without stacking occurring earlier. :thinking:
this could also allow for native support of floating bars or rects, which currently requires a custom pathBuilder.
currently stacked [1] and shifted [2] demos have to pre-stack the raw data, which means
u.data
no longer contains raw values and hooks/plugins cannot read this back for display and we also have to jump through a few hoops to get the live legend to display what we want.uPlot's current way to tweak individual datapoints for rendering is by using a user-provided
disp
option to the pathbuilder of choice. this then handles adapting the raw values to ones needed for actual drawing. however, currently only the bars pathbuilder supportsdisp
*, and it only supports adjustingx0
andsize
, but noty
, which can be used to avoid pre-processing raw data before setData() calls.* also the scatter demo's pathbuilder
[1] https://leeoniya.github.io/uPlot/demos/stacked-series.html [2] https://leeoniya.github.io/uPlot/demos/y-shifted-series.html