Open david-topham opened 4 years ago
currently it's tied to mouse... but this is a great point! I will document the code here in this issue best I can in attempt to help create a feature for this.
in the pspicture
environment definition, here are the touch/mouse movements in the source, producing userEvent
s:
https://github.com/pyramation/LaTeX2JS/blob/master/packages/latex2js-pstricks/src/lib/psgraph.js#L513-L530
userline
: https://github.com/pyramation/LaTeX2JS/blob/master/packages/latex2js-pstricks/src/lib/psgraph.js#L564uservariable
: https://github.com/pyramation/LaTeX2JS/blob/master/packages/latex2js-pstricks/src/lib/psgraph.js#L540It basically just re-renders everything on each userEvent
(touch/mouse movement)
slider is really it's own component that gets injected:
so seems that we may want to move the variables out of these individual contexts, and into state, which is decoupled from the actual rendering environments.
One application of having access to points in the pspicture could be that the user could modify it through the DOM interface. Another could be to create an animation where the variable changes based on a timer.
I love this project! Very well thought out and implemented. While working with the interactive samples, I could not tell if uservariable and slider are available for any pstricks code, or if they are hard-coded to only work with mouse ( for psline ) or psplot. i.e. Could I get users choice via html/javascript input to control location of psline?