cytoscape-dom-node
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "cytoscape-dom-node", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Cytoscape extension for making nodes into DOM elements", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -61,1 +61,11 @@ # cytoscape-dom-node | ||
example. | ||
## Options | ||
One option is supported, `dom_container` allows an container element to be specified which | ||
will be used for nodes instead of the element it would otherwise create and use. It is the | ||
callers responsibility to style the given element appropriately, for example: | ||
```js | ||
cy.domNode({'dom_container': some_element}); | ||
``` |
@@ -9,10 +9,14 @@ class CytoscapeDomNode { | ||
let nodes_dom_container = document.createElement("div"); | ||
nodes_dom_container.style.position = 'absolute'; | ||
nodes_dom_container.style.zIndex = 10; | ||
if (params.dom_container) { | ||
this._nodes_dom_container = params.dom_container; | ||
} else { | ||
let nodes_dom_container = document.createElement("div"); | ||
nodes_dom_container.style.position = 'absolute'; | ||
nodes_dom_container.style.zIndex = 10; | ||
let cy_canvas = cy_container.querySelector("canvas"); | ||
cy_canvas.parentNode.appendChild(nodes_dom_container); | ||
let cy_canvas = cy_container.querySelector("canvas"); | ||
cy_canvas.parentNode.appendChild(nodes_dom_container); | ||
this._nodes_dom_container = nodes_dom_container; | ||
this._nodes_dom_container = nodes_dom_container; | ||
} | ||
@@ -19,0 +23,0 @@ this._resize_observer = new ResizeObserver((entries) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7223
93
71