From 372dfa2632585851131ed7173dbebc81ab598ecd Mon Sep 17 00:00:00 2001 From: jul-lam Date: Thu, 19 Dec 2024 09:22:35 +0100 Subject: [PATCH 1/4] feat(echarts): change theme names --- packages/echarts/src/index.ts | 4 ---- packages/echarts/src/register.ts | 17 ++++++----------- packages/echarts/src/themes/brand-dark.ts | 2 +- packages/echarts/src/themes/brand-light.ts | 2 +- .../src/themes/builder/brand-dark-tb.json | 2 +- .../src/themes/builder/brand-light-tb.json | 2 +- .../src/themes/builder/classic-dark-tb.json | 2 +- .../src/themes/builder/classic-light-tb.json | 2 +- packages/echarts/src/themes/classic-dark.ts | 2 +- packages/echarts/src/themes/classic-light.ts | 2 +- 10 files changed, 14 insertions(+), 23 deletions(-) diff --git a/packages/echarts/src/index.ts b/packages/echarts/src/index.ts index c04f9c4577..6783adc0ea 100644 --- a/packages/echarts/src/index.ts +++ b/packages/echarts/src/index.ts @@ -13,7 +13,3 @@ export { default as brandDark } from './themes/brand-dark'; export { default as brandLight } from './themes/brand-light'; export { default as classicDark } from './themes/classic-dark'; export { default as classicLight } from './themes/classic-light'; - -export function convertThemeName(conventionalName: string) { - return conventionalName.replace('theme-', ''); -} diff --git a/packages/echarts/src/register.ts b/packages/echarts/src/register.ts index fbcbdfded4..74a14dc37f 100644 --- a/packages/echarts/src/register.ts +++ b/packages/echarts/src/register.ts @@ -8,10 +8,10 @@ */ import type { ECharts } from 'echarts'; -import brandDarkProject from './themes/brand-dark'; -import brandLightProject from './themes/brand-light'; -import classicDarkProject from './themes/classic-dark'; -import classicLightProject from './themes/classic-light'; +import brandDark from './themes/brand-dark'; +import brandLight from './themes/brand-light'; +import classicDark from './themes/classic-dark'; +import classicLight from './themes/classic-light'; declare global { interface Window { @@ -19,19 +19,14 @@ declare global { } } -export default function registerEChartsThemes(echartsInstance?: any) { +export default function registerTheme(echartsInstance?: any) { const echarts = echartsInstance ?? window.echarts; if (!echarts) { throw Error('echarts not found'); } - [ - classicDarkProject, - classicLightProject, - brandDarkProject, - brandLightProject, - ].forEach((themeBundle) => { + [classicDark, classicLight, brandDark, brandLight].forEach((themeBundle) => { echarts.registerTheme(themeBundle.themeName, themeBundle.theme); }); } diff --git a/packages/echarts/src/themes/brand-dark.ts b/packages/echarts/src/themes/brand-dark.ts index 9996e21b8e..03ba4a2611 100644 --- a/packages/echarts/src/themes/brand-dark.ts +++ b/packages/echarts/src/themes/brand-dark.ts @@ -28,7 +28,7 @@ const colors = [ ]; export default { - themeName: 'brand-dark', + themeName: 'theme-brand-dark', theme: { color: colors, backgroundColor: 'rgba(0,0,0,0)', diff --git a/packages/echarts/src/themes/brand-light.ts b/packages/echarts/src/themes/brand-light.ts index 9abd468a3b..337dda726d 100644 --- a/packages/echarts/src/themes/brand-light.ts +++ b/packages/echarts/src/themes/brand-light.ts @@ -28,7 +28,7 @@ const colors = [ ]; export default { - themeName: 'brand-light', + themeName: 'theme-brand-light', theme: { color: colors, backgroundColor: 'rgba(0,0,0,0)', diff --git a/packages/echarts/src/themes/builder/brand-dark-tb.json b/packages/echarts/src/themes/builder/brand-dark-tb.json index e53923778d..26d5b9ddab 100644 --- a/packages/echarts/src/themes/builder/brand-dark-tb.json +++ b/packages/echarts/src/themes/builder/brand-dark-tb.json @@ -1,6 +1,6 @@ { "version": 1, - "themeName": "brand-dark", + "themeName": "theme-brand-dark", "theme": { "seriesCnt": 3, "backgroundColor": "transparent", diff --git a/packages/echarts/src/themes/builder/brand-light-tb.json b/packages/echarts/src/themes/builder/brand-light-tb.json index 5cf3d2f35f..16bb7c6c5a 100644 --- a/packages/echarts/src/themes/builder/brand-light-tb.json +++ b/packages/echarts/src/themes/builder/brand-light-tb.json @@ -1,6 +1,6 @@ { "version": 1, - "themeName": "brand-light", + "themeName": "theme-brand-light", "theme": { "seriesCnt": 3, "backgroundColor": "rgba(0,0,0,0)", diff --git a/packages/echarts/src/themes/builder/classic-dark-tb.json b/packages/echarts/src/themes/builder/classic-dark-tb.json index 02c9859801..ed221e6052 100644 --- a/packages/echarts/src/themes/builder/classic-dark-tb.json +++ b/packages/echarts/src/themes/builder/classic-dark-tb.json @@ -1,6 +1,6 @@ { "version": 1, - "themeName": "classic-dark", + "themeName": "theme-classic-dark", "theme": { "seriesCnt": 3, "backgroundColor": "rgba(0,0,0,0)", diff --git a/packages/echarts/src/themes/builder/classic-light-tb.json b/packages/echarts/src/themes/builder/classic-light-tb.json index 53dd6c3958..83a8e558ee 100644 --- a/packages/echarts/src/themes/builder/classic-light-tb.json +++ b/packages/echarts/src/themes/builder/classic-light-tb.json @@ -1,6 +1,6 @@ { "version": 1, - "themeName": "classic-light", + "themeName": "theme-classic-light", "theme": { "seriesCnt": 3, "backgroundColor": "rgba(0,0,0,0)", diff --git a/packages/echarts/src/themes/classic-dark.ts b/packages/echarts/src/themes/classic-dark.ts index 266f23c037..7946abf5f8 100644 --- a/packages/echarts/src/themes/classic-dark.ts +++ b/packages/echarts/src/themes/classic-dark.ts @@ -28,7 +28,7 @@ const colors = [ ]; export default { - themeName: 'classic-dark', + themeName: 'theme-classic-dark', theme: { color: colors, backgroundColor: 'rgba(0,0,0,0)', diff --git a/packages/echarts/src/themes/classic-light.ts b/packages/echarts/src/themes/classic-light.ts index 38a2b882f1..9d76aa14b7 100644 --- a/packages/echarts/src/themes/classic-light.ts +++ b/packages/echarts/src/themes/classic-light.ts @@ -28,7 +28,7 @@ const colors = [ ]; export default { - themeName: 'classic-light', + themeName: 'theme-classic-light', theme: { color: colors, backgroundColor: 'rgba(0,0,0,0)', From ac16bc8b9e09866f1c30db221f2bf5255757707a Mon Sep 17 00:00:00 2001 From: jul-lam Date: Thu, 19 Dec 2024 09:23:37 +0100 Subject: [PATCH 2/4] test(echarts): adapt theme logic --- packages/echarts/tests/basic.html | 6 ++---- packages/echarts/tests/more-colors.html | 14 ++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/echarts/tests/basic.html b/packages/echarts/tests/basic.html index ab030c6861..da4677b62b 100644 --- a/packages/echarts/tests/basic.html +++ b/packages/echarts/tests/basic.html @@ -37,12 +37,10 @@ const searchParams = new URLSearchParams(location.search); if (!searchParams.has('theme')) { - return 'brand-dark'; + return 'theme-brand-dark'; } - const theme = searchParams.get('theme'); - - return theme.substring('theme-'.length, theme.length); + return searchParams.get('theme'); } registerTheme(echarts); diff --git a/packages/echarts/tests/more-colors.html b/packages/echarts/tests/more-colors.html index 997aa0037b..66550a9b21 100644 --- a/packages/echarts/tests/more-colors.html +++ b/packages/echarts/tests/more-colors.html @@ -39,12 +39,10 @@ const searchParams = new URLSearchParams(location.search); if (!searchParams.has('theme')) { - return 'brand-dark'; + return 'theme-brand-dark'; } - const theme = searchParams.get('theme'); - - return theme.substring('theme-'.length, theme.length); + return searchParams.get('theme'); } registerTheme(echarts); @@ -185,7 +183,7 @@ }; switch (theme) { - case 'classic-dark': + case 'theme-classic-dark': options.color = [ '#EF9A9A' /* theme-chart-14 */, '#F38FC2' /* theme-chart-13 */, @@ -198,7 +196,7 @@ ]; break; - case 'classic-light': + case 'theme-classic-light': options.color = [ '#9E5833' /* theme-chart-14 */, '#6F2542' /* theme-chart-13 */, @@ -211,7 +209,7 @@ ]; break; - case 'brand-dark': + case 'theme-brand-dark': options.color = [ '#BE5925' /* theme-chart-14 */, '#FF98C4' /* theme-chart-13 */, @@ -224,7 +222,7 @@ ]; break; - case 'brand-light': + case 'theme-brand-light': options.color = [ '#BE5925' /* theme-chart-14 */, '#4F153D' /* theme-chart-13 */, From 6d47f23b10e2da5582922ee1ccee16702b933abc Mon Sep 17 00:00:00 2001 From: jul-lam Date: Thu, 19 Dec 2024 09:24:16 +0100 Subject: [PATCH 3/4] docs(echarts): adapt theme logic in examples --- .../echarts-bar-horizontal-stacked.ts | 6 ++--- .../preview-examples/echarts-bar-simple.ts | 17 ++++++++---- .../src/preview-examples/echarts-circle.ts | 12 +++------ .../preview-examples/echarts-empty-state.ts | 6 ++--- .../src/preview-examples/echarts-gauge.ts | 12 +++------ .../preview-examples/echarts-line-advanced.ts | 12 +++------ .../echarts-line-multiple-y-axis.ts | 12 +++------ .../preview-examples/echarts-line-simple.ts | 8 +++--- .../src/preview-examples/echarts-pie.ts | 8 +++--- .../preview-examples/echarts-progress-arc.ts | 16 ++++------- .../echarts-progress-circle.ts | 16 ++++------- .../preview-examples/echarts-special-3d.ts | 6 ++--- .../echarts-special-toolbox.ts | 8 +++--- .../preview-examples/echarts-special-zoom.ts | 10 +++---- .../src/preview-examples/echarts.ts | 6 ++--- .../echarts-bar-horizontal-stacked.html | 9 +++---- .../preview-examples/echarts-bar-simple.html | 9 +++---- .../src/preview-examples/echarts-circle.html | 8 ++---- .../preview-examples/echarts-empty-state.html | 9 +++---- .../src/preview-examples/echarts-gauge.html | 11 +++----- .../echarts-line-advanced.html | 8 ++---- .../echarts-line-multiple-y-axis.html | 8 ++---- .../preview-examples/echarts-line-simple.html | 9 +++---- .../src/preview-examples/echarts-pie.html | 8 ++---- .../echarts-progress-arc.html | 8 ++---- .../echarts-progress-circle.html | 8 ++---- .../preview-examples/echarts-special-3d.html | 8 ++---- .../echarts-special-toolbox.html | 9 +++---- .../echarts-special-zoom.html | 8 ++---- .../src/preview-examples/echarts.html | 9 +++---- .../echarts-bar-horizontal-stacked.tsx | 8 +++--- .../preview-examples/echarts-bar-simple.tsx | 17 +++++++----- .../src/preview-examples/echarts-circle.tsx | 8 +++--- .../preview-examples/echarts-empty-state.tsx | 8 +++--- .../src/preview-examples/echarts-gauge.tsx | 12 +++------ .../echarts-line-advanced.tsx | 12 ++++----- .../echarts-line-multiple-y-axis.tsx | 12 +++------ .../preview-examples/echarts-line-simple.tsx | 8 +++--- .../src/preview-examples/echarts-pie.tsx | 8 +++--- .../preview-examples/echarts-progress-arc.tsx | 12 +++------ .../echarts-progress-circle.tsx | 12 +++------ .../preview-examples/echarts-special-3d.tsx | 12 +++------ .../echarts-special-toolbox.tsx | 10 +++---- .../preview-examples/echarts-special-zoom.tsx | 12 +++------ .../src/preview-examples/echarts.tsx | 8 +++--- .../echarts-bar-horizontal-stacked.vue | 27 ++++++++++--------- .../preview-examples/echarts-bar-simple.vue | 6 ++--- .../src/preview-examples/echarts-circle.vue | 10 +++---- .../preview-examples/echarts-empty-state.vue | 6 ++--- .../src/preview-examples/echarts-gauge.vue | 10 +++---- .../echarts-line-advanced.vue | 10 +++---- .../echarts-line-multiple-y-axis.vue | 8 ++---- .../preview-examples/echarts-line-simple.vue | 8 +++--- .../src/preview-examples/echarts-pie.vue | 10 +++---- .../preview-examples/echarts-progress-arc.vue | 17 ++++++------ .../echarts-progress-circle.vue | 17 +++++++----- .../preview-examples/echarts-special-3d.vue | 13 +++------ .../echarts-special-toolbox.vue | 9 +++---- .../preview-examples/echarts-special-zoom.vue | 10 +++---- .../src/preview-examples/echarts.vue | 6 ++--- 60 files changed, 233 insertions(+), 377 deletions(-) diff --git a/packages/angular-test-app/src/preview-examples/echarts-bar-horizontal-stacked.ts b/packages/angular-test-app/src/preview-examples/echarts-bar-horizontal-stacked.ts index a0cf01339c..a893433682 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-bar-horizontal-stacked.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-bar-horizontal-stacked.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, registerTheme } from '@siemens/ix-echarts'; +import { registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { BarSeriesOption, EChartsOption } from 'echarts'; @@ -19,7 +19,7 @@ import { BarSeriesOption, EChartsOption } from 'echarts'; styleUrls: ['./echarts-bar-horizontal-stacked.css'], }) export default class EchartsBarHorizontalStacked implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); data = { years: ['2023', '2022', '2021', '2020', '2019'], @@ -66,7 +66,7 @@ export default class EchartsBarHorizontalStacked implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-bar-simple.ts b/packages/angular-test-app/src/preview-examples/echarts-bar-simple.ts index a98ac0f89c..7bac240bd8 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-bar-simple.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-bar-simple.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, registerTheme } from '@siemens/ix-echarts'; +import { registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -16,12 +16,19 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-bar-simple.html', - styleUrls: ["./echarts-bar-simple.css"], + styleUrls: ['./echarts-bar-simple.css'], }) export default class EchartsBarSimple implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); data = { - products: ['Product A', 'Product B', 'Product C', 'Product D', 'Product E', 'Product F'], + products: [ + 'Product A', + 'Product B', + 'Product C', + 'Product D', + 'Product E', + 'Product F', + ], sales: [10.3, 9.2, 7.3, 6.4, 6.2, 4.4], }; @@ -50,7 +57,7 @@ export default class EchartsBarSimple implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-circle.ts b/packages/angular-test-app/src/preview-examples/echarts-circle.ts index 23277599f9..a00ab76a12 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-circle.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-circle.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - getComputedCSSProperty, - registerTheme, -} from '@siemens/ix-echarts'; +import { getComputedCSSProperty, registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -20,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-circle.html', - styleUrls: ["./echarts-circle.css"], + styleUrls: ['./echarts-circle.css'], }) export default class EchartsCircle implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); data = [ { value: 72.17, name: 'Windows' }, @@ -70,7 +66,7 @@ export default class EchartsCircle implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-empty-state.ts b/packages/angular-test-app/src/preview-examples/echarts-empty-state.ts index f63450d51f..46c5bff7c3 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-empty-state.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-empty-state.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, registerTheme } from '@siemens/ix-echarts'; +import { registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -19,7 +19,7 @@ import { EChartsOption } from 'echarts'; styleUrls: ['./echarts-empty-state.css'], }) export default class EchartsLineSimple implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); data = { weekdays: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], value: [], @@ -45,7 +45,7 @@ export default class EchartsLineSimple implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-gauge.ts b/packages/angular-test-app/src/preview-examples/echarts-gauge.ts index 64e18a0b98..2ccecc4f38 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-gauge.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-gauge.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - getComputedCSSProperty, - registerTheme, -} from '@siemens/ix-echarts'; +import { getComputedCSSProperty, registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -20,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-gauge.html', - styleUrls: ["./echarts-gauge.css"], + styleUrls: ['./echarts-gauge.css'], }) export default class EchartsGauge implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); value = 45.3; @@ -132,7 +128,7 @@ export default class EchartsGauge implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-line-advanced.ts b/packages/angular-test-app/src/preview-examples/echarts-line-advanced.ts index 3921aceeb2..b64bd72531 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-line-advanced.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-line-advanced.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - registerTheme, - getComputedCSSProperty, -} from '@siemens/ix-echarts'; +import { registerTheme, getComputedCSSProperty } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -20,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-line-advanced.html', - styleUrls: ["./echarts-line-advanced.css"], + styleUrls: ['./echarts-line-advanced.css'], }) export default class EchartsLineAdvanced implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); dates = Array.from({ length: 2025 - 2013 }, (_, i) => (2013 + i).toString()); @@ -76,7 +72,7 @@ export default class EchartsLineAdvanced implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-line-multiple-y-axis.ts b/packages/angular-test-app/src/preview-examples/echarts-line-multiple-y-axis.ts index 89f9405a25..92046c89cd 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-line-multiple-y-axis.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-line-multiple-y-axis.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - getComputedCSSProperty, - registerTheme, -} from '@siemens/ix-echarts'; +import { getComputedCSSProperty, registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption, SeriesOption } from 'echarts'; @@ -21,10 +17,10 @@ import { YAXisOption } from 'echarts/types/dist/shared'; @Component({ selector: 'app-example', templateUrl: './echarts-line-multiple-y-axis.html', - styleUrls: ["./echarts-line-multiple-y-axis.css"], + styleUrls: ['./echarts-line-multiple-y-axis.css'], }) export default class EchartsLineMultipleYAxis implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); dates = Array.from({ length: 2025 - 2013 }, (_, i) => (2013 + i).toString()); @@ -169,7 +165,7 @@ export default class EchartsLineMultipleYAxis implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-line-simple.ts b/packages/angular-test-app/src/preview-examples/echarts-line-simple.ts index 6d1365d285..0c87806859 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-line-simple.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-line-simple.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, registerTheme } from '@siemens/ix-echarts'; +import { registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -16,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-line-simple.html', - styleUrls: ["./echarts-line-simple.css"], + styleUrls: ['./echarts-line-simple.css'], }) export default class EchartsLineSimple implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); data = { weekdays: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], @@ -48,7 +48,7 @@ export default class EchartsLineSimple implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-pie.ts b/packages/angular-test-app/src/preview-examples/echarts-pie.ts index e3073392c5..0c5c1ad1f6 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-pie.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-pie.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import {convertThemeName, getComputedCSSProperty, registerTheme} from '@siemens/ix-echarts'; +import { getComputedCSSProperty, registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -16,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-pie.html', - styleUrls: ["./echarts-pie.css"], + styleUrls: ['./echarts-pie.css'], }) export default class EchartsPie implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); data = [ { value: 29.4, name: 'China' }, @@ -65,7 +65,7 @@ export default class EchartsPie implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-progress-arc.ts b/packages/angular-test-app/src/preview-examples/echarts-progress-arc.ts index c717037f05..bf1cfb5af4 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-progress-arc.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-progress-arc.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - getComputedCSSProperty, - registerTheme, -} from '@siemens/ix-echarts'; +import { getComputedCSSProperty, registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -20,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-progress-arc.html', - styleUrls: ["./echarts-progress-arc.css"], + styleUrls: ['./echarts-progress-arc.css'], }) export default class EchartsProgressArc implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); value = 60; @@ -36,9 +32,7 @@ export default class EchartsProgressArc implements OnInit { show: true, lineStyle: { width: 15, - color: [ - [1, getComputedCSSProperty('color-neutral-40')], - ], + color: [[1, getComputedCSSProperty('color-neutral-40')]], }, }, axisTick: { @@ -91,7 +85,7 @@ export default class EchartsProgressArc implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-progress-circle.ts b/packages/angular-test-app/src/preview-examples/echarts-progress-circle.ts index f634dd31b6..1ef2f6609e 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-progress-circle.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-progress-circle.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - getComputedCSSProperty, - registerTheme, -} from '@siemens/ix-echarts'; +import { getComputedCSSProperty, registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -20,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-progress-circle.html', - styleUrls: ["./echarts-progress-circle.css"], + styleUrls: ['./echarts-progress-circle.css'], }) export default class EchartsProgressCircle implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); value = 60; @@ -36,9 +32,7 @@ export default class EchartsProgressCircle implements OnInit { show: true, lineStyle: { width: 15, - color: [ - [1, getComputedCSSProperty('color-neutral-40')], - ], + color: [[1, getComputedCSSProperty('color-neutral-40')]], }, }, axisTick: { @@ -99,7 +93,7 @@ export default class EchartsProgressCircle implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-special-3d.ts b/packages/angular-test-app/src/preview-examples/echarts-special-3d.ts index 62d2395f76..0ff45b1687 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-special-3d.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-special-3d.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, getComputedCSSProperty } from '@siemens/ix-echarts'; +import { getComputedCSSProperty } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import { EChartsOption } from 'echarts'; @@ -22,7 +22,7 @@ import * as _ from 'echarts-gl/dist/echarts-gl'; styleUrls: ['./echarts-special-3d.css'], }) export default class EchartsSpecial3d implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); gridConfig() { return { @@ -82,7 +82,7 @@ export default class EchartsSpecial3d implements OnInit { ngOnInit() { themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-special-toolbox.ts b/packages/angular-test-app/src/preview-examples/echarts-special-toolbox.ts index 7a7be99c68..1e51b8be36 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-special-toolbox.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-special-toolbox.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, registerTheme } from '@siemens/ix-echarts'; +import { registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -16,10 +16,10 @@ import { EChartsOption } from 'echarts'; @Component({ selector: 'app-example', templateUrl: './echarts-special-toolbox.html', - styleUrls: ["./echarts-special-toolbox.css"], + styleUrls: ['./echarts-special-toolbox.css'], }) export default class EchartsSpecialToolbox implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); options: EChartsOption = { toolbox: { @@ -57,7 +57,7 @@ export default class EchartsSpecialToolbox implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts-special-zoom.ts b/packages/angular-test-app/src/preview-examples/echarts-special-zoom.ts index 82bbc95544..7294587b11 100644 --- a/packages/angular-test-app/src/preview-examples/echarts-special-zoom.ts +++ b/packages/angular-test-app/src/preview-examples/echarts-special-zoom.ts @@ -8,11 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { - convertThemeName, - registerTheme, - getComputedCSSProperty, -} from '@siemens/ix-echarts'; +import { registerTheme, getComputedCSSProperty } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts/core'; import { EChartsOption } from 'echarts'; @@ -23,7 +19,7 @@ import { EChartsOption } from 'echarts'; styleUrls: ['./echarts-special-zoom.css'], }) export default class EchartsSpecialZoom implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); //create some random data private base = +new Date(1968, 9, 3); @@ -99,7 +95,7 @@ export default class EchartsSpecialZoom implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/angular-test-app/src/preview-examples/echarts.ts b/packages/angular-test-app/src/preview-examples/echarts.ts index 60caad60a4..845473f211 100644 --- a/packages/angular-test-app/src/preview-examples/echarts.ts +++ b/packages/angular-test-app/src/preview-examples/echarts.ts @@ -8,7 +8,7 @@ */ import { Component, OnInit } from '@angular/core'; -import { convertThemeName, registerTheme } from '@siemens/ix-echarts'; +import { registerTheme } from '@siemens/ix-echarts'; import { themeSwitcher } from '@siemens/ix'; import * as echarts from 'echarts'; import { EChartsOption } from 'echarts'; @@ -19,7 +19,7 @@ import { EChartsOption } from 'echarts'; styleUrls: ['./echarts.css'], }) export default class Echarts implements OnInit { - theme = convertThemeName(themeSwitcher.getCurrentTheme()); + theme = themeSwitcher.getCurrentTheme(); options: EChartsOption = { tooltip: { @@ -144,7 +144,7 @@ export default class Echarts implements OnInit { registerTheme(echarts); themeSwitcher.themeChanged.on((theme: string) => { - this.theme = convertThemeName(theme); + this.theme = theme; }); } } diff --git a/packages/html-test-app/src/preview-examples/echarts-bar-horizontal-stacked.html b/packages/html-test-app/src/preview-examples/echarts-bar-horizontal-stacked.html index 753a5b3183..7d9c079d29 100644 --- a/packages/html-test-app/src/preview-examples/echarts-bar-horizontal-stacked.html +++ b/packages/html-test-app/src/preview-examples/echarts-bar-horizontal-stacked.html @@ -18,18 +18,15 @@ - +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +