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

Make graphs updateable #301

Open
borissmidt opened this issue Jun 15, 2021 · 1 comment
Open

Make graphs updateable #301

borissmidt opened this issue Jun 15, 2021 · 1 comment

Comments

@borissmidt
Copy link

borissmidt commented Jun 15, 2021

I've used the ammonite plotly implementation and for each plot it creates a new browser screen so it isn't possible to show the progress of something or visualize a stream.

It would be nice if you had a plot output which you could update with a new plot.

so

val scatter = Scatter(Seq[Double](1, 2, 3), Seq[Double](2, 3, 4))
scatter.plot("hello", addSuffixIfExists= false)

this could become:

val plotWindow = PlotWindow()
val scatter = Scatter(Seq[Double](1, 2, 3, 4), Seq[Double](2, 3, 4, 5))
plotWindow.update("plot", scatter)
val scatter2 = Scatter(Seq[Double](1, 2, 3), Seq[Double](2, 3, 4))
plotWindow.update("plot", scatter2)

I'm not sure how it could be implemented and i agree that it goes against the immutability idea. But it would make it better to have some interactive visualization of the data.

@dev590t
Copy link

dev590t commented Dec 1, 2021

    Plotly.plot(
      out.toString(),
      plot.toSeq,
      lay,
      openInBrowser = false,
      addSuffixIfExists = false
    )

you can add openInBrowser = false, that will update the file without open a new browser.
Then you manually open the file with a browser, and install pluging in browser to auto update the page.

However, I don't really like this solution.
For instance I have a output file with many data, and each second I rewrite the entire file for just update one data to my disk. I have a SSD disk, it isn't good for its lifetime
I prefer a solution like append the new data to file, or I update the html file in the RAM, the browser directly read the html file in the RAM. But I don't know how do it.

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