Basic TCanvasImp ABI implementation for Web-based Graphics Provides painting of main ROOT classes in web browsers using JSROOT
Following settings parameters can be useful for TWebCanvas:
WebGui.FullCanvas: 1 read-only mode (0), full-functional canvas (1) (default - 1) WebGui.StyleDelivery: 1 provide gStyle object to JSROOT client (default - 1) WebGui.PaletteDelivery: 1 provide color palette to JSROOT client (default - 1) WebGui.TF1UseSave: 1 used saved values for function drawing: 0 - off, 1 - if client fail to evaluate function, 2 - always (default - 1)
TWebCanvas is used by default in interactive ROOT session. To use web-based canvas in batch mode for image generation, one should explicitly specify --web
option when starting ROOT:
[shell] root -b --web tutorials/hsimple.root -e 'hpxpy->Draw("colz"); c1->SaveAs("image.png");'
If for any reasons TWebCanvas does not provide required functionality, one always can disable it. Either by specifying root --web=off
when starting ROOT or by setting Canvas.Name: TRootCanvas
in rootrc file.
Definition at line 35 of file TWebCanvas.h.
Classes | |
struct | PadStatus |
struct | WebConn |
Public Types | |
using | ObjectSelectSignal_t = std::function< void(TPad *, TObject *)> |
Function type for signals, invoked when object is selected. | |
using | PadClickedSignal_t = std::function< void(TPad *, int, int)> |
Function type for pad-click signals. | |
using | PadSignal_t = std::function< void(TPad *)> |
Function type for pad-related signals - like activate pad signal. | |
using | UpdatedSignal_t = std::function< void()> |
Function type for signals, invoked when canvas drawing or update is completed. | |
Public Member Functions | |
TWebCanvas (TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height, Bool_t readonly=kTRUE) | |
Constructor. | |
~TWebCanvas () override | |
Destructor. | |
void | ActivateInEditor (TPad *pad, TObject *obj) |
Activate object in editor in web browser. | |
void | Close () override |
Close web canvas - not implemented. | |
void | ForceUpdate () override |
Increment canvas version and force sending data to client - do not wait for reply. | |
Bool_t | GetCanCreateObjects () const |
Bool_t | GetLongerPolling () const |
Int_t | GetPaletteDelivery () const |
Int_t | GetPrimitivesMerge () const |
Int_t | GetStyleDelivery () const |
const std::shared_ptr< ROOT::RWebWindow > & | GetWebWindow () const |
UInt_t | GetWindowGeometry (Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override |
Returns window geometry including borders and menus. | |
Bool_t | HasEditor () const override |
Returns kTRUE if web canvas has graphical editor. | |
Bool_t | HasMenuBar () const override |
Returns kTRUE if web canvas has menu bar. | |
Bool_t | HasStatusBar () const override |
Returns kTRUE if web canvas has status bar. | |
Bool_t | HasToolBar () const override |
Bool_t | HasToolTips () const override |
Returns kTRUE if tooltips are activated in web canvas. | |
void | Iconify () override |
Iconify browser window. | |
Int_t | InitWindow () override |
Initialize window for the web canvas At this place canvas is not yet register to the list of canvases - one cannot call RWebWindow::Show() | |
TClass * | IsA () const override |
Bool_t | IsAsyncMode () const |
Bool_t | IsFixedSize () const |
virtual Bool_t | IsReadOnly () const |
void | RaiseWindow () override |
Raise browser window. | |
void | SetActivePadChangedHandler (PadSignal_t func) |
void | SetAsyncMode (Bool_t on=kTRUE) |
void | SetCanCreateObjects (Bool_t on=kTRUE) |
void | SetCanvasSize (UInt_t w, UInt_t h) override |
Set canvas size of web canvas. | |
void | SetLongerPolling (Bool_t on) |
void | SetObjSelectHandler (ObjectSelectSignal_t func) |
void | SetPadClickedHandler (PadClickedSignal_t func) |
void | SetPadDblClickedHandler (PadClickedSignal_t func) |
void | SetPaletteDelivery (Int_t val) |
void | SetPrimitivesMerge (Int_t cnt) |
void | SetStyleDelivery (Int_t val) |
void | SetUpdatedHandler (UpdatedSignal_t func) |
void | SetWindowPosition (Int_t x, Int_t y) override |
Set window position of web canvas. | |
void | SetWindowSize (UInt_t w, UInt_t h) override |
Set window size of web canvas. | |
void | SetWindowTitle (const char *newTitle) override |
Set window title of web canvas. | |
void | Show () override |
Show canvas in browser window. | |
void | ShowEditor (Bool_t show=kTRUE) override |
void | ShowMenuBar (Bool_t show=kTRUE) override |
void | ShowStatusBar (Bool_t show=kTRUE) override |
void | ShowToolBar (Bool_t show=kTRUE) override |
void | ShowToolTips (Bool_t show=kTRUE) override |
void | ShowWebWindow (const ROOT::RWebDisplayArgs &user_args="") |
Show canvas in specified place. | |
void | Streamer (TBuffer &) override |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Public Member Functions inherited from TCanvasImp | |
TCanvasImp (TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height) | |
TCanvasImp (TCanvas *c, const char *name, UInt_t width, UInt_t height) | |
TCanvasImp (TCanvas *c=nullptr) | |
virtual | ~TCanvasImp () |
TCanvas * | Canvas () const |
virtual void | ReallyDelete () |
virtual void | SetStatusText (const char *text=nullptr, Int_t partidx=0) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Static Public Member Functions | |
static void | AddCustomClass (const std::string &clname, bool with_derived=false) |
Assign custom class. | |
static Font_t | AddFont (const char *name, const char *ttffile, Int_t precision=2) |
Add font to static list of fonts supported by the canvas Name specifies name of the font, second is font file with .ttf or .woff2 extension Only True Type Fonts (ttf) are supported by PDF Returns font index which can be used in auto font_indx = TWebCanvas::AddFont("test", "test.ttf", 2); gStyle->SetStatFont(font_indx);. | |
static void | BatchImageMode (UInt_t n=100) |
Configure batch image mode for web graphics. | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static TString | CreateCanvasJSON (TCanvas *c, Int_t json_compression=0, Bool_t batchmode=kFALSE) |
Create JSON painting output for given canvas Produce JSON can be used for offline drawing with JSROOT. | |
static TString | CreatePadJSON (TPad *pad, Int_t json_compression=0, Bool_t batchmode=kFALSE) |
Create JSON painting output for given pad Produce JSON can be used for offline drawing with JSROOT. | |
static const char * | DeclFileName () |
static const std::string & | GetCustomScripts () |
Returns configured custom script. | |
static bool | IsCustomClass (const TClass *cl) |
Checks if class belongs to custom. | |
static TCanvasImp * | NewCanvas (TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height) |
Static method to create TWebCanvas instance Used by plugin manager. | |
static bool | ProduceImage (TPad *pad, const char *filename, Int_t width=0, Int_t height=0) |
Create image using batch (headless) capability of Chrome or Firefox browsers Supported png, jpeg, svg, pdf formats. | |
static bool | ProduceImages (std::vector< TPad * > pads, const char *filename, Int_t width=0, Int_t height=0) |
Create images for several pads using batch (headless) capability of Chrome or Firefox browsers Supported png, jpeg, svg, pdf, webp formats One can include d qualifier which will be replaced by image index using printf functionality. | |
static void | SetCustomScripts (const std::string &src) |
Configures custom script for canvas. | |
static Int_t | StoreCanvasJSON (TCanvas *c, const char *filename, const char *option="") |
Create JSON painting output for given canvas and store into the file See TBufferJSON::ExportToFile() method for more details about option If option string starts with symbol 'b', JSON for batch mode will be generated (default) If option string starts with symbol 'i', JSON for interactive mode will be generated. | |
Static Public Member Functions inherited from TCanvasImp | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Protected Types | |
using | PadPaintingReady_t = std::function< void(TPadWebSnapshot *)> |
Function called when pad painting produced. | |
Protected Member Functions | |
void | AddColorsPalette (TPadWebSnapshot &master) |
Add special canvas objects with list of colors and color palette. | |
void | AddCtrlMsg (unsigned connid, const std::string &key, const std::string &value) |
Add control message for specified connection Same control message can be overwritten many time before it really sends to the client If connid == 0, message will be add to all connections After ctrl message is add to the output, short timer is activated and message send afterwards. | |
void | AddCustomFonts (TPadWebSnapshot &master) |
Add special canvas objects with custom fonts. | |
void | AddSendQueue (unsigned connid, const std::string &msg) |
Add message to send queue for specified connection If connid == 0, message will be add to all connections. | |
void | AssignStatusBits (UInt_t bits) |
Assign clients bits. | |
UInt_t | CalculateColorsHash () |
Calculate hash function for all colors and palette. | |
virtual Bool_t | CanCreateObject (const std::string &) |
Bool_t | CheckCanvasModified (bool force_modified=false) |
Check if any pad on the canvas was modified If yes, increment version of correspondent pad Returns true when canvas really modified. | |
Bool_t | CheckDataToSend (unsigned connid=0) |
Check if any data should be send to client If connid != 0, only selected connection will be checked. | |
void | CheckPadModified (TPad *pad) |
Returns true if any pad in the canvas were modified Reset modified flags, increment canvas version (if inc_version is true) | |
void | CreateObjectSnapshot (TPadWebSnapshot &master, TPad *pad, TObject *obj, const char *opt, TWebPS *masterps=nullptr) |
Creates representation of the object for painting in web browser. | |
TVirtualPadPainter * | CreatePadPainter () override |
Creates web-based pad painter. | |
void | CreatePadSnapshot (TPadWebSnapshot &paddata, TPad *pad, Long64_t version, PadPaintingReady_t func) |
Create snapshot for pad and all primitives Callback function is used to create JSON in the middle of data processing - when all misc objects removed from canvas list of primitives or histogram list of functions After that objects are moved back to their places. | |
virtual Bool_t | DecodePadOptions (const std::string &, bool process_execs=false) |
Decode all pad options, which includes ranges plus objects options. | |
TObject * | FindPrimitive (const std::string &id, int idcnt=1, TPad *pad=nullptr, TObjLink **objlnk=nullptr, TPad **objpad=nullptr) |
Search of object with given id in list of primitives One could specify pad where search could be start Also if object is in list of primitives, one could ask for entry link for such object, This can allow to change draw option. | |
Bool_t | IsFirstConn (unsigned connid) const |
Bool_t | IsFirstDrawn () const |
virtual Bool_t | IsJSSupportedClass (TObject *obj, Bool_t many_primitives=kFALSE) |
Returns kTRUE when object is fully supported on JSROOT side In ROOT7 Paint function will just return appropriate flag that object can be displayed on JSROOT side. | |
Bool_t | IsLocked () override |
Bool_t | IsWeb () const override |
void | Lock () override |
Bool_t | PerformUpdate (Bool_t async) override |
if canvas or any subpad was modified, scan all primitives in the TCanvas and subpads and convert them into the structure which will be delivered to JSROOT client | |
virtual Bool_t | ProcessData (unsigned connid, const std::string &arg) |
Handle data from web browser Returns kFALSE if message was not processed. | |
void | ProcessExecs (TPad *pad, TExec *extra=nullptr) |
Process TExec objects in the pad. | |
void | ProcessLinesForObject (TObject *obj, const std::string &lines) |
Execute one or several methods for selected object String can be separated by ";;" to let execute several methods at once. | |
TPad * | ProcessObjectOptions (TWebObjectOptions &item, TPad *pad, int idcnt=1) |
Process data for single primitive Returns object pad if object was modified. | |
void | SetWindowGeometry (const std::vector< int > &arr) |
Set window geometry as array with coordinates and dimensions. | |
void | ShowCmd (const std::string &arg, Bool_t show) |
Function used to send command to browser to toggle menu, toolbar, editors, ... | |
void | Unlock () override |
Bool_t | WaitWhenCanvasPainted (Long64_t ver) |
Wait when specified version of canvas was painted and confirmed by browser. | |
Protected Member Functions inherited from TCanvasImp | |
TCanvasImp (const TCanvasImp &ci) | |
TCanvasImp & | operator= (const TCanvasImp &ci) |
Static Protected Member Functions | |
static bool | FlushBatchImages () |
Flush batch images. | |
static std::string | ProcessCustomScripts (bool batch) |
For batch mode special handling of scripts are required Headless browser not able to load modules from the file system Therefore custom web-canvas modules and scripts has to be loaded in advance and processed. | |
Protected Attributes | |
PadSignal_t | fActivePadChangedSignal |
! signal emitted when active pad changed in the canvas | |
std::vector< TPad * > | fAllPads |
! list of all pads recognized during streaming | |
Bool_t | fAsyncMode {kFALSE} |
! when true, methods like TCanvas::Update will never block | |
Bool_t | fCanCreateObjects {kTRUE} |
! indicates if canvas allowed to create extra objects for interactive painting | |
Long64_t | fCanvVersion {1} |
! actual canvas version, changed with every new Modified() call | |
UInt_t | fClientBits {0} |
! latest status bits from client like editor visible or not | |
UInt_t | fColorsHash {0} |
! last hash of colors/palette | |
Long64_t | fColorsVersion {0} |
! current colors/palette version, checked every time when new snapshot created | |
Bool_t | fFixedSize {kFALSE} |
! is canvas size fixed | |
std::vector< std::unique_ptr< ROOT::RWebDisplayHandle > > | fHelpHandles |
! array of handles for help widgets | |
Int_t | fJsonComp {0} |
! compression factor for messages send to the client | |
Bool_t | fLongerPolling {kFALSE} |
! when true, make longer polling in blocking operations | |
ObjectSelectSignal_t | fObjSelectSignal |
! signal emitted when new object selected in the pad | |
PadClickedSignal_t | fPadClickedSignal |
! signal emitted when simple mouse click performed on the pad | |
PadClickedSignal_t | fPadDblClickedSignal |
! signal emitted when simple mouse click performed on the pad | |
std::map< TPad *, PadStatus > | fPadsStatus |
! map of pads in canvas and their status flags | |
Int_t | fPaletteDelivery {1} |
! colors palette delivery 0:never, 1:once, 2:always, 3:per subpad | |
Int_t | fPrimitivesMerge {100} |
! number of PS primitives, which will be merged together | |
Bool_t | fProcessingData {kFALSE} |
! flag used to prevent blocking methods when process data is invoked | |
Bool_t | fReadOnly {kFALSE} |
!< configured display | |
Int_t | fStyleDelivery {0} |
! gStyle delivery to clients: 0:never, 1:once, 2:always | |
UInt_t | fStyleHash {0} |
! last hash of gStyle | |
Long64_t | fStyleVersion {0} |
! current gStyle object version, checked every time when new snapshot created | |
Int_t | fTF1UseSave {1} |
! use save buffer for TF1/TF2, 0:off, 1:prefer, 2:force | |
TWebCanvasTimer * | fTimer {nullptr} |
! timer to submit control messages | |
UpdatedSignal_t | fUpdatedSignal |
! signal emitted when canvas updated or state is changed | |
std::map< TObject *, bool > | fUsedObjs |
! map of used objects during streaming | |
std::vector< WebConn > | fWebConn |
! connections | |
std::shared_ptr< ROOT::RWebWindow > | fWindow |
std::vector< int > | fWindowGeometry |
! last received window geometry | |
Protected Attributes inherited from TCanvasImp | |
TCanvas * | fCanvas {nullptr} |
Static Protected Attributes | |
static std::vector< std::string > | gBatchFiles |
! file names for batch job | |
static std::vector< int > | gBatchHeights |
! batch job heights | |
static UInt_t | gBatchImageMode = 0 |
! configured batch size | |
static std::vector< std::string > | gBatchJsons |
! converted jsons batch job | |
static std::string | gBatchMultiPdf |
! name of current multi-page pdf file | |
static std::vector< int > | gBatchWidths |
! batch job widths | |
static std::vector< std::string > | gCustomClasses = {} |
! list of custom classes, which can be delivered as is to client | |
static std::string | gCustomScripts = {} |
! custom JavaScript code or URL on JavaScript files to load before start drawing | |
Friends | |
class | TWebCanvasTimer |
#include <TWebCanvas.h>
using TWebCanvas::ObjectSelectSignal_t = std::function<void(TPad *, TObject *)> |
Function type for signals, invoked when object is selected.
Definition at line 50 of file TWebCanvas.h.
using TWebCanvas::PadClickedSignal_t = std::function<void(TPad *, int, int)> |
Function type for pad-click signals.
Definition at line 47 of file TWebCanvas.h.
|
protected |
Function called when pad painting produced.
Definition at line 55 of file TWebCanvas.h.
using TWebCanvas::PadSignal_t = std::function<void(TPad *)> |
Function type for pad-related signals - like activate pad signal.
Definition at line 44 of file TWebCanvas.h.
using TWebCanvas::UpdatedSignal_t = std::function<void()> |
Function type for signals, invoked when canvas drawing or update is completed.
Definition at line 41 of file TWebCanvas.h.
TWebCanvas::TWebCanvas | ( | TCanvas * | c, |
const char * | name, | ||
Int_t | x, | ||
Int_t | y, | ||
UInt_t | width, | ||
UInt_t | height, | ||
Bool_t | readonly = kTRUE |
||
) |
Constructor.
Definition at line 184 of file TWebCanvas.cxx.
|
override |
Destructor.
Definition at line 214 of file TWebCanvas.cxx.
Activate object in editor in web browser.
Definition at line 1368 of file TWebCanvas.cxx.
|
protected |
Add special canvas objects with list of colors and color palette.
Definition at line 582 of file TWebCanvas.cxx.
|
protected |
Add control message for specified connection Same control message can be overwritten many time before it really sends to the client If connid == 0, message will be add to all connections After ctrl message is add to the output, short timer is activated and message send afterwards.
Definition at line 1167 of file TWebCanvas.cxx.
|
static |
Assign custom class.
Definition at line 475 of file TWebCanvas.cxx.
|
protected |
Add special canvas objects with custom fonts.
Definition at line 614 of file TWebCanvas.cxx.
Add font to static list of fonts supported by the canvas Name specifies name of the font, second is font file with .ttf or .woff2 extension Only True Type Fonts (ttf) are supported by PDF Returns font index which can be used in auto font_indx = TWebCanvas::AddFont("test", "test.ttf", 2); gStyle->SetStatFont(font_indx);.
Definition at line 228 of file TWebCanvas.cxx.
|
protected |
Add message to send queue for specified connection If connid == 0, message will be add to all connections.
Definition at line 1187 of file TWebCanvas.cxx.
|
protected |
Assign clients bits.
Definition at line 1472 of file TWebCanvas.cxx.
|
static |
Configure batch image mode for web graphics.
Allows to process many images with single headless browser invocation and increase performance of image production. When many canvases are stored as image in difference places, they first collected in batch and then processed when at least n
images are prepared. Only then headless browser invoked and create all these images at once. This allows to significantly increase performance of image production in web mode
Definition at line 156 of file TWebCanvas.cxx.
|
protected |
Calculate hash function for all colors and palette.
Definition at line 559 of file TWebCanvas.cxx.
|
inlineprotectedvirtual |
Definition at line 170 of file TWebCanvas.h.
Check if any pad on the canvas was modified If yes, increment version of correspondent pad Returns true when canvas really modified.
Definition at line 2244 of file TWebCanvas.cxx.
|
protected |
Check if any data should be send to client If connid != 0, only selected connection will be checked.
Definition at line 1200 of file TWebCanvas.cxx.
|
protected |
Returns true if any pad in the canvas were modified Reset modified flags, increment canvas version (if inc_version is true)
Definition at line 2220 of file TWebCanvas.cxx.
|
static |
|
inlinestaticconstexpr |
Definition at line 278 of file TWebCanvas.h.
|
overridevirtual |
Close web canvas - not implemented.
Reimplemented from TCanvasImp.
Definition at line 1285 of file TWebCanvas.cxx.
|
static |
Create JSON painting output for given canvas Produce JSON can be used for offline drawing with JSROOT.
Definition at line 2420 of file TWebCanvas.cxx.
|
protected |
Creates representation of the object for painting in web browser.
Definition at line 502 of file TWebCanvas.cxx.
|
static |
Create JSON painting output for given pad Produce JSON can be used for offline drawing with JSROOT.
Definition at line 2394 of file TWebCanvas.cxx.
|
overrideprotectedvirtual |
Creates web-based pad painter.
Reimplemented from TCanvasImp.
Definition at line 293 of file TWebCanvas.cxx.
|
protected |
Create snapshot for pad and all primitives Callback function is used to create JSON in the middle of data processing - when all misc objects removed from canvas list of primitives or histogram list of functions After that objects are moved back to their places.
Definition at line 630 of file TWebCanvas.cxx.
|
inlinestatic |
Definition at line 278 of file TWebCanvas.h.
|
protectedvirtual |
Decode all pad options, which includes ranges plus objects options.
Definition at line 1484 of file TWebCanvas.cxx.
|
protected |
Search of object with given id in list of primitives One could specify pad where search could be start Also if object is in list of primitives, one could ask for entry link for such object, This can allow to change draw option.
Definition at line 2718 of file TWebCanvas.cxx.
|
staticprotected |
Flush batch images.
Definition at line 166 of file TWebCanvas.cxx.
|
overridevirtual |
Increment canvas version and force sending data to client - do not wait for reply.
Reimplemented from TCanvasImp.
Definition at line 2334 of file TWebCanvas.cxx.
|
inline |
Definition at line 239 of file TWebCanvas.h.
|
static |
Returns configured custom script.
Definition at line 379 of file TWebCanvas.cxx.
|
inline |
Definition at line 251 of file TWebCanvas.h.
|
inline |
Definition at line 245 of file TWebCanvas.h.
|
inline |
Definition at line 248 of file TWebCanvas.h.
|
inline |
Definition at line 242 of file TWebCanvas.h.
|
inline |
Definition at line 192 of file TWebCanvas.h.
|
overridevirtual |
Returns window geometry including borders and menus.
Reimplemented from TCanvasImp.
Definition at line 2297 of file TWebCanvas.cxx.
|
overridevirtual |
Returns kTRUE if web canvas has graphical editor.
Reimplemented from TCanvasImp.
Definition at line 1380 of file TWebCanvas.cxx.
|
overridevirtual |
Returns kTRUE if web canvas has menu bar.
Reimplemented from TCanvasImp.
Definition at line 1388 of file TWebCanvas.cxx.
|
overridevirtual |
Returns kTRUE if web canvas has status bar.
Reimplemented from TCanvasImp.
Definition at line 1396 of file TWebCanvas.cxx.
|
inlineoverridevirtual |
Reimplemented from TCanvasImp.
Definition at line 229 of file TWebCanvas.h.
|
overridevirtual |
Returns kTRUE if tooltips are activated in web canvas.
Reimplemented from TCanvasImp.
Definition at line 1404 of file TWebCanvas.cxx.
|
overridevirtual |
Iconify browser window.
Reimplemented from TCanvasImp.
Definition at line 1456 of file TWebCanvas.cxx.
|
overridevirtual |
Initialize window for the web canvas At this place canvas is not yet register to the list of canvases - one cannot call RWebWindow::Show()
Reimplemented from TCanvasImp.
Definition at line 285 of file TWebCanvas.cxx.
|
inlineoverridevirtual |
Reimplemented from TCanvasImp.
Definition at line 278 of file TWebCanvas.h.
|
inline |
Definition at line 254 of file TWebCanvas.h.
Checks if class belongs to custom.
Definition at line 486 of file TWebCanvas.cxx.
|
inlineprotected |
Definition at line 158 of file TWebCanvas.h.
|
inlineprotected |
Definition at line 160 of file TWebCanvas.h.
|
inline |
Definition at line 256 of file TWebCanvas.h.
|
protectedvirtual |
Returns kTRUE when object is fully supported on JSROOT side In ROOT7 Paint function will just return appropriate flag that object can be displayed on JSROOT side.
Definition at line 302 of file TWebCanvas.cxx.
|
inlineoverrideprotectedvirtual |
Reimplemented from TCanvasImp.
Definition at line 131 of file TWebCanvas.h.
|
inlinevirtual |
Definition at line 194 of file TWebCanvas.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from TCanvasImp.
Definition at line 133 of file TWebCanvas.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from TCanvasImp.
Definition at line 129 of file TWebCanvas.h.
|
static |
Static method to create TWebCanvas instance Used by plugin manager.
Definition at line 2869 of file TWebCanvas.cxx.
if canvas or any subpad was modified, scan all primitives in the TCanvas and subpads and convert them into the structure which will be delivered to JSROOT client
Reimplemented from TCanvasImp.
Definition at line 2319 of file TWebCanvas.cxx.
|
staticprotected |
For batch mode special handling of scripts are required Headless browser not able to load modules from the file system Therefore custom web-canvas modules and scripts has to be loaded in advance and processed.
Definition at line 389 of file TWebCanvas.cxx.
|
protectedvirtual |
Handle data from web browser Returns kFALSE if message was not processed.
Definition at line 1790 of file TWebCanvas.cxx.
Process TExec objects in the pad.
Definition at line 1727 of file TWebCanvas.cxx.
|
protected |
Execute one or several methods for selected object String can be separated by ";;" to let execute several methods at once.
Definition at line 1759 of file TWebCanvas.cxx.
|
protected |
Process data for single primitive Returns object pad if object was modified.
Definition at line 2623 of file TWebCanvas.cxx.
|
static |
Create image using batch (headless) capability of Chrome or Firefox browsers Supported png, jpeg, svg, pdf formats.
Definition at line 2484 of file TWebCanvas.cxx.
|
static |
Create images for several pads using batch (headless) capability of Chrome or Firefox browsers Supported png, jpeg, svg, pdf, webp formats One can include d qualifier which will be replaced by image index using printf functionality.
If for pdf format d qualifier not specified, all images will be stored in single PDF file. For all other formats d qualifier will be add before extension automatically
Definition at line 2569 of file TWebCanvas.cxx.
|
overridevirtual |
Raise browser window.
Reimplemented from TCanvasImp.
Definition at line 1464 of file TWebCanvas.cxx.
|
inline |
Definition at line 233 of file TWebCanvas.h.
Definition at line 253 of file TWebCanvas.h.
Definition at line 238 of file TWebCanvas.h.
Set canvas size of web canvas.
Reimplemented from TCanvasImp.
Definition at line 1438 of file TWebCanvas.cxx.
|
static |
Configures custom script for canvas.
If started with "modules:" prefix, module(s) will be imported with loadModules
function of JSROOT. If custom path was configured in RWebWindowsManager::AddServerLocation, it can be used in module paths. If started with "load:" prefix, code will be loaded with loadScript
function of JSROOT (old, deprecated way) Script also can be a plain JavaScript code which imports JSROOT and provides draw function for custom classes See tutorials/webgui/custom/custom.mjs demonstrating such example
Definition at line 371 of file TWebCanvas.cxx.
|
inline |
Definition at line 250 of file TWebCanvas.h.
|
inline |
Definition at line 236 of file TWebCanvas.h.
|
inline |
Definition at line 234 of file TWebCanvas.h.
|
inline |
Definition at line 235 of file TWebCanvas.h.
|
inline |
Definition at line 244 of file TWebCanvas.h.
|
inline |
Definition at line 247 of file TWebCanvas.h.
|
inline |
Definition at line 241 of file TWebCanvas.h.
|
inline |
Definition at line 232 of file TWebCanvas.h.
|
protected |
Set window geometry as array with coordinates and dimensions.
Definition at line 2280 of file TWebCanvas.cxx.
Set window position of web canvas.
Reimplemented from TCanvasImp.
Definition at line 1412 of file TWebCanvas.cxx.
Set window size of web canvas.
Reimplemented from TCanvasImp.
Definition at line 1421 of file TWebCanvas.cxx.
|
overridevirtual |
Set window title of web canvas.
Reimplemented from TCanvasImp.
Definition at line 1430 of file TWebCanvas.cxx.
|
overridevirtual |
Show canvas in browser window.
Reimplemented from TCanvasImp.
Definition at line 1344 of file TWebCanvas.cxx.
|
protected |
Function used to send command to browser to toggle menu, toolbar, editors, ...
Definition at line 1360 of file TWebCanvas.cxx.
Reimplemented from TCanvasImp.
Definition at line 204 of file TWebCanvas.h.
Reimplemented from TCanvasImp.
Definition at line 202 of file TWebCanvas.h.
Reimplemented from TCanvasImp.
Definition at line 203 of file TWebCanvas.h.
Reimplemented from TCanvasImp.
Definition at line 205 of file TWebCanvas.h.
Reimplemented from TCanvasImp.
Definition at line 206 of file TWebCanvas.h.
void TWebCanvas::ShowWebWindow | ( | const ROOT::RWebDisplayArgs & | args = "" | ) |
Show canvas in specified place.
If parameter args not specified, default ROOT web display will be used
Definition at line 1293 of file TWebCanvas.cxx.
|
static |
Create JSON painting output for given canvas and store into the file See TBufferJSON::ExportToFile() method for more details about option If option string starts with symbol 'b', JSON for batch mode will be generated (default) If option string starts with symbol 'i', JSON for interactive mode will be generated.
Definition at line 2448 of file TWebCanvas.cxx.
|
overridevirtual |
Reimplemented from TCanvasImp.
|
inline |
Definition at line 278 of file TWebCanvas.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from TCanvasImp.
Definition at line 130 of file TWebCanvas.h.
Wait when specified version of canvas was painted and confirmed by browser.
Definition at line 2352 of file TWebCanvas.cxx.
|
friend |
Definition at line 37 of file TWebCanvas.h.
|
protected |
! signal emitted when active pad changed in the canvas
Definition at line 112 of file TWebCanvas.h.
|
protected |
! list of all pads recognized during streaming
Definition at line 93 of file TWebCanvas.h.
! when true, methods like TCanvas::Update will never block
Definition at line 102 of file TWebCanvas.h.
! indicates if canvas allowed to create extra objects for interactive painting
Definition at line 99 of file TWebCanvas.h.
|
protected |
! actual canvas version, changed with every new Modified() call
Definition at line 91 of file TWebCanvas.h.
|
protected |
! latest status bits from client like editor visible or not
Definition at line 92 of file TWebCanvas.h.
|
protected |
! last hash of colors/palette
Definition at line 106 of file TWebCanvas.h.
|
protected |
! current colors/palette version, checked every time when new snapshot created
Definition at line 105 of file TWebCanvas.h.
! is canvas size fixed
Definition at line 109 of file TWebCanvas.h.
|
protected |
! array of handles for help widgets
Definition at line 117 of file TWebCanvas.h.
|
protected |
! compression factor for messages send to the client
Definition at line 98 of file TWebCanvas.h.
! when true, make longer polling in blocking operations
Definition at line 100 of file TWebCanvas.h.
|
protected |
! signal emitted when new object selected in the pad
Definition at line 115 of file TWebCanvas.h.
|
protected |
! signal emitted when simple mouse click performed on the pad
Definition at line 113 of file TWebCanvas.h.
|
protected |
! signal emitted when simple mouse click performed on the pad
Definition at line 114 of file TWebCanvas.h.
! map of pads in canvas and their status flags
Definition at line 86 of file TWebCanvas.h.
|
protected |
! colors palette delivery 0:never, 1:once, 2:always, 3:per subpad
Definition at line 96 of file TWebCanvas.h.
|
protected |
! number of PS primitives, which will be merged together
Definition at line 97 of file TWebCanvas.h.
! flag used to prevent blocking methods when process data is invoked
Definition at line 101 of file TWebCanvas.h.
!< configured display
! in read-only mode canvas cannot be changed from client side
Definition at line 90 of file TWebCanvas.h.
|
protected |
! gStyle delivery to clients: 0:never, 1:once, 2:always
Definition at line 95 of file TWebCanvas.h.
|
protected |
! last hash of gStyle
Definition at line 104 of file TWebCanvas.h.
|
protected |
! current gStyle object version, checked every time when new snapshot created
Definition at line 103 of file TWebCanvas.h.
|
protected |
! use save buffer for TF1/TF2, 0:off, 1:prefer, 2:force
Definition at line 107 of file TWebCanvas.h.
|
protected |
! timer to submit control messages
Definition at line 84 of file TWebCanvas.h.
|
protected |
! signal emitted when canvas updated or state is changed
Definition at line 111 of file TWebCanvas.h.
! map of used objects during streaming
Definition at line 94 of file TWebCanvas.h.
|
protected |
! connections
Definition at line 83 of file TWebCanvas.h.
|
protected |
Definition at line 88 of file TWebCanvas.h.
|
protected |
! last received window geometry
Definition at line 108 of file TWebCanvas.h.
|
staticprotected |
! file names for batch job
Definition at line 124 of file TWebCanvas.h.
|
staticprotected |
! batch job heights
Definition at line 127 of file TWebCanvas.h.
|
staticprotected |
! configured batch size
Definition at line 122 of file TWebCanvas.h.
|
staticprotected |
! converted jsons batch job
Definition at line 125 of file TWebCanvas.h.
|
staticprotected |
! name of current multi-page pdf file
Definition at line 123 of file TWebCanvas.h.
|
staticprotected |
! batch job widths
Definition at line 126 of file TWebCanvas.h.
|
staticprotected |
! list of custom classes, which can be delivered as is to client
Definition at line 120 of file TWebCanvas.h.
|
staticprotected |
! custom JavaScript code or URL on JavaScript files to load before start drawing
Definition at line 119 of file TWebCanvas.h.