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

Function orderFn2

src/components/legend/get_legend_data.js:121–128  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

119 };
120
121 var orderFn2 = function(a, b) {
122 var a_rank = isArrayOrTypedArray(a.trace.legendrank) ? a.trace.legendrank[a.i] : a.trace.legendrank;
123 var b_rank = isArrayOrTypedArray(b.trace.legendrank) ? b.trace.legendrank[b.i] : b.trace.legendrank;
124 return (
125 (a_rank - b_rank) ||
126 (a._preSort - b._preSort) // fallback for old Chrome < 70 https://bugs.chromium.org/p/v8/issues/detail?id=90
127 );
128 };
129
130 // sort considering minimum group legendrank
131 legendData.forEach(function(a, k) { a[0]._preGroupSort = k; });

Callers

nothing calls this directly

Calls 1

isArrayOrTypedArrayFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…