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

Function attributeElement

chapter24/docs/d3-graphviz.js:251–279  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

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);
254 data.tag;
255 var attributes = data.attributes;
256 var currentAttributes = element.node().attributes;
257 if (currentAttributes) {
258 for (var i = 0; i < currentAttributes.length; i++) {
259 var currentAttribute = currentAttributes[i];
260 var name = currentAttribute.name;
261 if (name.split(':')[0] != 'xmlns' && currentAttribute.namespaceURI) {
262 var namespaceURIParts = currentAttribute.namespaceURI.split('/');
263 var namespace = namespaceURIParts[namespaceURIParts.length - 1];
264 name = namespace + ':' + name;
265 }
266 if (!(name in attributes)) {
267 attributes[name] = null;
268 }
269 }
270 }
271 for (var _i2 = 0, _Object$keys2 = Object.keys(attributes); _i2 < _Object$keys2.length; _i2++) {
272 var attributeName = _Object$keys2[_i2];
273 element.attr(attributeName, attributes[attributeName]);
274 }
275 if (data.text) {
276 element.text(data.text);
277 }
278 insertChildren(element, index);
279 }
280
281 function zoom (enable) {
282 this._options.zoom = enable;

Callers

nothing calls this directly

Calls 11

insertChildrenFunction · 0.70
extractElementDataFunction · 0.70
replaceElementFunction · 0.70
isEdgeElementFunction · 0.70
pathTweenFunction · 0.70
nodeMethod · 0.45
splitMethod · 0.45
replaceMethod · 0.45
onMethod · 0.45
toStringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected