MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / insertChildren

Function insertChildren

chapter24/docs/d3-graphviz.js:226–250  ·  view source on GitHub ↗
(element, index)

Source from the content-addressed store, hash-verified

224 });
225 }
226 function insertChildren(element, index) {
227 var children = element.selectAll(function () {
228 return element.node().childNodes;
229 });
230 children = children.data(function (d) {
231 return d.children;
232 }, function (d) {
233 return d.tag + '-' + index;
234 });
235 var childrenEnter = children.enter().append(function (d) {
236 return createElement(d);
237 });
238 var childrenExit = children.exit();
239 childrenExit = childrenExit.remove();
240 children = childrenEnter.merge(children);
241 var childTagIndexes = {};
242 children.each(function (childData) {
243 var childTag = childData.tag;
244 if (childTagIndexes[childTag] == null) {
245 childTagIndexes[childTag] = 0;
246 }
247 var childIndex = childTagIndexes[childTag]++;
248 attributeElement.call(this, childData, childIndex);
249 });
250 }
251 function attributeElement(data) {
252 var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
253 var element = d3__namespace.select(this);

Callers 1

attributeElementFunction · 0.70

Calls 7

createElementFunction · 0.70
isEdgeElementParentFunction · 0.70
nodeMethod · 0.45
exitMethod · 0.45
removeMethod · 0.45
mergeMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected