@record-evolution/widget-mapbox 1.4.19 → 1.4.20

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-mapbox",
4
4
  "license": "MIT",
5
5
  "author": "widget-mapbox",
6
- "version": "1.4.19",
6
+ "version": "1.4.20",
7
7
  "type": "module",
8
8
  "main": "dist/widget-mapbox.js",
9
9
  "types": "dist/src/widget-mapbox.d.ts",
@@ -112,7 +112,9 @@ export class WidgetMapbox extends LitElement {
112
112
 
113
113
  // Filter for latest Values
114
114
  this.dataSets.forEach((ds) => {
115
- if (ds?.latestValues && ds?.latestValues > 0) ds.data = ds.data?.splice(-ds.latestValues)
115
+ if (ds?.latestValues && ds?.latestValues > 0) {
116
+ ds.data = ds?.data?.slice(0, ds.latestValues ?? 1) ?? []
117
+ }
116
118
  })
117
119
 
118
120
  // console.log('mapbox datasets', this.dataSets)