Code Monkey home page Code Monkey logo

Comments (1)

chriddyp avatar chriddyp commented on May 7, 2024

Two additions:
1 - User guide chapter: http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb

2 - Help!

>>> help(py.stream)

Help on class Stream in module plotly.plotly.plotly:

class Stream
 |  Interface to Plotly's real-time graphing API.
 |  
 |  Initialize a Stream object with a stream_id
 |  found in https://plot.ly/settings.
 |  Real-time graphs are initialized with a call to `plot` that embeds
 |  your unique `stream_id`s in each of the graph's traces. The `Stream`
 |  interface plots data to these traces, as identified with the unique
 |  stream_id, in real-time.
 |  Every viewer of the graph sees the same data at the same time.
 |  
 |  View examples and tutorials here:
 |  http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb
 |  
 |  Stream example:
 |  # Initialize a streaming graph
 |  # by embedding stream_id's in the graph's traces
 |  >>> stream_id = "your_stream_id" # See https://plot.ly/settings
 |  >>> py.plot(Data([Scatter(x=[],
 |                            y=[],
 |                            stream=dict(token=stream_id, maxpoints=100))])
 |  # Stream data to the import trace
 |  >>> stream = Stream(stream_id) # Initialize a stream object
 |  >>> stream.open() # Open the stream
 |  >>> stream.write(dict(x=1, y=1)) # Plot (1, 1) in your graph
 |  
 |  Methods defined here:
 |  
 |  __init__(self, stream_id)
 |      Initialize a Stream object with your unique stream_id.
 |      Find your stream_id at https://plot.ly/settings.
 |      
 |      For more help, see: `help(plotly.plotly.Stream)`
 |      or see examples and tutorials here:
 |      http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb
 |  
 |  close(self)
 |      Close the stream connection to plotly's streaming servers.
 |      
 |      For more help, see: `help(plotly.plotly.Stream)`
 |      or see examples and tutorials here:
 |      http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb
 |  
 |  open(self)
 |      Open streaming connection to plotly.
 |      
 |      For more help, see: `help(plotly.plotly.Stream)`
 |      or see examples and tutorials here:
 |      http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb
 |  
 |  write(self, data, reconnect_on=(200, '', 408))
 |      Write `data` to your stream. This will plot the
 |      `data` in your graph in real-time.
 |      
 |      `data` is a plotly formatted dict.
 |      Valid keys:
 |          'x', 'y', 'text', 'z', 'marker', 'line'
 |      
 |      Examples:
 |      >>> write(dict(x = 1, y = 2))
 |      >>> write(dict(x = [1, 2, 3], y = [10, 20, 30]))
 |      >>> write(dict(x = 1, y = 2, text = 'scatter text'))
 |      >>> write(dict(x = 1, y = 3, marker = dict(color = 'blue')))
 |      >>> write(dict(z = [[1,2,3], [4,5,6]]))
 |      
 |      The connection to plotly's servers is checked before writing
 |      and reconnected if disconnected and if the response status code
 |      is in `reconnect_on`.
 |      
 |      For more help, see: `help(plotly.plotly.Stream)`
 |      or see examples and tutorials here:
 |      http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb

from plotly.py.

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.