MCPcopy Index your code
hub / github.com/bqplot/bqplot / updateNodeData

Method updateNodeData

js/src/GraphModel.ts:126–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124 }
125
126 private updateNodeData() {
127 const x = this.get('x') || [];
128 const y = this.get('y') || [];
129 const color = this.get('color') || [];
130
131 this.mark_data = this.nodeData.map((d, i) => {
132 const data: Partial<NodeData> = typeof d === 'string' ? { label: d } : d;
133
134 data.label = data.label || 'N' + i;
135 data.label_display = data.label_display || 'center';
136 data.shape = data.shape || 'circle';
137 data.shape_attrs = this.getShapeAttrs(data.shape, data.shape_attrs || {});
138 data.value = data.value || null;
139
140 if (x.length > i) {
141 data.xval = x[i];
142 }
143 if (y.length > i) {
144 data.yval = y[i];
145 }
146 if (color.length > i) {
147 data.color = color[i];
148 }
149
150 return data as NodeData;
151 });
152 }
153
154 private updateLinkData() {
155 const link_color_scale = this.getScales().link_color;

Callers 1

update_dataMethod · 0.95

Calls 1

getShapeAttrsMethod · 0.95

Tested by

no test coverage detected