[jupyter] support file(s) browsing #21364
Open
linev wants to merge 9 commits intoroot-project:masterfrom
Open
Conversation
Override TFile::Draw pythonization and invoke addVisualObject
then ROOT._jupyter handle is existing.
In the NotebookDrawer implement handling of the TFile instance.
Full file content read in binary buffer and injected into HTML page
as base64-coded blob. In the JavaScript blob encoded back and
HierarchyPainter used to implement file content browsing.
File size limited by 10MB. Bigger files only can be drawn when
file.Draw("force") is invoked.
Fix problem with geometry display
Add implementation for TFile drawing in jupyter Plus changes from last months with full `RNTuple` support Full log: Implement new data types in `RNtuple` - reduced float types kFloat16, kReal32Trunc, kReal32Quant - `std::vector` - `std::map`, `std::unordered_map`, `std::multimap`, `std::unordered_multimap` with `std::pair` - `std::set`, `std::unordered_set`, `std::multiset`, `std::unordered_multiset` - `std::array` - `std::variant` - `std::tuple` - `std::bitset` - `std::atomic` - simple custom classes - streamed types 1. Resort order of ranges in http request, fixing several long-standing problems root-project#374 1. Implement for `TPie` 3d, text, title drawing including interactivity 1. Implement `TCanvas` support in `build3d` function root-project#373 1. Implements `TTree` branches filtering via context menu root-project#364 1. Let define alternative draw function root-project#378 1. Implement padsN draw option for `THStack` and `TMultiGraph` 1. Use `resvg-js` backend for PNG support in node.js root-project#391, thanks to https://github.com/OmarMesqq 1. Remove support for deprectaed `TH1K` class 1. Introduce `settings.ServerTimeout` global timeout for THttpServer operations 1. Let set custom color palette with `setColorPalette` function 1. Upgrade three.js r180 -> r183 1. Fix - paint frame border mode/size from TCanvas 1. Fix - add TLeafG support to TTree root-project#397 1. Fix - interactivity for TH3 palette drawing root-project#398 ## Changes in 7.10.2 1. Fix - correctly process `TLeafB` arrays in tree draw root-project#384 2. Fix - better detect default ranges in `TGraph` histogram 3. Fix - convert BigInt before `RNtuple` drawing 4. Fix - pages and clusters processing in `RNtuple` root-project#390 5. Fix - extra row for legend header, proper horizontal align root-project#21173 ## Changes in 7.10.1 1. Fix - proper paint axis labels on both sides when pad.fTickx/y = 2 2. Fix - recover io after bad http response
Test Results 22 files 22 suites 3d 6h 27m 6s ⏱️ For more details on these failures, see this check. Results for commit b9b8865. ♻️ This comment has been updated with latest results. |
Member
|
this is a great feature. How far are we from being able to embed this in Jupyterlab? |
Member
|
Also, wouldn't "Browse" be a better choice or even an external function or a magic? |
Member
Author
|
If Vincenzo not yet start reviewing PR - I can update it. And yes - one can change pythonization for TFile::Browse() instead of TFile::Draw(). |
Keep the only enableJSVis function to switch magic via `%jsroot on/off`
This is preparation to split functionality in subclasses
…file So one clearly separate functionality. Change slightly interface to be able reuse drawers.Draw function in python and C++ kernel in the same manner
Use specialized method in dedicated Drawer class
Fix expand handling when browsing multiple files Suppress jupyter context menu when showing JSROOT one
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.
Show JSROOT files browser when TBrowser instance created in jupyter
Also pythonization of
TFile::Drawis changed - one can callf.Draw()directly to browse file.One will be able browse file and display all objects from it - very similar to JSROOT basic functionality like:
https://root.cern/js/latest/api.htm#url_syntax_open_file
Works by default only for small files - less than 10 MB. While file content will be embed in HTML page as base64 blob.
If necessary - also large file can be drawn when
br.Draw("force")is called.Also fix problem with TGeo drawing.
Update JSROOT which now also fully support
RNtuplereading.Refactor
NotebookDrawerimplementation - provide dedicated sub-classes for TCanvas, RCanvas, TFile, TGeo.