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

Function getIndices

src/transforms/sort.js:109–125  ·  view source on GitHub ↗
(opts, targetArray, d2c, len)

Source from the content-addressed store, hash-verified

107};
108
109function getIndices(opts, targetArray, d2c, len) {
110 var sortedArray = new Array(len);
111 var indices = new Array(len);
112 var i;
113
114 for(i = 0; i < len; i++) {
115 sortedArray[i] = {v: targetArray[i], i: i};
116 }
117
118 sortedArray.sort(getSortFunc(opts, d2c));
119
120 for(i = 0; i < len; i++) {
121 indices[i] = sortedArray[i].i;
122 }
123
124 return indices;
125}
126
127function getSortFunc(opts, d2c) {
128 switch(opts.order) {

Callers 1

sort.jsFile · 0.70

Calls 1

getSortFuncFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…