MCPcopy Create free account
hub / github.com/plotly/plotly.js / formatArrayContainers

Function formatArrayContainers

src/plot_api/plot_schema.js:573–589  ·  view source on GitHub ↗
(attrs)

Source from the content-addressed store, hash-verified

571}
572
573function formatArrayContainers(attrs) {
574 function callback(attr, attrName, attrs) {
575 if(!attr) return;
576
577 var itemName = attr[IS_LINKED_TO_ARRAY];
578
579 if(!itemName) return;
580
581 delete attr[IS_LINKED_TO_ARRAY];
582
583 attrs[attrName] = { items: {} };
584 attrs[attrName].items[itemName] = attr;
585 attrs[attrName].role = 'object';
586 }
587
588 exports.crawl(attrs, callback);
589}
590
591// this can take around 10ms and should only be run from PlotSchema.get(),
592// to ensure JSON.stringify(PlotSchema.get()) gives the intended result.

Callers 1

formatAttributesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…