Skip to content

Commit af08035

Browse files
author
Dmitry Marov
committed
wip
1 parent a300809 commit af08035

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

content/canvas.md

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,6 @@ Below is a list of all available methods
2727

2828
Adds a node to the canvas.
2929

30-
{{< code lang="javascript">}}
31-
canvas.addNode({
32-
id: "node-1",
33-
x: 100,
34-
y: 100,
35-
element: document.createElement('div'),
36-
});
37-
{{< /code >}}
38-
39-
For convenience, ports can be specified directly during the node creation.
40-
41-
{{< code lang="javascript">}}
42-
const node = document.createElement('div');
43-
const port = document.createElement('div');
44-
node.appendChild(port);
45-
46-
canvas.addNode({
47-
id: "node-1",
48-
element: node,
49-
ports: [
50-
{
51-
id: "port-1",
52-
element: port,
53-
},
54-
],
55-
});
56-
{{< /code >}}
57-
58-
All available parameters are demonstrated in the following example:
59-
6030
{{< code lang="javascript">}}
6131
const node = document.createElement('div');
6232
const port = document.createElement('div');
@@ -93,7 +63,7 @@ canvas.addNode({
9363

9464
<b>\* Only nodes with defined coordinates are actually displayed on the canvas.
9565
When using `null` coordinates, make sure to update them later using a <a href="/layouts/">layout algorithm</a>,
96-
or an <a href="/animated-layouts/">animated layout algorithm</a>, or <a href="#update-node">updateNode</a> method.</b>
66+
or an <a href="/animated-layouts/">animated layout algorithm</a>.</b>
9767

9868
{{< ref-target ref="add-node-port-params">}}
9969

0 commit comments

Comments
 (0)