Skip to content

Commit 76526d5

Browse files
committed
Starting webgl.process optimization
1 parent acb97ad commit 76526d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/renderers/sigma.renderers.webgl.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@
136136
type,
137137
renderer,
138138
graph = this.graph,
139-
options = sigma.utils.extend(options, this.options);
139+
options = sigma.utils.extend(options, this.options),
140+
defaultEdgeType = this.settings(options, 'defaultEdgeType'),
141+
defaultNodeType = this.settings(options, 'defaultNodeType');
140142

141143
// Empty float arrays:
142144
for (k in this.nodeFloatArrays)
@@ -150,7 +152,7 @@
150152

151153
// Sort edges and nodes per types:
152154
for (a = graph.edges(), i = 0, l = a.length; i < l; i++) {
153-
type = a[i].type || this.settings(options, 'defaultEdgeType');
155+
type = a[i].type || defaultEdgeType;
154156
k = (type && sigma.webgl.edges[type]) ? type : 'def';
155157

156158
if (!this.edgeFloatArrays[k])
@@ -162,7 +164,7 @@
162164
}
163165

164166
for (a = graph.nodes(), i = 0, l = a.length; i < l; i++) {
165-
type = a[i].type || this.settings(options, 'defaultNodeType');
167+
type = a[i].type || defaultNodeType;
166168
k = (type && sigma.webgl.nodes[type]) ? type : 'def';
167169

168170
if (!this.nodeFloatArrays[k])

0 commit comments

Comments
 (0)