-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Behavior at jump discontinuities #133
Comments
Totally agreed. I think the function approach might be required for cases where there are infinite discontinuities, but instead of accepting a number and returning a boolean, it should accept a range and return a list (with the option to pass a static list, no function). Mafs could use those values and:
In other words, a way to indicate important regions to plot. |
Agreed also on the approach for jump discontinuities. For holes, the best approach would probably just be a two This means adding a mask to some functions which may have an effect on perf, but I doubt it. |
Wow thanks for starting working on this so quickly, this looks great! I think your modifications for the "jump" api make sense, and if you're open to doing code review I would be happy to take a crack at implementing it. As a mathematician, I swear Javascript makes some truly odd choices for built in operators that have caused some surprising and sneaky bugs for my viz. I have certainly not come to expect ergonomics haha. |
Consider the plot
<Plot.OfX y={(x: number) => math.mod(x, 1)}/>
. This of course has a number of jump discontinuities, but by default mafs joins discontinuities with a vertical line. Personally, I find this behavior unexpected and undesirable and would like to at least have the option to configure the discontinutiy behavior. Something like Mathematica'sExclusions
andExclusionsStyle
seem appropriate for the existing Mafs API. I.e., the user providesPlot.OfX
with a parameter which tells it where the discontinuities are and how they should be drawn.To my mind, this should either be:
(x: number): boolean
I think the "jump" style that I'm hoping for can be accomplished by modifying the
onPoint
callback insampleParametric
to output an M command rather than an L command if the t value of the point is a discontiuity.Let me know what you think! I love the library, and I'm using it to make companion interactive visualizations for my dissertation :)
The text was updated successfully, but these errors were encountered: