@record-evolution/widget-gauge 1.7.3 → 1.7.5

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.3",
6
+ "version": "1.7.5",
7
7
  "type": "module",
8
8
  "main": "dist/widget-gauge.js",
9
9
  "types": "dist/src/widget-gauge.d.ts",
@@ -1,6 +1,4 @@
1
1
  {
2
- "title": "Demo Gauge",
3
- "subTitle": "A simple gauge demo",
4
2
  "dataseries": [
5
3
  {
6
4
  "label": "Demo Gauge Temperature",
@@ -181,6 +181,7 @@ export class WidgetGauge extends LitElement {
181
181
  protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
182
182
  this.resizeObserver.observe(this.shadowRoot?.querySelector('.wrapper') as HTMLDivElement)
183
183
  this.gaugeContainer = this.shadowRoot?.querySelector('.gauge-container')
184
+ this.registerTheme(this.theme)
184
185
  this.transformData()
185
186
  this.setupCharts()
186
187
  this.sizingSetup()
@@ -189,16 +190,16 @@ export class WidgetGauge extends LitElement {
189
190
  }
190
191
 
191
192
  registerTheme(theme?: Theme) {
192
- console.log('Registering theme', theme)
193
- if (!theme || !theme.theme_object || !theme.theme_name) return
194
-
195
- echarts.registerTheme(theme.theme_name, theme.theme_object)
196
193
  const cssTextColor = getComputedStyle(this).getPropertyValue('--re-text-color').trim()
197
194
  const cssBgColor = getComputedStyle(this).getPropertyValue('--re-background-color').trim()
198
195
  this.themeBgColor = cssBgColor || this.theme?.theme_object?.backgroundColor
199
196
  this.themeTitleColor = cssTextColor || this.theme?.theme_object?.title?.textStyle?.color
200
197
  this.themeSubtitleColor =
201
198
  cssTextColor || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor
199
+
200
+ if (!theme || !theme.theme_object || !theme.theme_name) return
201
+
202
+ echarts.registerTheme(theme.theme_name, theme.theme_object)
202
203
  }
203
204
 
204
205
  sizingSetup() {