Store canvas as html#22691
Open
linev wants to merge 11 commits into
Open
Conversation
couet
approved these changes
Jun 24, 2026
TWebCanvas can create JSON for any canvas. Now let store such JSON in HTML file which also includes minimal JavaScript code to display such object. Supported also store of several canvases into single HTML file - using TCanvas::SaveAll() method.
In such case TWebCanvas methods invoked via interpreter
Use flex layout and shadows like in pure JSROOT
Like for all other images users can see which files are actually created and size of created files.
Test storage of single canvas and several canvases using TCanvas::SaveAll() method webgui component is required to run such tests
Add item in Save menu and add *.html to list of supported file types in SaveAs dialog
Add correspondent entries to "Save" and "Save as" menu commands.
1. Let store canvas as html file via context menu 1. Improve `TGraph` update 1. When draw TH2/TF2 with "surf same" draw option, only lines are drawn 1. Fix - prevent very long header in context menu 1. Fix - draw 3d contours in "surf3" twice https://root-forum.cern.ch/t/64910
After JSROOT update SURF3 produce more output for contour plot
Collaborator
|
Impressive! Thanks for this. |
Test Results 22 files 22 suites 3d 16h 5m 12s ⏱️ Results for commit b6fb713. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now canvas (or several canvases) can be stored in portable HTML file.
Just call
c1->SaveAs("canvas.html")or invoke correspondent menu item.To store several canvases in single HTML file one can use:
Produced HTML file will include canvas JSON data and JavaScript code to load and display canvas.
Such file can be loaded locally in any web browser or send as attachment in email to colleagues.
Also plain JSROOT now support such feature.
Add several tests to verify that HTML and JSON files are produced and have expected size.
Add release notes
Example of such stored file:
canvas.html
all.html