Class: ObjectPainter

JSROOT. ObjectPainter

new JSROOT.ObjectPainter(dom, obj, opt)

Painter class for ROOT objects

Name Type Description
dom object | string

dom element or identifier

obj object

object to draw

opt string optional

object draw options

Extends

Methods

configureUserClickHandler(handler)

Configure user-defined click handler

Function will be called every time when frame click was perfromed As argument, tooltip object with selected bins will be provided If handler function returns true, default handling of click will be disabled

Name Type Description
handler function

function called when mouse click is done

configureUserContextMenu(fillmenu_func)

Configure user-defined context menu for the object

fillmenu_func will be called when context menu is actiavted Arguments fillmenu_func are (menu,kind) First is JSROOT menu object, second is object subelement like axis "x" or "y" Function should return promise with menu when items are filled

Name Type Description
fillmenu_func function

function to fill custom context menu for oabject

configureUserDblclickHandler(handler)

Configure user-defined dblclick handler

Function will be called every time when double click was called As argument, tooltip object with selected bins will be provided If handler function returns true, default handling of dblclick (unzoom) will be disabled

Name Type Description
handler function

function called when mouse double click is done

configureUserTooltipHandler(handler, tmout)

Configure user-defined tooltip handler

Hook for the users to get tooltip information when mouse cursor moves over frame area Hanlder function will be called every time when new data is selected when mouse leave frame area, handler(null) will be called

Name Type Default Description
handler function

function called when tooltip is produced

tmout number 100 optional

delay in ms before tooltip delivered

getClassName()

Returns drawn object class name

Returns assigned dom element

Return actual draw options as string

if options are not modified - returns original string which was specified for object draw

Returns assigned item draw option

Used with JSROOT.HierarchyPainter to identify drawn item option

Returns assigned item name

Used with JSROOT.HierarchyPainter to identify drawn item name

Returns drawn object

getObjectHint()

Returns string with object hint

It is either item name or object name or class name. Such string typically used as object tooltip. If result string larger than 20 symbols, it will be cutted.

Returns pad name where object is drawn

hasUserTooltip(){boolean}

Check if user-defined tooltip function was configured

Returns:
Type Description
boolean flag is user tooltip handler was configured

inherited selectDom(is_direct){object}

Selects main HTML element assigned for drawing

if main element was layouted, returns main element inside layout

Name Type Description
is_direct string optional

if 'origin' specified, returns original element even if actual drawing moved to some other place

Returns:
Type Description
object d3.select object for main element for drawing