bruce-models 7.1.95 → 7.1.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7973,8 +7973,9 @@
7973
7973
  return { result: null, attrPath: null, eValue: null };
7974
7974
  }
7975
7975
  function _getGradientTrace(value, entity, defaultToMin) {
7976
- const min = +value.points[0].position;
7977
- const max = +value.points[value.points.length - 1].position;
7976
+ const points = value.points.slice().sort((a, b) => +a.position - +b.position);
7977
+ const min = +points[0].position;
7978
+ const max = +points[points.length - 1].position;
7978
7979
  const attrPaths = parseLegacyPath(value.field);
7979
7980
  for (let i = 0; i < attrPaths.length; i++) {
7980
7981
  const attrPath = attrPaths[i];
@@ -7989,14 +7990,14 @@
7989
7990
  continue;
7990
7991
  }
7991
7992
  if (eValue >= max) {
7992
- return { result: exports.Color.ColorFromStr(value.points[value.points.length - 1].color), attrPath, eValue };
7993
+ return { result: exports.Color.ColorFromStr(points[points.length - 1].color), attrPath, eValue };
7993
7994
  }
7994
7995
  else if (eValue <= min) {
7995
- return { result: exports.Color.ColorFromStr(value.points[0].color), attrPath, eValue };
7996
+ return { result: exports.Color.ColorFromStr(points[0].color), attrPath, eValue };
7996
7997
  }
7997
- for (let j = 0; j < value.points.length - 1; j++) {
7998
- const pointA = value.points[j];
7999
- const pointB = value.points[j + 1];
7998
+ for (let j = 0; j < points.length - 1; j++) {
7999
+ const pointA = points[j];
8000
+ const pointB = points[j + 1];
8000
8001
  if (eValue >= pointA.position && eValue <= pointB.position) {
8001
8002
  if (pointA.position == pointB.position) {
8002
8003
  return { result: exports.Color.ColorFromStr(pointA.color), attrPath, eValue };
@@ -8018,7 +8019,7 @@
8018
8019
  }
8019
8020
  }
8020
8021
  // Fallback to min (static, no data path resolved).
8021
- return { result: exports.Color.ColorFromStr(value.points[0].color), attrPath: null, eValue: null };
8022
+ return { result: exports.Color.ColorFromStr(points[0].color), attrPath: null, eValue: null };
8022
8023
  }
8023
8024
  /**
8024
8025
  * Like Calculate, but also returns an 'effective' key describing how the value
@@ -23156,7 +23157,7 @@
23156
23157
  })(exports.UrlUtils || (exports.UrlUtils = {}));
23157
23158
 
23158
23159
  // This is updated with the package.json version on build.
23159
- const VERSION = "7.1.95";
23160
+ const VERSION = "7.1.96";
23160
23161
 
23161
23162
  exports.VERSION = VERSION;
23162
23163
  exports.AbstractApi = AbstractApi;