What's the javascript library for this interactive function explorer?

I want to create an interactive web page so that users can see how the dependency of a particular function with multiple parameters is affected, as each one changes its different parameters.

The function I want to illustrate is rather hairy, but for the sake of this question, let's say it's f (t) = A sin (ω t + φ). In this case, the web page will have sliders or dials that allow the user to interactively type in values ​​for A, ω, and φ. The function graph will change simultaneously, reflecting the instantaneous values ​​of the three parameters.

(I looked at d3.js for this, but I'm not sure if this is the right tool for this job (surprisingly), primarily because d3.js seems to be optimized to work with pre Existing data, then as for an application i mean there is no data. I understand it is possible to create "synthetic data" from a function, but this lends a "forceful solution to the problem in a tool". IOW, my question is not whether d3.js can implement such a webapp with d3.js, but rather, is it the best tool for the job.)

As I look further into this issue, I find a whole bunch of JS libraries for graphics, but none of the ones I found focused on building mathematical expressions. I could use some guidelines as to which of all the JS graphical libraries would be better for the task above. In particular, it should provide good support for plotting (math) functions (such as sqrt, sine, log, etc.), and good support for the type of interactive redraw I described.

Thank!

+3


source to share


1 answer


I believe you can use Pre3D as a solid starting point.



Take a look at an example using Pre3D. With several sliders that change the selection parameters, you can achieve nice interactivity, relaying, etc. quite easily. Pre3D also has a small parser that you can use as well.

+1


source







All Articles