Skip to content

Example of using IterationManagers.jl with PlotlyJS.jl to update plot#2

Open
cc7768 wants to merge 1 commit intosglyon:masterfrom
cc7768:master
Open

Example of using IterationManagers.jl with PlotlyJS.jl to update plot#2
cc7768 wants to merge 1 commit intosglyon:masterfrom
cc7768:master

Conversation

@cc7768
Copy link
Copy Markdown

@cc7768 cc7768 commented Mar 22, 2016

Still needs some clean up, but the concept is here.

@sglyon
Copy link
Copy Markdown
Owner

sglyon commented Mar 24, 2016

Cool!

This will be extra great when we can compose managers and states.

It would be best if we could not replace the entire array every time we want to add a single point. What if we try something like this:

  • Add a field to the manager that specifies the maximum number of points we want to every be displayed on the plot. Maybe maxpoints::Int or something like that
  • Change plot_update to take and return scalars instead of vectors. I know this was just an example function, but let's try to get the example right!
  • in update! lets call extendtraces!(mgr.p, 1, mgr.maxpoints; y=Vector[[new_point]]) instead of restyle!. This will leverage plotly's efficient mechanism for adding data to a trace attribute rather than just replacing the whole attribute.
  • We can just let iter_hook and post_hook be functions that return nothing.

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

Successfully merging this pull request may close these issues.

2 participants