You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,18 +42,18 @@ let graph = new ElGrapho({
42
42
43
43
model: {
44
44
nodes: {
45
-
xs: new Float32Array([0, -0.4, 0.4, -0.6, -0.2, 0.2, 0.6]),
46
-
ys: new Float32Array([0.6, 0, 0, -0.6, -0.6, -0.6, -0.6]),
47
-
colors: new Float32Array([0, 1, 1, 2, 2, 2, 2])
45
+
xs: [0, -0.4, 0.4, -0.6, -0.2, 0.2, 0.6],
46
+
ys: [0.6, 0, 0, -0.6, -0.6, -0.6, -0.6],
47
+
colors: [0, 1, 1, 2, 2, 2, 2]
48
48
},
49
-
edges: new Float32Array([
49
+
edges: [
50
50
0, 1,
51
51
0, 2,
52
52
1, 3,
53
53
1, 4,
54
54
2, 5,
55
55
2, 6
56
-
])
56
+
]
57
57
},
58
58
59
59
width: 800,
@@ -63,9 +63,9 @@ let graph = new ElGrapho({
63
63
64
64
*```container``` - DOM element that will contain the El Grapho graph.
65
65
66
-
*```nodes``` - object that contains information about all of the nodes in the graph (graphs are made up of nodes and edges). Each node is defined by a position (x and y), and also a color. El Grapho x and y ranges are between -1 and 1. For example, if x is -1, then the node position is on the very left of the viewport. If x is 0 it is in the center. And if x is 1 it is on the very right of the viewport. Colors are integer values between 0 and 7. These integer values map to the El Grapho color palette.
66
+
*```model.nodes``` - object that contains information about all of the nodes in the graph (graphs are made up of nodes and edges). Each node is defined by a position (x and y), and also a color. El Grapho x and y ranges are between -1 and 1. For example, if x is -1, then the node position is on the very left of the viewport. If x is 0 it is in the center. And if x is 1 it is on the very right of the viewport. Colors are integer values between 0 and 7. These integer values map to the El Grapho color palette.
67
67
68
-
*```edges``` - array that defines the edges between nodes based on their indices. In the example above, the first edge begins at node ```0``` and ends at node ```1```. For non directed graphs, or bi-directional graphs, the order of the first node and second node do not matter. However, for directed graphs, the first index is the *from* node, and the second index is the *to* node.
68
+
*```model.edges``` - array that defines the edges between nodes based on their indices. In the example above, the first edge begins at node ```0``` and ends at node ```1```. For non directed graphs, or bi-directional graphs, the order of the first node and second node do not matter. However, for directed graphs, the first index is the *from* node, and the second index is the *to* node.
69
69
70
70
*```width``` - number that defines the width of the El Grapho viewport in pixels.
0 commit comments