new BasePainter(domopt)
Base painter class
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dom |
object | string |
<optional> |
dom element or id of dom element |
Methods
(abstract, protected) checkResize() → {boolean}
Checks if draw elements were resized and drawing should be updated
- Source:
Returns:
true if resize was detected
- Type
- boolean
cleanup()
Generic method to cleanup painter
- Description:
Removes all visible elements and all internal data
- Source:
(protected) clearTopPainter()
Clear reference on top painter
- Source:
(protected) enlargeMain(action)
Try enlarge main drawing element to full HTML page.
- Description:
Possible values for action parameter:
- true - try to enlarge
- false - revert enlarge state
- 'toggle' - toggle enlarge state
- 'state' - only returns current enlarge state
- 'verify' - check if element can be enlarged if action not specified, just return possibility to enlarge main div
- Source:
Parameters:
Name | Type | Description |
---|---|---|
action |
string | boolean | defines that should be done |
getDom()
Returns assigned dom element
- Source:
getItemDrawOpt()
Returns assigned item draw option
- Description:
Used with
HierarchyPainter
to identify drawn item option
- Source:
getItemName()
Returns assigned item name
- Description:
Used with
HierarchyPainter
to identify drawn item name
- Source:
(protected) getTopPainter()
Return top painter set for the selected dom element
- Source:
selectDom(is_directopt) → {object}
Selects main HTML element assigned for drawing
- Description:
if main element was layouted, returns main element inside layout
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
is_direct |
string |
<optional> |
if 'origin' specified, returns original element even if actual drawing moved to some other place |
Returns:
d3.select object for main element for drawing
- Type
- object
(protected) setDom(elem)
Assign painter to specified DOM element
- Description:
Normally DOM element should be already assigned in constructor
- Source:
Parameters:
Name | Type | Description |
---|---|---|
elem |
string | object | element ID or DOM Element |
(protected) setTopPainter()
Set painter, stored in first child element
- Description:
Only make sense after first drawing is completed and any child element add to configured DOM
- Source: