Git Product home page Git Product logo

Comments (21)

etpinard avatar etpinard commented on May 5, 2024 2

@awesomebytes for fast data updates, I'd recommend using Plotly.extendTraces.

More info: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_api.js#L1349

from plotly.js.

nzjrs avatar nzjrs commented on May 5, 2024 2

@etpinard at least the ability to update the traces via websocket

from plotly.js.

sboselli avatar sboselli commented on May 5, 2024 1

From the announcement (https://plot.ly/javascript/open-source-announcement/):


R, PYTHON, & MATLAB ENGINEERS AND DATA SCIENTISTS

Plotly can now be used 100% offline in RStudio, MATLAB, or Jupyter notebook free-of-charge. The R, Python, and MATLAB clients for Plotly have always been open-source, while the core graphics layer—plotly.js—was closed-source. Now the entire stack is open-source.

This makes for a better user experience:

  • There is no round-trip to Plotly’s server, so plotting is fast.
  • For the same reason, you can plot more data.
  • In RStudio, Plotly charts now appear natively in RStudio instead of opening in a browser tab.
  • Everything is local — You can create charts completely independently from Plotly’s online platform.

I'm still not sure about the JS version. Can anyone confirm if the JS version can now also be used entirely offline?

from plotly.js.

awesomebytes avatar awesomebytes commented on May 5, 2024 1

I would gladly try, but the instructions of the tutorial mention login/get
api keys, which, if I don't need them, I guess I need to run some kind of
server. So I don't know where to start. Maybe it's just a matter of time to
get things updated.

2015-11-18 16:00 GMT+01:00 voodah [email protected]:

From the announcement (

https://plot.ly/javascript/open-source-announcement/):

R, PYTHON, & MATLAB ENGINEERS AND DATA SCIENTISTS

Plotly can now be used 100% offline in RStudio, MATLAB, or Jupyter
notebook free-of-charge. The R, Python, and MATLAB clients for Plotly have
always been open-source, while the core graphics layer—plotly.js—was
closed-source. Now the entire stack is open-source.

This makes for a better user experience:

  • There is no round-trip to Plotly’s server, so plotting is fast.
  • For the same reason, you can plot more data.
  • In RStudio, Plotly charts now appear natively in RStudio instead of
    opening in a browser tab.
  • Everything is local — You can create charts completely independently
    from Plotly’s online platform.

I'm still not sure about the JS version. Can anyone confirm if the JS
version can now also be used entirely offline?


Reply to this email directly or view it on GitHub
#16 (comment).

from plotly.js.

chriddyp avatar chriddyp commented on May 5, 2024 1

Hey @awesomebytes - the streaming API is a hosted service that's provided by plotly - it handles the real-time data-store and the web-socket connections to the charts in the browser. The underlying charting library that streaming uses, plotly.js, is what's contained in this repo.
You can refresh your own charts in "real-time" by successively calling Plotly.newPlot in the client.
@voodah - Yes, the JS version can be used entirely offline. See https://plot.ly/javascript for documentation and examples.

from plotly.js.

chriddyp avatar chriddyp commented on May 5, 2024 1

@awesomebytes Yes it will. Check out any of the examples in the javascript docs (https://plot.ly/javascript) to get started. For live updating, to refresh the entire graph, the code would look something like:

setInterval(function(){Plotly.plot(divid, [{"x": i, "y": i}]);}, 50)

from plotly.js.

clement-moulin-frier avatar clement-moulin-frier commented on May 5, 2024 1

Hi everyone, I'm also very interested by this feature (offlline streaming).

@awesomebytes : have you eventually found a way to do it? I've looked at the plotly.py github issues but haven't found anything related.

@chriddyp : actually calling plotly.offline.iplot in a loop create one plot per call (so resulting in many plots displayed in the notebook).

Thanks a lot!

from plotly.js.

awesomebytes avatar awesomebytes commented on May 5, 2024

Hey @chriddyp, so it will behave fast as you say in the example with your API (20Hz)?

Is there any example that does that where I can hook up some data to test?

Thank you very much for your answer.

from plotly.js.

awesomebytes avatar awesomebytes commented on May 5, 2024

@chriddyp But... I have no idea of JavaScript, what about the Python interface?
I'm very sorry if my comments are annoying but I'm very curious to try this stuff. Should I open an issue at https://github.com/plotly/plotly.py ?
I've seen the offline python documentation: https://plot.ly/python/offline/ but I see only an ipython notebook example, not updating the data once the plot is done.
Is there a streaming-like demo, offline?
Is there a way of just publishing to a local url to be accessed by any browser?

Thanks once again.

from plotly.js.

chriddyp avatar chriddyp commented on May 5, 2024

Hi @awesomebytes - yes, please open an issue in the python library repo. You won't be able to remotely update your charts on the web without using the streaming API or your own server infrastructure. If you want to just update your chart locally, you can successively call plotly.offline.iplot in a loop.
If you want your chart to be accessed by any browser, you need to host your graph on a server. The easiest way to do this is to host your graphs on Plotly (https://plot.ly), which provides a hosting service that is free for public data.
For questions about the python library, post to https://github.com/plotly/plotly.py and for general plotly questions, ask the community at http://community.plot.ly/.
Thanks for your interest!

from plotly.js.

awesomebytes avatar awesomebytes commented on May 5, 2024

I didn't find a way, I'm sorry.

2016-01-28 15:54 GMT+01:00 Clément Moulin-Frier [email protected]:

Hi everyone, I'm also very interested by this feature (offlline streaming).

@awesomebytes https://github.com/awesomebytes : have you eventually
find a way to do it? I've looked at the plotly.py
https://github.com/plotly/plotly.py issues but haven't found anything
related.

@chriddyp https://github.com/chriddyp : actually calling call
plotly.offline.iplot in a loop create one plot per call (so resulting in
many plots displayed in the notebook).

Thanks a lot!


Reply to this email directly or view it on GitHub
#16 (comment).

from plotly.js.

JeanBilheux avatar JeanBilheux commented on May 5, 2024

Any update on your work awesomebytes? That's a feature I really want to in my notebook.

from plotly.js.

awesomebytes avatar awesomebytes commented on May 5, 2024

Didn't find a way and I'm not actively working on it anymore.

2016-04-24 4:22 GMT+02:00 Jean Bilheux [email protected]:

Any update on your work awesomebytes? That's a feature I really want to in
my notebook.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#16 (comment)

from plotly.js.

chrisidefix avatar chrisidefix commented on May 5, 2024

After reading through this very helpful issue I concluded that you can easily redraw your plots by constantly calling plotly.offline.plot in a loop as mentioned by @chriddyp - this may not be exactly what @awesomebytes @JeanBilheux @clement-moulin-frier where after, but here is a very simple example that will redraw a plot random input data once every second for 10 iterations:

import time
import numpy as np
from plotly.offline import plot
from plotly.graph_objs import *
for i in range(10):
    time.sleep(1)
    plot([Box(y = np.random.randn(50), showlegend=False) for i in range(45)], show_link=False)

Of course this will simply reload a temporary webpage and won't get you high frame rates (I don't think 20 Hz is possible this way), but it's a start.

from plotly.js.

jackparmer avatar jackparmer commented on May 5, 2024

@hyliu1989 Made a very nice solution here:
https://github.com/hyliu1989/PlotlyOfflineStream

from plotly.js.

nzjrs avatar nzjrs commented on May 5, 2024

@jackparmer FYI that's not really streaming, it's replacing the whole plot each timestep, which is not really optimal.

from plotly.js.

hyliu1989 avatar hyliu1989 commented on May 5, 2024

Hi there. Hopefully this can be a first step toward the offline streaming. I just found @etpinard gave an example of using extendTraces() in JS. With that we can probably do the streaming.

Question, if there is a heatmap that I want to update and it is in a subplot, do we still have something like extendTraces() for it?

from plotly.js.

nzjrs avatar nzjrs commented on May 5, 2024

extend traces is one way to do something like streaming, but it's not close to what plotly does under the hood to allow rich live updating. I understand the motivation for the plotly folks to keep that bit private - it is of course one of the proprietary features of their paid service.

Personally, I've switched to bokeh as it supports true streaming and interactivity.

from plotly.js.

etpinard avatar etpinard commented on May 5, 2024

but it's not close to what plotly does under the hood to allow rich live updating.

@nzjrs I'm curious, what kind of rich live updating features are you looking for?

from plotly.js.

ronindesign avatar ronindesign commented on May 5, 2024

@nzjrs I'm new to plotting via python, but am in the same spot.

Will be streaming live graph via browser and will need to add / shift many data points in small time interval.
Performance is in top 3 objectives, so wanting something that can handle efficient streaming / updates.

If this is not natural / intuitive for plotly, I may need to checkout Bokeh or another solution for pushing data to frontend websocket subscribers which can then update/repaint/rerender graph efficiently.

from plotly.js.

bretcj7 avatar bretcj7 commented on May 5, 2024

@chrisidefix and @chriddyp isn't calling plot repeatedly in a loop going to open up a new tab in the browser for every plot? Or is there a way to have it keep updating the single tab?

from plotly.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.