MCPcopy Index your code
hub / github.com/plotly/plotly.js / emptySubplotLists

Function emptySubplotLists

src/plots/plots.js:604–636  ·  view source on GitHub ↗

* Make a container for collecting subplots we need to display. * * Finds all subplot types we need to enumerate once and caches it, * but makes a new output object each time. * Single-trace subplots (which have no `id`) such as pie, table, etc * do not need to be collected because we just draw

()

Source from the content-addressed store, hash-verified

602 * do not need to be collected because we just draw all visible traces.
603 */
604function emptySubplotLists() {
605 var collectableSubplotTypes = Registry.collectableSubplotTypes;
606 var out = {};
607 var i, j;
608
609 if(!collectableSubplotTypes) {
610 collectableSubplotTypes = [];
611
612 var subplotsRegistry = Registry.subplotsRegistry;
613
614 for(var subplotType in subplotsRegistry) {
615 var subplotModule = subplotsRegistry[subplotType];
616 var subplotAttr = subplotModule.attr;
617
618 if(subplotAttr) {
619 collectableSubplotTypes.push(subplotType);
620
621 // special case, currently just for cartesian:
622 // we need to enumerate axes, not just subplots
623 if(Array.isArray(subplotAttr)) {
624 for(j = 0; j < subplotAttr.length; j++) {
625 Lib.pushUnique(collectableSubplotTypes, subplotAttr[j]);
626 }
627 }
628 }
629 }
630 }
631
632 for(i = 0; i < collectableSubplotTypes.length; i++) {
633 out[collectableSubplotTypes[i]] = [];
634 }
635 return out;
636}
637
638/**
639 * getFormatObj: use _context to get the format object from locale.

Callers 1

plots.jsFile · 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…