Please read tips for efficient and successful posting and posting code
Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.
ROOT Version: 6.42.01, 7
Platform: Linux, macOS
Compiler: Not Provided
Dear ROOT team,
we are currently porting the graphical tools of [musrfit]( Welcome to the musrfit documentation! — musrfit V1.12.2 )
(a μSR / β-NMR fitting package) from the classic `TCanvas`/`TRootCanvas` to the ROOT web graphics:
- musrview shows the data and the fitted theory (histograms, Fourier transforms, and for
non-μSR data a `TMultiGraph` of `TGraphErrors`). - mupp_plot plots fit parameters versus an external variable (temperature, field, …),
i.e. a `TMultiGraph` of `TGraphErrors` plus a `TLegend`.
Both use an `ROOT::RWebWindow` with a small custom HTML page; the objects are sent as JSON
(`TBufferJSON`) and drawn with JSROOT, either in an embedded Qt6 web window or in the browser.
This works very nicely, and the JSROOT context menu (marker styles, colours, log scales, …) is
already a big help. Thank you for that!
Coming from the classic GUI, our users miss two features, which they used a lot for preparing
figures and for a quick look at the data. Hence two questions:
(i) Interactive text / LaTeX input
In the classic `TCanvas` the toolbar / `TGedEditor` allowed to place a `TLatex` or a `TPaveText`
interactively with the mouse and to edit its content and attributes afterwards. Is it planned to
provide something similar for the web canvas / JSROOT, i.e. a toolbar (or context menu entry)
to add text with (TMath-)LaTeX syntax at a clicked position, move it, and edit it later?
Ideally this would also be usable in a custom `RWebWindow` page, where we draw the objects
ourselves via `JSROOT.draw()`, and the added primitives could be sent back to the server so that
they end up in a saved figure.
(ii) RFitPanel for TGraph / TMultiGraph
Is it planned that `TGraph`, `TGraphErrors` and the graphs inside a `TMultiGraph` can be simply
selected in the web canvas (e.g. via the context menu “Fit panel”) to run interactive fits with
`ROOT::Experimental::RFitPanel`, as it was possible with the classic `TFitEditor`? In particular
for mupp_plot this would allow the users to quickly fit e.g. an order parameter vs. temperature
without leaving the plot. If this is (partly) possible already, a pointer to an example of how to
connect `RFitPanel` to objects drawn in a custom `RWebWindow` page would be much appreciated.
Thanks a lot for your work on the web graphics, and best regards,
Andreas Suter (PSI)