cytoscape-dom-node 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,24 @@ The `div` you created will be shown as the node now.
59
59
  See [codepen abWdVOG](https://codepen.io/mwri/pen/abWdVOG) for a working
60
60
  example.
61
61
 
62
+ ### Skip Node Append
63
+ 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.
64
+ By default, this option is set to false, meaning the `cytoscape-dom-node` will append the node to the container.
65
+
66
+ However, in certain scenarios, such as when using EmberJS or another front-end framework, you might have already rendered the nodes to the DOM.
67
+ 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.
68
+
69
+ ```js
70
+ let div = document.querySelector("#alreadyRenderedNodeId");
71
+ cy.add({
72
+ 'data': {
73
+ 'id': id,
74
+ 'dom': div,
75
+ 'skip_node_append': true,
76
+ }
77
+ })
78
+ ```
79
+
62
80
  ## Options
63
81
 
64
82
  One option is supported, `dom_container` allows an container element to be specified which
package/demo/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (C) 2021 Michael Wright <mjw@methodanalysis.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/demo/Makefile ADDED
@@ -0,0 +1,18 @@
1
+ all: bundle
2
+
3
+ .PHONY: bundle
4
+ bundle: node_modules/.bin/webpack-dev-server
5
+ nodejs ./node_modules/.bin/webpack
6
+
7
+ .PHONY: webpack-dev-server
8
+ webpack-dev-server: node_modules/.bin/webpack-dev-server
9
+ NODE_ENV=development nodejs ./node_modules/.bin/webpack-dev-server --debug
10
+
11
+ node_modules/.bin/webpack-dev-server: node_modules
12
+
13
+ package-lock.json: package.json
14
+ npm install
15
+
16
+ .PHONY: node_modules
17
+ node_modules: package.json package-lock.json
18
+ npm install