@operato/scene-scichart 7.2.3 → 7.2.4

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.2.4](https://github.com/things-scene/operato-scene/compare/v7.2.3...v7.2.4) (2024-08-02)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * scichart yAxis precision ([1924c9a](https://github.com/things-scene/operato-scene/commit/1924c9af920d579b682ec71fef80d0c4450844e5))
12
+
13
+
14
+
6
15
  ## [7.2.3](https://github.com/things-scene/operato-scene/compare/v7.2.2...v7.2.3) (2024-08-02)
7
16
 
8
17
 
@@ -222,7 +222,7 @@ let OxSciChartMultiple = OxSciChartMultiple_1 = class OxSciChartMultiple extends
222
222
  }
223
223
  };
224
224
  const container = this.renderRoot.querySelector(`#${this.containerId + '-' + dataKey}`);
225
- var { chart, dataSeries } = (await buildSciChart(config, container, { fontSize: 14, fontFamily: 'Roboto', fontColor: undefined }, { precision: valueFormat ? calculatePrecision(valueFormat) : undefined }));
225
+ var { chart, dataSeries } = (await buildSciChart(config, container, { fontSize: 14, fontFamily: 'Roboto', fontColor: undefined }, { precision: valueFormat ? calculatePrecision(valueFormat) : undefined, grouped: this.containerId }));
226
226
  this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface);
227
227
  this.synchronizer.addAxis(chart.sciChartSurface.xAxes.get(0));
228
228
  groupedChart.dataKey = config.data.datasets[0].dataKey;
@@ -1 +1 @@
1
- {"version":3,"file":"ox-scichart-multiple.js","sourceRoot":"","sources":["../../src/charts/ox-scichart-multiple.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,E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AK,CAAC,UAAU,CAAC,QAAmC,IAAG,CAAC;;AAnUjD,sBAAG,GAAW,CAAC,AAAZ,CAAY;AAEf,yBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;CACF,AAjCY,CAiCZ;AA/D2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA+C;AAC/C;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAAqC;AACpC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yDAA6B;AACE;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;wDAA6B;AAuBjE;IAAnB,KAAK,CAAC,WAAW,CAAC;6DAAmC;AA3B3C,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAiW9B","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { property, query, customElement } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { calculatePrecision, buildSciChart, buildSciChartOverview } from './scichart-builder'\nimport { AxisSynchroniser } from './axis-synchronizer'\nimport { NumberRange, scaleAxes, SciChartVerticalGroup } from 'scichart'\n\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-scichart-multiple')\nexport class OxSciChartMultiple extends LitElement {\n @property({ type: Object }) config: OperatoChart.ChartConfig | null = null\n @property({ type: Array }) data: { [attr: string]: any }[] = []\n @property({ type: Array }) visibleSeries: string[] = []\n @property({ type: Boolean, attribute: 'show-overview' }) showOverview: boolean = true\n\n private synchronizer: AxisSynchroniser = new AxisSynchroniser(new NumberRange(200, 500))\n private verticalGroup: SciChartVerticalGroup = new SciChartVerticalGroup()\n\n private isInitializing: boolean = false\n private overviewChart: any = null\n private overviewDataSeries: any[] = []\n private groupCharts: {\n dataKey: string\n sciChartSurface: any\n dataSeries: any[]\n }[] = []\n\n /*\n [주의]\n ox-scichart container의 id를 글로벌 유니크하게 해야한다. \n SciChart가 특별히 container의 id를 기반으로 하위 컴포넌트를 구성하고 있기 때문이다.\n shadowDom 안에 있는 container 이더라도, 글로벌 유니크한 id를 제공해야 한다.\n 그렇지 않으면, 단 하나의 차트만 제대로 렌더링된다.\n */\n private containerId: string = 'ox-scichart-multiple' + ++OxSciChartMultiple.idx\n\n @query('.overview') overviewContainer!: HTMLDivElement\n\n static idx: number = 0\n\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n width: 100%;\n height: 100%;\n }\n\n .overview {\n height: 80px;\n }\n\n #chart-group {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n }\n\n .grouped-chart {\n flex: 1;\n\n min-height: 25%;\n }\n\n [hidden] {\n display: none;\n }\n `\n ]\n\n async initializeSciChart() {\n this.cleanup()\n\n const { chart, dataSeries } =\n (await buildSciChartOverview(this.config, this.overviewContainer, {}, this.synchronizer)) || {}\n\n this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)\n\n this.overviewChart = chart\n this.overviewDataSeries = dataSeries!\n }\n\n async updated(changedProperties: Map<string | number | symbol, unknown>) {\n var needDataUpdate = false\n\n if (changedProperties.has('config') && this.config) {\n this.isInitializing = true\n await this.initializeSciChart()\n this.isInitializing = false\n needDataUpdate = true\n }\n\n if (changedProperties.has('visibleSeries')) {\n if (this.isInitializing) {\n await this.ensureInitialization()\n }\n await this.updateSeries(this.visibleSeries, changedProperties.get('visibleSeries') as string[])\n needDataUpdate = true\n }\n\n if (changedProperties.has('data')) {\n needDataUpdate = true\n }\n\n if (needDataUpdate) {\n await this.updateDataSeries()\n }\n }\n\n private async ensureInitialization() {\n while (this.isInitializing) {\n await new Promise(resolve => setTimeout(resolve, 100)) // Check every 100ms\n }\n }\n\n cleanup() {\n this.cleanupGroup()\n\n if (this.overviewChart) {\n this.overviewChart.sciChartSurface?.delete()\n this.overviewChart = null\n }\n }\n\n cleanupGroup() {\n this.groupCharts.forEach(chart => {\n if (chart.sciChartSurface) {\n this.synchronizer.removeAxis(chart.sciChartSurface.xAxes.get(0))\n this.verticalGroup.removeSurface(chart.sciChartSurface)\n chart.sciChartSurface.delete()\n }\n })\n\n this.groupCharts.length = 0\n }\n\n async updateDataSeries() {\n const { config, data } = this\n const { datasets = [], labelDataKey: attrX } = config?.data || {}\n\n if (!(data instanceof Array) || !attrX) {\n return []\n }\n\n const newData = this.dataSet\n\n ;(this.groupCharts || []).forEach(({ dataKey, sciChartSurface, dataSeries }) => {\n try {\n dataSeries.forEach(ds => ds.clear())\n const dataSet = newData.filter((data, index) => dataKey == datasets[index].dataKey!)\n\n dataSet.forEach((data, index) => {\n const filteredData = data.filter(d => typeof d.yValue === 'number')\n\n if (filteredData.length > 0) {\n dataSeries[index].appendRange(\n filteredData.map(d => d.xValue),\n filteredData.map(d => d.yValue)\n )\n }\n })\n } catch (error) {\n console.log(error)\n }\n\n sciChartSurface.zoomExtents()\n sciChartSurface.invalidateElement()\n })\n\n try {\n this.overviewDataSeries.forEach(ds => ds.clear())\n\n newData.forEach((data, index) => {\n if (this.visibleSeries.includes(datasets[index].dataKey!)) {\n const filteredData = data.filter(d => typeof d.yValue === 'number')\n if (filteredData.length > 0) {\n this.overviewDataSeries[index].appendRange(\n filteredData.map(d => d.xValue),\n filteredData.map(d => d.yValue)\n )\n }\n }\n })\n\n this.overviewChart?.sciChartSurface.zoomExtents()\n this.overviewChart?.sciChartSurface.invalidateElement()\n } catch (error) {\n console.log(error)\n }\n }\n\n get dataSet(): { xValue: number; yValue: number }[][] {\n const { config, data } = this\n const { datasets = [], labelDataKey: attrX } = config?.data || {}\n\n if (!(data instanceof Array) || !attrX) {\n return []\n }\n\n return datasets.map(dataset => {\n return data\n .map(item => {\n if (!item || typeof item !== 'object') {\n return\n }\n\n const xValue = new Date(item[attrX])\n if (isNaN(xValue.getTime())) {\n console.error('Invalid date:', item[attrX])\n return\n }\n\n return {\n xValue: xValue.getTime() / 1000,\n yValue: item[dataset.dataKey!]\n }\n })\n .filter(Boolean) as { xValue: number; yValue: number }[]\n })\n }\n\n render() {\n const { datasets = [] } = this.config?.data || {}\n\n return html`\n <div id=${this.containerId + '-overview'} class=\"overview\" ?hidden=${!this.showOverview}></div>\n <div id=\"chart-group\">\n ${datasets.map(({ dataKey }) =>\n keyed(\n dataKey,\n html`\n <div\n id=${this.containerId + '-' + dataKey}\n class=\"grouped-chart\"\n ?hidden=${!this.visibleSeries.includes(dataKey!)}\n ></div>\n `\n )\n )}\n </div>\n `\n }\n\n async buildChartGroup() {\n this.cleanupGroup()\n\n const { config } = this\n const { datasets = [] } = config?.data || {}\n\n await Promise.all(\n datasets\n .filter(dataset => this.visibleSeries.includes(dataset.dataKey!))\n .map(async dataset => {\n await this.addChart(dataset.dataKey!)\n })\n )\n }\n\n async updateSeries(after: string[], before: string[]) {\n /* 기존 시리즈와 새로운 시리즈의 차이를 비교해서, before에는 있는데, after에는 없으면 await removeChart(string)를 호출하고, after에는 있는데, before에는 없으면, addChart(string) 한다. */\n // before에는 있는데 after에는 없는 시리즈를 제거합니다.\n for (const series of before || []) {\n if (!after.includes(series)) {\n await this.removeChart(series)\n }\n }\n\n // after에는 있는데 before에는 없는 시리즈를 추가합니다.\n for (const series of after || []) {\n if (!before || !before.includes(series)) {\n await this.addChart(series)\n }\n }\n }\n\n async addChart(dataKey: string) {\n const groupedChart = {\n dataKey: '',\n sciChartSurface: undefined,\n dataSeries: [] as any[]\n }\n\n const { data = {}, options = {} } = this.config || {}\n const { datasets = [] } = data as OperatoChart.ChartData\n const dataset = datasets.find(dataset => dataset.dataKey == dataKey)\n\n if (!dataset) {\n return\n }\n\n const { scales } = options\n const { yAxes = [] } = scales || {}\n const { valueFormat } = dataset\n\n const yAxis = {\n ...yAxes[0],\n axisTitle: dataset?.label\n }\n\n const config = {\n ...this.config,\n data: {\n datasets: [dataset]\n },\n options: {\n ...options,\n scales: {\n ...scales,\n yAxes: [yAxis]\n }\n }\n }\n\n const container = this.renderRoot.querySelector(`#${this.containerId + '-' + dataKey}`)\n var { chart, dataSeries } = (await buildSciChart(\n config,\n container,\n { fontSize: 14, fontFamily: 'Roboto', fontColor: undefined },\n { precision: valueFormat ? calculatePrecision(valueFormat) : undefined }\n ))!\n\n this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)\n this.synchronizer.addAxis(chart.sciChartSurface.xAxes.get(0))\n\n groupedChart.dataKey = config.data.datasets[0]!.dataKey!\n groupedChart.sciChartSurface = chart.sciChartSurface\n groupedChart.dataSeries = dataSeries\n\n this.groupCharts = this.groupSorter([...this.groupCharts, groupedChart])\n }\n\n removeChart(dataKey: string) {\n const index = this.groupCharts.findIndex((chart: any) => chart.dataKey == dataKey)\n const [groupedChart] = this.groupCharts.splice(index, 1)\n\n if (!groupedChart) {\n return\n }\n\n this.verticalGroup.removeSurface(groupedChart.sciChartSurface)\n this.synchronizer.removeAxis(groupedChart.sciChartSurface.xAxes.get(0))\n\n groupedChart.sciChartSurface.delete()\n groupedChart.sciChartSurface = undefined\n\n this.groupCharts = this.groupSorter(this.groupCharts)\n }\n\n groupSorter(group: any[]) {\n return group.sort(\n (a, b) =>\n this.visibleSeries.findIndex((s: any) => s.dataKey == a.dataKey) -\n this.visibleSeries.findIndex((s: any) => s.dataKey == b.dataKey)\n )\n }\n\n async appendData(appendum: { [attr: string]: any }[]) {}\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-scichart-multiple': OxSciChartMultiple\n }\n}\n"]}
1
+ {"version":3,"file":"ox-scichart-multiple.js","sourceRoot":"","sources":["../../src/charts/ox-scichart-multiple.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAClE,OA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AAC,CAAC,OAAO,CAAC,CACnE,CAAA;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAAmC,IAAG,CAAC;;AAnUjD,sBAAG,GAAW,CAAC,AAAZ,CAAY;AAEf,yBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;CACF,AAjCY,CAiCZ;AA/D2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA+C;AAC/C;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAAqC;AACpC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yDAA6B;AACE;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;wDAA6B;AAuBjE;IAAnB,KAAK,CAAC,WAAW,CAAC;6DAAmC;AA3B3C,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAiW9B","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { property, query, customElement } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { calculatePrecision, buildSciChart, buildSciChartOverview } from './scichart-builder'\nimport { AxisSynchroniser } from './axis-synchronizer'\nimport { NumberRange, scaleAxes, SciChartVerticalGroup } from 'scichart'\n\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-scichart-multiple')\nexport class OxSciChartMultiple extends LitElement {\n @property({ type: Object }) config: OperatoChart.ChartConfig | null = null\n @property({ type: Array }) data: { [attr: string]: any }[] = []\n @property({ type: Array }) visibleSeries: string[] = []\n @property({ type: Boolean, attribute: 'show-overview' }) showOverview: boolean = true\n\n private synchronizer: AxisSynchroniser = new AxisSynchroniser(new NumberRange(200, 500))\n private verticalGroup: SciChartVerticalGroup = new SciChartVerticalGroup()\n\n private isInitializing: boolean = false\n private overviewChart: any = null\n private overviewDataSeries: any[] = []\n private groupCharts: {\n dataKey: string\n sciChartSurface: any\n dataSeries: any[]\n }[] = []\n\n /*\n [주의]\n ox-scichart container의 id를 글로벌 유니크하게 해야한다. \n SciChart가 특별히 container의 id를 기반으로 하위 컴포넌트를 구성하고 있기 때문이다.\n shadowDom 안에 있는 container 이더라도, 글로벌 유니크한 id를 제공해야 한다.\n 그렇지 않으면, 단 하나의 차트만 제대로 렌더링된다.\n */\n private containerId: string = 'ox-scichart-multiple' + ++OxSciChartMultiple.idx\n\n @query('.overview') overviewContainer!: HTMLDivElement\n\n static idx: number = 0\n\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n width: 100%;\n height: 100%;\n }\n\n .overview {\n height: 80px;\n }\n\n #chart-group {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n }\n\n .grouped-chart {\n flex: 1;\n\n min-height: 25%;\n }\n\n [hidden] {\n display: none;\n }\n `\n ]\n\n async initializeSciChart() {\n this.cleanup()\n\n const { chart, dataSeries } =\n (await buildSciChartOverview(this.config, this.overviewContainer, {}, this.synchronizer)) || {}\n\n this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)\n\n this.overviewChart = chart\n this.overviewDataSeries = dataSeries!\n }\n\n async updated(changedProperties: Map<string | number | symbol, unknown>) {\n var needDataUpdate = false\n\n if (changedProperties.has('config') && this.config) {\n this.isInitializing = true\n await this.initializeSciChart()\n this.isInitializing = false\n needDataUpdate = true\n }\n\n if (changedProperties.has('visibleSeries')) {\n if (this.isInitializing) {\n await this.ensureInitialization()\n }\n await this.updateSeries(this.visibleSeries, changedProperties.get('visibleSeries') as string[])\n needDataUpdate = true\n }\n\n if (changedProperties.has('data')) {\n needDataUpdate = true\n }\n\n if (needDataUpdate) {\n await this.updateDataSeries()\n }\n }\n\n private async ensureInitialization() {\n while (this.isInitializing) {\n await new Promise(resolve => setTimeout(resolve, 100)) // Check every 100ms\n }\n }\n\n cleanup() {\n this.cleanupGroup()\n\n if (this.overviewChart) {\n this.overviewChart.sciChartSurface?.delete()\n this.overviewChart = null\n }\n }\n\n cleanupGroup() {\n this.groupCharts.forEach(chart => {\n if (chart.sciChartSurface) {\n this.synchronizer.removeAxis(chart.sciChartSurface.xAxes.get(0))\n this.verticalGroup.removeSurface(chart.sciChartSurface)\n chart.sciChartSurface.delete()\n }\n })\n\n this.groupCharts.length = 0\n }\n\n async updateDataSeries() {\n const { config, data } = this\n const { datasets = [], labelDataKey: attrX } = config?.data || {}\n\n if (!(data instanceof Array) || !attrX) {\n return []\n }\n\n const newData = this.dataSet\n\n ;(this.groupCharts || []).forEach(({ dataKey, sciChartSurface, dataSeries }) => {\n try {\n dataSeries.forEach(ds => ds.clear())\n const dataSet = newData.filter((data, index) => dataKey == datasets[index].dataKey!)\n\n dataSet.forEach((data, index) => {\n const filteredData = data.filter(d => typeof d.yValue === 'number')\n\n if (filteredData.length > 0) {\n dataSeries[index].appendRange(\n filteredData.map(d => d.xValue),\n filteredData.map(d => d.yValue)\n )\n }\n })\n } catch (error) {\n console.log(error)\n }\n\n sciChartSurface.zoomExtents()\n sciChartSurface.invalidateElement()\n })\n\n try {\n this.overviewDataSeries.forEach(ds => ds.clear())\n\n newData.forEach((data, index) => {\n if (this.visibleSeries.includes(datasets[index].dataKey!)) {\n const filteredData = data.filter(d => typeof d.yValue === 'number')\n if (filteredData.length > 0) {\n this.overviewDataSeries[index].appendRange(\n filteredData.map(d => d.xValue),\n filteredData.map(d => d.yValue)\n )\n }\n }\n })\n\n this.overviewChart?.sciChartSurface.zoomExtents()\n this.overviewChart?.sciChartSurface.invalidateElement()\n } catch (error) {\n console.log(error)\n }\n }\n\n get dataSet(): { xValue: number; yValue: number }[][] {\n const { config, data } = this\n const { datasets = [], labelDataKey: attrX } = config?.data || {}\n\n if (!(data instanceof Array) || !attrX) {\n return []\n }\n\n return datasets.map(dataset => {\n return data\n .map(item => {\n if (!item || typeof item !== 'object') {\n return\n }\n\n const xValue = new Date(item[attrX])\n if (isNaN(xValue.getTime())) {\n console.error('Invalid date:', item[attrX])\n return\n }\n\n return {\n xValue: xValue.getTime() / 1000,\n yValue: item[dataset.dataKey!]\n }\n })\n .filter(Boolean) as { xValue: number; yValue: number }[]\n })\n }\n\n render() {\n const { datasets = [] } = this.config?.data || {}\n\n return html`\n <div id=${this.containerId + '-overview'} class=\"overview\" ?hidden=${!this.showOverview}></div>\n <div id=\"chart-group\">\n ${datasets.map(({ dataKey }) =>\n keyed(\n dataKey,\n html`\n <div\n id=${this.containerId + '-' + dataKey}\n class=\"grouped-chart\"\n ?hidden=${!this.visibleSeries.includes(dataKey!)}\n ></div>\n `\n )\n )}\n </div>\n `\n }\n\n async buildChartGroup() {\n this.cleanupGroup()\n\n const { config } = this\n const { datasets = [] } = config?.data || {}\n\n await Promise.all(\n datasets\n .filter(dataset => this.visibleSeries.includes(dataset.dataKey!))\n .map(async dataset => {\n await this.addChart(dataset.dataKey!)\n })\n )\n }\n\n async updateSeries(after: string[], before: string[]) {\n /* 기존 시리즈와 새로운 시리즈의 차이를 비교해서, before에는 있는데, after에는 없으면 await removeChart(string)를 호출하고, after에는 있는데, before에는 없으면, addChart(string) 한다. */\n // before에는 있는데 after에는 없는 시리즈를 제거합니다.\n for (const series of before || []) {\n if (!after.includes(series)) {\n await this.removeChart(series)\n }\n }\n\n // after에는 있는데 before에는 없는 시리즈를 추가합니다.\n for (const series of after || []) {\n if (!before || !before.includes(series)) {\n await this.addChart(series)\n }\n }\n }\n\n async addChart(dataKey: string) {\n const groupedChart = {\n dataKey: '',\n sciChartSurface: undefined,\n dataSeries: [] as any[]\n }\n\n const { data = {}, options = {} } = this.config || {}\n const { datasets = [] } = data as OperatoChart.ChartData\n const dataset = datasets.find(dataset => dataset.dataKey == dataKey)\n\n if (!dataset) {\n return\n }\n\n const { scales } = options\n const { yAxes = [] } = scales || {}\n const { valueFormat } = dataset\n\n const yAxis = {\n ...yAxes[0],\n axisTitle: dataset?.label\n }\n\n const config = {\n ...this.config,\n data: {\n datasets: [dataset]\n },\n options: {\n ...options,\n scales: {\n ...scales,\n yAxes: [yAxis]\n }\n }\n }\n\n const container = this.renderRoot.querySelector(`#${this.containerId + '-' + dataKey}`)\n var { chart, dataSeries } = (await buildSciChart(\n config,\n container,\n { fontSize: 14, fontFamily: 'Roboto', fontColor: undefined },\n { precision: valueFormat ? calculatePrecision(valueFormat) : undefined, grouped: this.containerId }\n ))!\n\n this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)\n this.synchronizer.addAxis(chart.sciChartSurface.xAxes.get(0))\n\n groupedChart.dataKey = config.data.datasets[0]!.dataKey!\n groupedChart.sciChartSurface = chart.sciChartSurface\n groupedChart.dataSeries = dataSeries\n\n this.groupCharts = this.groupSorter([...this.groupCharts, groupedChart])\n }\n\n removeChart(dataKey: string) {\n const index = this.groupCharts.findIndex((chart: any) => chart.dataKey == dataKey)\n const [groupedChart] = this.groupCharts.splice(index, 1)\n\n if (!groupedChart) {\n return\n }\n\n this.verticalGroup.removeSurface(groupedChart.sciChartSurface)\n this.synchronizer.removeAxis(groupedChart.sciChartSurface.xAxes.get(0))\n\n groupedChart.sciChartSurface.delete()\n groupedChart.sciChartSurface = undefined\n\n this.groupCharts = this.groupSorter(this.groupCharts)\n }\n\n groupSorter(group: any[]) {\n return group.sort(\n (a, b) =>\n this.visibleSeries.findIndex((s: any) => s.dataKey == a.dataKey) -\n this.visibleSeries.findIndex((s: any) => s.dataKey == b.dataKey)\n )\n }\n\n async appendData(appendum: { [attr: string]: any }[]) {}\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-scichart-multiple': OxSciChartMultiple\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@operato/scene-scichart",
3
3
  "description": "scichart wrapping component",
4
- "version": "7.2.3",
4
+ "version": "7.2.4",
5
5
  "license": "MIT",
6
6
  "things-scene": true,
7
7
  "author": "heartyoh",
@@ -59,5 +59,5 @@
59
59
  "prettier --write"
60
60
  ]
61
61
  },
62
- "gitHead": "dd70dc4e80cf4cc5815e3f3e9193d721817e0d6a"
62
+ "gitHead": "1c3fa7fc84feeb634d52819edf3b661e0f967e27"
63
63
  }
@@ -323,7 +323,7 @@ export class OxSciChartMultiple extends LitElement {
323
323
  config,
324
324
  container,
325
325
  { fontSize: 14, fontFamily: 'Roboto', fontColor: undefined },
326
- { precision: valueFormat ? calculatePrecision(valueFormat) : undefined }
326
+ { precision: valueFormat ? calculatePrecision(valueFormat) : undefined, grouped: this.containerId }
327
327
  ))!
328
328
 
329
329
  this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)