Ticket #9391 (new)
New algorithm to save json data from workspace
Reported by: | Peter Peterson | Owned by: | Stuart Campbell |
---|---|---|---|
Priority: | major | Milestone: | Backlog |
Component: | Framework | Keywords: | |
Cc: | doucetm@… | Blocked By: | |
Blocking: | Tester: |
Description
This will be used with auto-reduction to write out data for interactive visualization in http://monitor.sns.gov/.
For a single curve
{ "type": "Curve", "xlabel":"x-axis (x-units)", "ylable":"y-axis (y-units)", "curve": {"title":"Label for this curve", "data": [ [x1,y1,dy1], [x2,d2,dy2], ...]} }
For more than one curve on a single plot
{ "type": "ArrayOfCurves", "xlabel":"x-axis (x-units)", "ylable":"y-axis (y-units)", "curves":[ {"title":"Label for this curve", "data": [ [x1,y1,dy1], [x2,d2,dy2], ...]}, {"title":"Label for this curve", "data": [ [x1,y1,dy1], [x2,d2,dy2], ...]} ] }
There still needs to be a way to have multiple sub-plots (e.g. stacked frames for S(Q) and G(r))
Change History
comment:2 Changed 6 years ago by Stuart Campbell
There is http://jsoncpp.sourceforge.net and Qt5 has JSON support! :-) http://qt-project.org/doc/qt-5/json.html
comment:3 Changed 6 years ago by Nick Draper
- Status changed from infoneeded to new
Stuart forgot to "Clarify"
comment:4 Changed 6 years ago by Nick Draper
- Status changed from new to infoneeded
Of course I suspect we want something at the framework level, not the UI, so QT is probably out.
JSON is used in the Script Library and the remote algorithms
Take a look at MantidRemote/src/simplejson.cpp
Also the script repo uses <boost/property_tree/json_parser.hpp> in ScriptRepository\src\ScriptRepositoryImpl.cpp
Could you take a look at these to see if they fit the bill?
comment:5 Changed 6 years ago by Nick Draper
- Milestone changed from Release 3.2 to Backlog
Moved to Backlog at the code freeze of release 3.2
Does this ticket provide a full schema for the JSON? Should we capture the schema somewhere?
Also, I'm not sure if there's a portable JSON generator/parser for C++ that would help you here.