Skip to content
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

User interaction #25

Open
david-topham opened this issue Jul 13, 2020 · 2 comments
Open

User interaction #25

david-topham opened this issue Jul 13, 2020 · 2 comments

Comments

@david-topham
Copy link

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?

@pyramation
Copy link
Owner

pyramation commented Jul 17, 2020

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.

uservariable and userline

in the pspicture environment definition, here are the touch/mouse movements in the source, producing userEvents:
https://github.com/pyramation/LaTeX2JS/blob/master/packages/latex2js-pstricks/src/lib/psgraph.js#L513-L530

It basically just re-renders everything on each userEvent (touch/mouse movement)

slider

slider is really it's own component that gets injected:

state variables as a potential solution

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.

@david-topham
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants