user-defined series path builder
See original GitHub issueWhile I’ve seen the note in README I wonder if you would consider at least accepting a user-supplied bezier-drawing function to smooth curves which is particularily nice to have on plots with only a few data points.
I’m no expert on canvas drawing, but I imagine for every line to render, you could call the user’s function using (xStart, yStart, xEnd, yEnd)
arguments, do ctx.moveTo(xStart, yStart);
and accept back the arguments to use on ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
to draw the curve.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
What is key Path in user defined runtime attributes?
Use user defined runtime attributes to set an initial value for objects that do not have an interface builder inspector. For example, if...
Read more >Help Online - Tutorials - User Defined Fitting Function
In this tutorial, we will mainly illustrate how to create a user-defined fitting function in Fitting Function Builder, carry out nonlinear curve fit...
Read more >User-defined transformations ‒ Qlik Replicate
The path is the same on Linux, but with slashes (/)instead of backslashes (\). ... be available in the Expression Builder under Functions->User...
Read more >Experiment in Journey Builder with Path Optimizer
Configure an automatic or manual winner with up to 10 paths with user-defined distributions. The system automatically picks a winner on email engagement...
Read more >POSTPROCESSOR BUILDING - "User Defined Events (UDEs)"
POSTPROCESSOR BUILDING - " User Defined Events (UDEs)" Interesujesz się programowaniem obrabiarek CNC? Sprawdź informacje na temat NX CAM: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
updates:
series.draw
is gone, replaced byseries.paths: () => null
. (candlestick demo updated, cc @ldstein)the API for
series.paths
matches the internalbuildPaths()
[1] signature:a minor inconvenience remains with the fact that the internal
buildPaths()
is able to usegetXPos()
&getYPos()
directly to get canvas offsets, but the exposed.valToPos()
returns css pixel offsets, making you re-multiply bydevicePixelRatio
. you can see this already being done here:https://github.com/leeoniya/uPlot/blob/01be7829ce6a743fb19dad2a930b8f66b57ff48e/demos/candlestick-ohlc.html#L143-L147
i should add extra methods, or a bool param to
u.valToPos(val,"x", true)
to directly return canvas pixels.i also realized that this change is insufficient to fully convert the candlestick rendering in the demo because the the candles are effectively custom path “points”, for which i’ll soon add a similar-ish api as part of #10.
[1] https://github.com/leeoniya/uPlot/blob/master/src/Line.js#L682
uPlot now includes a smooth spline pathBuilder in the core, with a much better implementation than what’s in this demo.
https://leeoniya.github.io/uPlot/demos/line-paths.html