@record-evolution/widget-gauge 1.7.23 → 1.7.24

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.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "REWidget widget-gauge",
4
4
  "license": "MIT",
5
5
  "author": "widget-gauge",
6
- "version": "1.7.23",
6
+ "version": "1.7.24",
7
7
  "type": "module",
8
8
  "main": "dist/widget-gauge.js",
9
9
  "types": "dist/src/widget-gauge.d.ts",
@@ -329,7 +329,7 @@ export class WidgetGauge extends LitElement {
329
329
 
330
330
  // The full range of the gauge
331
331
  ds.range =
332
- (ds.sections?.sectionLimits?.[ds.sections?.sectionLimits?.length - 1].limit || 100) -
332
+ (ds.sections?.sectionLimits?.[ds.sections?.sectionLimits?.length - 1]?.limit || 100) -
333
333
  (ds.sections?.gaugeMinValue ?? 0)
334
334
  if (isNaN(ds.range as number)) ds.range = 100
335
335
  // ds.ranges = ds.sections?.sectionLimits?.map((v, i, a) => v - (a?.[i - 1] ?? 0)).slice(1) ?? []
@@ -368,7 +368,7 @@ export class WidgetGauge extends LitElement {
368
368
  // Axis
369
369
  const sectionLimits = !ds.sections?.sectionLimits?.length
370
370
  ? [40, 80, 100]
371
- : ds.sections?.sectionLimits.map((l) => l.limit).filter((l) => l !== undefined)
371
+ : ds.sections?.sectionLimits.map((l) => l?.limit).filter((l) => l !== undefined)
372
372
  ga2.max = sectionLimits?.length ? Math.max(...sectionLimits) : 100
373
373
  ga.min = ga2.min = ds.sections?.gaugeMinValue ?? 0
374
374
  ga.max = ga2.max