Giter VIP home page Giter VIP logo

Comments (5)

Padanian avatar Padanian commented on May 18, 2024 2

May I suggest to avoid SaveCSV for every plottable, and just create a JSON or XML with all plottables. It would be much easier to serialize from a Plottable tree class to JSON or XML. Just add one more item in the right click contextmenu of the user control. A JSON telegram can then be parsed by the data-logging program or sent via MQTT to a broker. Parsing an XML or JSON vs CSV does not represent a significant overhead.

from scottplot.

swharden avatar swharden commented on May 18, 2024

Actually, maybe a pop-up menu to "select which plottable to export" would be nice, as it would let the user only output a single signal. That way output is always XY.

Edit: I got this started (b73bb9d) and all plottable objects now have a GetCSV() method ready to populate.

from scottplot.

Padanian avatar Padanian commented on May 18, 2024

from scottplot.

swharden avatar swharden commented on May 18, 2024

This turned out to be pretty easy! I implemented SaveCSV (4a04ffc) and added demos to the cookbook: https://github.com/swharden/ScottPlot/tree/master/cookbook#save-scatter-data

I'll figure out the best way to add it to the right-click menu, because it will probably require creation of a pop-up dialog (to select which of multiple plots to save). I'll keep it simple but leave room to add other data format exports later.

from scottplot.

swharden avatar swharden commented on May 18, 2024

I added a "Save Data" button to the right-click menu. It only saves the first object plotted, and the menu item only lights up when the first object is savable as CSV (e.g., you can't save an axis line).

It's a pretty light implementation, but we can add complexity if the need arises. The next step would be for a whole new dialog to pop up listing all the plottable objects, allowing the user select which plot to export, and allowing the user to select which format (XML, JSON, CSV), and things like precision and tab vs. comma separation. This seems like a pretty heavy addition, and if someone wants to work on that they can, but I'm happy to leave this where it is for now until we are ready to invite the additional complexity.

image

from scottplot.

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.