Code Monkey home page Code Monkey logo

Comments (4)

mdtusz avatar mdtusz commented on May 6, 2024 1

Upon further investigation, this isn't really a bug.

To increase the number of points shown on the graph, you must also add a new x values - in situations where your x values are named strings, plotly.js cannot infer what an appended value should be.

Codepen here.

Note: This is not a recommended way to deal with streaming data because all new data points are being saved - the data collection size will continue to grow and will never be truncated in memory.

Edit: I was incorrect here ⬆️! The last argument in extendTraces will truncates both the display of points and the data.

from plotly.js.

buremba avatar buremba commented on May 6, 2024

@mdtusz What's the recommended way to deal with streaming data?

from plotly.js.

mdtusz avatar mdtusz commented on May 6, 2024

Sorry, upon a closer look (and more time in plotly.js code!) I see I was wrong!

In the codepen example, the last argument to extendTraces is 10 - this means that we truncate the data itself to 10 elements, not just the display of data.

In a typical streaming situation however, you would likely want to persist the incoming data to a database or logfile or something as well, but that can be managed separately from plotly.js code.

Sorry for any confusion - hope that helps!

from plotly.js.

buremba avatar buremba commented on May 6, 2024

Got it. Thanks @mdtusz!

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.