MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / sortByWeight

Function sortByWeight

static/plugins/chart.js/Chart.bundle.js:7017–7025  ·  view source on GitHub ↗
(array, reverse)

Source from the content-addressed store, hash-verified

7015}
7016
7017function sortByWeight(array, reverse) {
7018 return array.sort(function(a, b) {
7019 var v0 = reverse ? b : a;
7020 var v1 = reverse ? a : b;
7021 return v0.weight === v1.weight ?
7022 v0.index - v1.index :
7023 v0.weight - v1.weight;
7024 });
7025}
7026
7027function wrapBoxes(boxes) {
7028 var layoutBoxes = [];

Callers 1

buildLayoutBoxesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected