@record-evolution/widget-gauge 1.7.18 → 1.7.19

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.18",
6
+ "version": "1.7.19",
7
7
  "type": "module",
8
8
  "main": "dist/widget-gauge.js",
9
9
  "types": "dist/src/widget-gauge.d.ts",
@@ -23,7 +23,7 @@
23
23
  "release": "npm run build && npm run types && npm version patch --tag-version-prefix='' && git push && git push --tag && npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "echarts": "5.6.0",
26
+ "echarts": "6.0.0",
27
27
  "lit": "^3.3.1"
28
28
  },
29
29
  "devDependencies": {
@@ -40,8 +40,8 @@
40
40
  "eslint": "^9.29.0",
41
41
  "eslint-config-prettier": "^10.1.5",
42
42
  "json-schema-to-typescript": "^15.0.4",
43
- "prettier": "^3.5.3",
44
- "rollup": "^4.43.0",
43
+ "prettier": "^3.6.2",
44
+ "rollup": "^4.52.4",
45
45
  "typescript": "5.8.3"
46
46
  },
47
47
  "repository": {
@@ -234,7 +234,8 @@ export class WidgetGauge extends LitElement {
234
234
 
235
235
  const maxSize = fits.reduce((p, c) => (c.size < p ? p : c.size), 0)
236
236
  const fit = fits.find((f) => f.size === maxSize)
237
- const modifier = fit?.m ?? 0
237
+ if (!fit) return
238
+ const modifier = fit.m ?? 0
238
239
 
239
240
  // console.log(
240
241
  // 'FITS count',
@@ -250,6 +251,8 @@ export class WidgetGauge extends LitElement {
250
251
  // )
251
252
  this.boxes = Array.from(this.gaugeContainer?.querySelectorAll('.chart') as NodeListOf<HTMLDivElement>)
252
253
 
254
+ this.gaugeContainer.style.gridTemplateColumns = `repeat(${fit.c}, 1fr)`
255
+
253
256
  this.boxes?.forEach((box) =>
254
257
  box.setAttribute('style', `width:${modifier * chartW}px; height:${modifier * (chartH - 27)}px`)
255
258
  )
@@ -267,16 +270,18 @@ export class WidgetGauge extends LitElement {
267
270
  if (!this?.inputData) return
268
271
  this.inputData.dataseries
269
272
  ?.sort((a, b) => ((a.label ?? '') > (b.label ?? '') ? 1 : -1))
270
- .forEach((ds) => {
273
+ .forEach((ds, idx) => {
271
274
  // pivot data
272
275
  const distincts = ds.multiChart
273
276
  ? ([...new Set(ds.data?.map((d: Data) => d.pivot))].sort() as string[])
274
277
  : ['']
275
278
  distincts.forEach((piv) => {
276
279
  const prefix = piv ?? ''
277
- const label = ds.label ?? ''
280
+ let label = ds.label?.trim() ?? ''
281
+ label = prefix + (!!prefix && !!label ? ' - ' : '') + label
282
+ if (this.dataSets.some((ds) => ds.label === label)) label += ' ' + idx
278
283
  const pds: any = {
279
- label: prefix + (!!prefix && !!label ? ' - ' : '') + label,
284
+ label: label,
280
285
  unit: ds.unit,
281
286
  precision: ds.precision,
282
287
  advanced: ds.advanced,
@@ -484,7 +489,7 @@ export class WidgetGauge extends LitElement {
484
489
  align-items: center;
485
490
  }
486
491
  .gauge-container {
487
- display: flex;
492
+ display: grid;
488
493
  flex: 1;
489
494
  justify-content: center;
490
495
  align-items: center;