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

Function drawNode

chapter24/docs/d3-graphviz.js:1610–1634  ·  view source on GitHub ↗
(x, y, nodeId)

Source from the content-addressed store, hash-verified

1608 }
1609
1610 function drawNode(x, y, nodeId) {
1611 var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1612 var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
1613 attributes = Object.assign({}, attributes);
1614 if (attributes.style && attributes.style.includes('invis')) {
1615 var newNode = d3__namespace.select(null);
1616 } else {
1617 var root = this._selection;
1618 var svg = root.selectWithoutDataPropagation("svg");
1619 var graph0 = svg.selectWithoutDataPropagation("g");
1620 var newNode0 = createNode.call(this, nodeId, attributes);
1621 var nodeData = extractAllElementsData(newNode0);
1622 var newNode = graph0.append('g').data([nodeData]);
1623 attributeElement.call(newNode.node(), nodeData);
1624 _updateNode.call(this, newNode, x, y, nodeId, attributes, options);
1625 }
1626 this._drawnNode = {
1627 g: newNode,
1628 nodeId: nodeId,
1629 x: x,
1630 y: y,
1631 attributes: attributes
1632 };
1633 return this;
1634 }
1635 function updateDrawnNode(x, y, nodeId) {
1636 var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1637 var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};

Callers

nothing calls this directly

Calls 3

extractAllElementsDataFunction · 0.70
callMethod · 0.45
nodeMethod · 0.45

Tested by

no test coverage detected