cytoscape-dom-node
Advanced tools
Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "cytoscape-dom-node", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Cytoscape extension for making nodes into DOM elements", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -62,2 +62,20 @@ # cytoscape-dom-node | ||
### Skip Node Append | ||
The `skip_node_append` option is a boolean flag (passed with node data) that controls whether the `cytoscape-dom-node` appends the provided node to the provided DOM container. | ||
By default, this option is set to false, meaning the `cytoscape-dom-node` will append the node to the container. | ||
However, in certain scenarios, such as when using EmberJS or another front-end framework, you might have already rendered the nodes to the DOM. | ||
In these cases, you can set `skip_node_append` to true to prevent the library from appending the node, allowing you to maintain control over the node's rendering process. | ||
```js | ||
let div = document.querySelector("#alreadyRenderedNodeId"); | ||
cy.add({ | ||
'data': { | ||
'id': id, | ||
'dom': div, | ||
'skip_node_append': true, | ||
} | ||
}) | ||
``` | ||
## Options | ||
@@ -64,0 +82,0 @@ |
@@ -73,3 +73,5 @@ class CytoscapeDomNode { | ||
this._nodes_dom_container.appendChild(data.dom); | ||
if (data.skip_node_append !== true) { | ||
this._nodes_dom_container.appendChild(data.dom); | ||
} | ||
data.dom.__cy_id = n.id(); | ||
@@ -76,0 +78,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
240692
6179
89
0