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

Function addGroup

src/components/modebar/manage.js:121–144  ·  view source on GitHub ↗
(newGroup)

Source from the content-addressed store, hash-verified

119 var groups = [];
120
121 function addGroup(newGroup) {
122 if(!newGroup.length) return;
123
124 var out = [];
125
126 for(var i = 0; i < newGroup.length; i++) {
127 var name = newGroup[i];
128 var B = modeBarButtons[name];
129 var v0 = B.name.toLowerCase();
130 var v1 = (B._cat || B.name).toLowerCase();
131 var found = false;
132 for(var q = 0; q < buttonsToRemove.length; q++) {
133 var t = buttonsToRemove[q].toLowerCase();
134 if(t === v0 || t === v1) {
135 found = true;
136 break;
137 }
138 }
139 if(found) continue;
140 out.push(modeBarButtons[name]);
141 }
142
143 groups.push(out);
144 }
145
146 // buttons common to all plot types
147 var commonGroup = ['toImage'];

Callers 1

getButtonGroupsFunction · 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…