@operato/chart 9.0.0-beta.4 → 9.0.0-beta.41
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/CHANGELOG.md +236 -0
- package/dist/src/chartjs/config-converter.d.ts +1 -0
- package/dist/src/chartjs/config-converter.js.map +1 -1
- package/dist/src/chartjs/ox-chart-js.d.ts +3 -2
- package/dist/src/chartjs/ox-chart-js.js +1 -1
- package/dist/src/chartjs/ox-chart-js.js.map +1 -1
- package/dist/src/editors/configurer.d.ts +3 -2
- package/dist/src/editors/configurer.js.map +1 -1
- package/dist/src/editors/index.d.ts +1 -1
- package/dist/src/editors/index.js +2 -2
- package/dist/src/editors/index.js.map +1 -1
- package/dist/src/editors/input-chart-abstract.d.ts +2 -1
- package/dist/src/editors/input-chart-abstract.js +2 -2
- package/dist/src/editors/input-chart-abstract.js.map +1 -1
- package/dist/src/editors/input-chart-styles.js +12 -11
- package/dist/src/editors/input-chart-styles.js.map +1 -1
- package/dist/src/editors/ox-input-chart-hbar.d.ts +3 -2
- package/dist/src/editors/ox-input-chart-hbar.js +2 -2
- package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-mixed.d.ts +2 -2
- package/dist/src/editors/ox-input-chart-mixed.js +2 -2
- package/dist/src/editors/ox-input-chart-mixed.js.map +1 -1
- package/dist/src/editors/ox-input-chart-pie.d.ts +3 -2
- package/dist/src/editors/ox-input-chart-pie.js +2 -2
- package/dist/src/editors/ox-input-chart-pie.js.map +1 -1
- package/dist/src/editors/ox-input-chart-radar.d.ts +3 -2
- package/dist/src/editors/ox-input-chart-radar.js +2 -2
- package/dist/src/editors/ox-input-chart-radar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-timeseries.d.ts +3 -3
- package/dist/src/editors/ox-input-chart-timeseries.js +4 -4
- package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
- package/dist/src/editors/ox-property-editor-chart.d.ts +5 -5
- package/dist/src/editors/ox-property-editor-chart.js +8 -8
- package/dist/src/editors/ox-property-editor-chart.js.map +1 -1
- package/dist/src/editors/templates/annotations.d.ts +3 -2
- package/dist/src/editors/templates/annotations.js.map +1 -1
- package/dist/src/editors/templates/display-value.d.ts +1 -1
- package/dist/src/editors/templates/display-value.js.map +1 -1
- package/dist/src/editors/templates/series.d.ts +4 -3
- package/dist/src/editors/templates/series.js +1 -1
- package/dist/src/editors/templates/series.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/scichart/ox-scichart.d.ts +3 -2
- package/dist/src/scichart/ox-scichart.js +1 -1
- package/dist/src/scichart/ox-scichart.js.map +1 -1
- package/dist/src/scichart/scichart-builder.d.ts +1 -0
- package/dist/src/scichart/scichart-builder.js.map +1 -1
- package/dist/stories/common.d.ts +1 -0
- package/dist/stories/common.js.map +1 -1
- package/dist/stories/ox-input-chart-bar.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-bar.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-doughnut.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-doughnut.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-hbar.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-hbar.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-line.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-line.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-pie.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-pie.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-polar-area.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-polar-area.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-radar.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-radar.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-timeseries.stories.d.ts +1 -0
- package/dist/stories/ox-input-chart-timeseries.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -7
- package/types/types.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../../src/editors/templates/annotations.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAMxC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IACjD,gBAAgB;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IAQS,OAAO,CAAC,kBAAkC;QAClD,IAAI,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YACzC,IAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAA;IACpC,CAAC;IAED,MAAM;QACJ,OAAO,KAAK,CACV,IAAI,CAAC,UAAU,CAAC,sBAAsB,EACtC,IAAI,CAAA;;oDAE0C,IAAI,CAAC,cAAc;mEACJ,IAAI,CAAC,WAAW;0DACzB,IAAI,CAAC,UAAU,CAAC,sBAAsB;gBAChF,IAAI,CAAC,WAAW,EAAE;;oEAEkC,IAAI,CAAC,YAAY;;;yDAG5B,IAAI,CAAC,cAAc;;YAEhE,IAAI,CAAC,qBAAqB,EAAE;;OAEjC,CACF,CAAA;IACH,CAAC;IAEO,WAAW;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CACpC,CAAC,UAAmC,EAAE,KAAa,EAAE,EAAE,CAAC,IAAI,CAAA;;4BAEtC,KAAK,GAAG,CAAC;2BACV,KAAK;;sBAEV,KAAK,KAAK,IAAI,CAAC,UAAU,C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AC,WAAW,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC;YAC1F,gBAAgB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;YAC5C,iBAAiB,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;QAChD,CAAC;aAAM,CAAC;YACN,gBAAgB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;YAC5C,iBAAiB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;CACF,CAAA;AAvR6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAwB;AAEvB;IAA3B,KAAK,CAAC,mBAAmB,CAAC;4DAA8B;AACd;IAA1C,KAAK,CAAC,kCAAkC,CAAC;wEAAqC;AACnC;IAA3C,KAAK,CAAC,mCAAmC,CAAC;yEAAsC;AATtE,mBAAmB;IAD/B,aAAa,CAAC,sBAAsB,CAAC;GACzB,mBAAmB,CA4R/B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { LitElement, html, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { MdIcon } from '@material/web/icon/icon.js'\n\nimport { Configurer } from '../configurer'\n\n@customElement('ox-chart-annotations')\nexport class AnnotationsTemplate extends LitElement {\n createRenderRoot() {\n return this\n }\n\n @property({ type: Object }) configurer!: Configurer\n\n @query('#annotations-tabs') annotationsTabs!: HTMLElement\n @query('#annotations-tab-nav-left-button') annotationsTabNavLeftButton!: MdIcon\n @query('#annotations-tab-nav-right-button') annotationsTabNavRightButton!: MdIcon\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('configurer')) {\n this.requestUpdate()\n }\n }\n\n get value() {\n return this.configurer.annotations\n }\n\n render() {\n return keyed(\n this.configurer.currentAnnotationIndex,\n html`\n <div id=\"annotations-properties-container\" fullwidth>\n <div id=\"annotations-tab-header\" @wheel=${this._onWheelScroll}>\n <md-icon id=\"annotations-tab-nav-left-button\" @click=${this._scrollLeft}>chevron_left</md-icon>\n <div id=\"annotations-tabs\" active-tab-index=${this.configurer.currentAnnotationIndex} fit-container>\n ${this._renderTabs()}\n </div>\n <md-icon id=\"annotations-tab-nav-right-button\" @click=${this._scrollRight}>chevron_right</md-icon>\n </div>\n <div id=\"add-annotation-button-container\">\n <md-icon id=\"add-annotation-button\" @click=${this._addAnnotation}>add</md-icon>\n </div>\n ${this._renderAnnotationForm()}\n </div>\n `\n )\n }\n\n private _renderTabs() {\n return this.configurer.annotations.map(\n (annotation: OperatoChart.Annotation, index: number) => html`\n <div\n data-annotation=${index + 1}\n data-tab-index=${index}\n tab\n ?selected=${index === this.configurer.currentAnnotationIndex}\n @click=${() => this._selectTab(index)}\n >\n ${index + 1}\n ${this.configurer.annotations.length > 0 && this.configurer.currentAnnotationIndex === index\n ? html`<md-icon @click=${() => this._removeAnnotation(index)}>close</md-icon>`\n : html``}\n </div>\n `\n )\n }\n\n private _renderAnnotationForm() {\n const currentAnnotation =\n this.configurer.currentAnnotationIndex >= 0\n ? this.configurer.annotations[this.configurer.currentAnnotationIndex]\n : undefined\n\n if (!currentAnnotation) {\n return html`<p>No annotations available. Add one using the button above.</p>`\n }\n\n return html`\n <div class=\"tab-content\">\n <label for=\"annotation-type\"> <ox-i18n msgid=\"label.chart-annotation-type\">Type</ox-i18n> </label>\n <select\n id=\"annotation-type\"\n class=\"select-content\"\n value-key=\"annotation.type\"\n .value=${currentAnnotation!.type || ''}\n >\n <option value=\"\"> </option>\n <option value=\"line\">Line</option>\n <option value=\"text\">Text</option>\n <option value=\"box\">Box</option>\n <option value=\"horizontalLine\">Horizontal Line</option>\n <option value=\"verticalLine\">Vertical Line</option>\n </select>\n\n <label for=\"annotation-x1\">X1</label>\n <input\n id=\"annotation-x1\"\n type=\"number\"\n value-key=\"annotation.x1\"\n .value=${String(currentAnnotation!.x1 || 0)}\n />\n\n <label for=\"annotation-y1\">Y1</label>\n <input\n id=\"annotation-y1\"\n type=\"number\"\n value-key=\"annotation.y1\"\n .value=${String(currentAnnotation!.y1 || 0)}\n />\n\n <label for=\"annotation-x2\">X2</label>\n <input\n id=\"annotation-x2\"\n type=\"number\"\n value-key=\"annotation.x2\"\n .value=${String(currentAnnotation!.x2 || 0)}\n />\n\n <label for=\"annotation-y2\">Y2</label>\n <input\n id=\"annotation-y2\"\n type=\"number\"\n value-key=\"annotation.y2\"\n .value=${String(currentAnnotation!.y2 || 0)}\n />\n\n <label for=\"annotation-stroke\"> <ox-i18n msgid=\"label.stroke-style\">Stroke Style</ox-i18n> </label>\n <ox-input-color\n id=\"annotation-stroke\"\n value-key=\"annotation.stroke\"\n .value=${currentAnnotation!.stroke}\n ></ox-input-color>\n\n <label for=\"annotation-stroke-thickness\">\n <ox-i18n msgid=\"label.stroke-thickness\">Stroke Thickness</ox-i18n>\n </label>\n <input\n id=\"annotation-stroke-thickness\"\n type=\"number\"\n value-key=\"annotation.strokeThickness\"\n .value=${String(currentAnnotation!.strokeThickness || 1)}\n />\n\n <label for=\"annotation-fill\"> <ox-i18n msgid=\"label.fill\">Fill</ox-i18n> </label>\n <ox-input-color\n id=\"annotation-fill\"\n value-key=\"annotation.fill\"\n .value=${currentAnnotation!.fill}\n ></ox-input-color>\n\n <label for=\"annotation-text\"> <ox-i18n msgid=\"label.annotation-text\">Text</ox-i18n> </label>\n <input id=\"annotation-text\" type=\"text\" value-key=\"annotation.text\" .value=${currentAnnotation!.text || ''} />\n\n <label for=\"annotation-horizontal-anchor\">\n <ox-i18n msgid=\"label.horizontal-anchor\">Horizontal Anchor</ox-i18n>\n </label>\n <select\n id=\"annotation-horizontal-anchor\"\n class=\"select-content\"\n value-key=\"annotation.horizontalAnchorPoint\"\n .value=${currentAnnotation!.horizontalAnchorPoint || ''}\n >\n <option value=\"\"> </option>\n <option value=\"Left\">Left</option>\n <option value=\"Center\">Center</option>\n <option value=\"Right\">Right</option>\n </select>\n\n <label for=\"annotation-vertical-anchor\">\n <ox-i18n msgid=\"label.vertical-anchor\">Vertical Anchor</ox-i18n>\n </label>\n <select\n id=\"annotation-vertical-anchor\"\n class=\"select-content\"\n value-key=\"annotation.verticalAnchorPoint\"\n .value=${currentAnnotation!.verticalAnchorPoint || ''}\n >\n <option value=\"\"> </option>\n <option value=\"Top\">Top</option>\n <option value=\"Center\">Center</option>\n <option value=\"Bottom\">Bottom</option>\n </select>\n\n <label for=\"annotation-x-coordinate-mode\">X Coordinate Mode</label>\n <select\n id=\"annotation-x-coordinate-mode\"\n class=\"select-content\"\n value-key=\"annotation.xCoordinateMode\"\n .value=${currentAnnotation!.xCoordinateMode || 'DataValue'}\n >\n <option value=\"\"> </option>\n <option value=\"DataValue\">DataValue</option>\n <option value=\"Pixel\">Pixel</option>\n <option value=\"Relative\">Relative</option>\n </select>\n\n <label for=\"annotation-y-coordinate-mode\">Y Coordinate Mode</label>\n <select\n id=\"annotation-y-coordinate-mode\"\n class=\"select-content\"\n value-key=\"annotation.yCoordinateMode\"\n .value=${currentAnnotation!.yCoordinateMode || 'DataValue'}\n >\n <option value=\"\"> </option>\n <option value=\"DataValue\">DataValue</option>\n <option value=\"Pixel\">Pixel</option>\n <option value=\"Relative\">Relative</option>\n </select>\n </div>\n `\n }\n\n private _selectTab(index: number) {\n this.configurer.setCurrentAnnotationIndex(index)\n this.requestUpdate()\n }\n\n private _removeAnnotation(index: number) {\n this.configurer.removeAnnotation(index)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _addAnnotation() {\n this.configurer.addAnnotation()\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _onWheelScroll(event: WheelEvent) {\n const tabContainer = this.annotationsTabs\n if (tabContainer) {\n event.preventDefault()\n\n tabContainer.scrollLeft += event.deltaY\n\n this._onTabScroll()\n }\n }\n\n private _scrollLeft() {\n this._scrollTabContainer(-1)\n }\n\n private _scrollRight() {\n this._scrollTabContainer(1)\n }\n\n private _scrollTabContainer(direction: number) {\n const tabContainer = this.renderRoot!.querySelector<HTMLElement>('#annotations-tabs')\n if (tabContainer) {\n tabContainer.style.scrollBehavior = 'smooth'\n tabContainer.scrollLeft += direction * tabContainer.clientWidth\n }\n\n setTimeout(() => {\n tabContainer!.style.scrollBehavior = 'auto'\n this._onTabScroll()\n }, 300)\n }\n\n private _onTabScroll() {\n let tabContainer: HTMLElement | null | undefined\n let tabNavLeftButton: MdIcon\n let tabNavRightButton: MdIcon\n\n tabContainer = this.annotationsTabs\n tabNavLeftButton = this.annotationsTabNavLeftButton\n tabNavRightButton = this.annotationsTabNavRightButton\n\n if (!tabContainer) {\n return\n }\n\n if (tabContainer.clientWidth == tabContainer.scrollWidth) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.setAttribute('disabled', '')\n } else if (tabContainer.scrollLeft <= 0) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.removeAttribute('disabled')\n } else if (tabContainer.scrollLeft + tabContainer.clientWidth >= tabContainer.scrollWidth) {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.setAttribute('disabled', '')\n } else {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.removeAttribute('disabled')\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../../src/editors/templates/annotations.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAOxC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IACjD,gBAAgB;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IAQS,OAAO,CAAC,kBAAkC;QAClD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,KAAK,CAAC,mCAAmC,CAAC;yEAAsC;AATtE,mBAAmB;IAD/B,aAAa,CAAC,sBAAsB,CAAC;GACzB,mBAAmB,CA4R/B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { LitElement, html, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { MdIcon } from '@material/web/icon/icon.js'\n\nimport { Configurer } from '../configurer.js'\nimport type { OperatoChart } from '../../../types/types.d.ts'\n\n@customElement('ox-chart-annotations')\nexport class AnnotationsTemplate extends LitElement {\n createRenderRoot() {\n return this\n }\n\n @property({ type: Object }) configurer!: Configurer\n\n @query('#annotations-tabs') annotationsTabs!: HTMLElement\n @query('#annotations-tab-nav-left-button') annotationsTabNavLeftButton!: MdIcon\n @query('#annotations-tab-nav-right-button') annotationsTabNavRightButton!: MdIcon\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('configurer')) {\n this.requestUpdate()\n }\n }\n\n get value() {\n return this.configurer.annotations\n }\n\n render() {\n return keyed(\n this.configurer.currentAnnotationIndex,\n html`\n <div id=\"annotations-properties-container\" fullwidth>\n <div id=\"annotations-tab-header\" @wheel=${this._onWheelScroll}>\n <md-icon id=\"annotations-tab-nav-left-button\" @click=${this._scrollLeft}>chevron_left</md-icon>\n <div id=\"annotations-tabs\" active-tab-index=${this.configurer.currentAnnotationIndex} fit-container>\n ${this._renderTabs()}\n </div>\n <md-icon id=\"annotations-tab-nav-right-button\" @click=${this._scrollRight}>chevron_right</md-icon>\n </div>\n <div id=\"add-annotation-button-container\">\n <md-icon id=\"add-annotation-button\" @click=${this._addAnnotation}>add</md-icon>\n </div>\n ${this._renderAnnotationForm()}\n </div>\n `\n )\n }\n\n private _renderTabs() {\n return this.configurer.annotations.map(\n (annotation: OperatoChart.Annotation, index: number) => html`\n <div\n data-annotation=${index + 1}\n data-tab-index=${index}\n tab\n ?selected=${index === this.configurer.currentAnnotationIndex}\n @click=${() => this._selectTab(index)}\n >\n ${index + 1}\n ${this.configurer.annotations.length > 0 && this.configurer.currentAnnotationIndex === index\n ? html`<md-icon @click=${() => this._removeAnnotation(index)}>close</md-icon>`\n : html``}\n </div>\n `\n )\n }\n\n private _renderAnnotationForm() {\n const currentAnnotation =\n this.configurer.currentAnnotationIndex >= 0\n ? this.configurer.annotations[this.configurer.currentAnnotationIndex]\n : undefined\n\n if (!currentAnnotation) {\n return html`<p>No annotations available. Add one using the button above.</p>`\n }\n\n return html`\n <div class=\"tab-content\">\n <label for=\"annotation-type\"> <ox-i18n msgid=\"label.chart-annotation-type\">Type</ox-i18n> </label>\n <select\n id=\"annotation-type\"\n class=\"select-content\"\n value-key=\"annotation.type\"\n .value=${currentAnnotation!.type || ''}\n >\n <option value=\"\"> </option>\n <option value=\"line\">Line</option>\n <option value=\"text\">Text</option>\n <option value=\"box\">Box</option>\n <option value=\"horizontalLine\">Horizontal Line</option>\n <option value=\"verticalLine\">Vertical Line</option>\n </select>\n\n <label for=\"annotation-x1\">X1</label>\n <input\n id=\"annotation-x1\"\n type=\"number\"\n value-key=\"annotation.x1\"\n .value=${String(currentAnnotation!.x1 || 0)}\n />\n\n <label for=\"annotation-y1\">Y1</label>\n <input\n id=\"annotation-y1\"\n type=\"number\"\n value-key=\"annotation.y1\"\n .value=${String(currentAnnotation!.y1 || 0)}\n />\n\n <label for=\"annotation-x2\">X2</label>\n <input\n id=\"annotation-x2\"\n type=\"number\"\n value-key=\"annotation.x2\"\n .value=${String(currentAnnotation!.x2 || 0)}\n />\n\n <label for=\"annotation-y2\">Y2</label>\n <input\n id=\"annotation-y2\"\n type=\"number\"\n value-key=\"annotation.y2\"\n .value=${String(currentAnnotation!.y2 || 0)}\n />\n\n <label for=\"annotation-stroke\"> <ox-i18n msgid=\"label.stroke-style\">Stroke Style</ox-i18n> </label>\n <ox-input-color\n id=\"annotation-stroke\"\n value-key=\"annotation.stroke\"\n .value=${currentAnnotation!.stroke}\n ></ox-input-color>\n\n <label for=\"annotation-stroke-thickness\">\n <ox-i18n msgid=\"label.stroke-thickness\">Stroke Thickness</ox-i18n>\n </label>\n <input\n id=\"annotation-stroke-thickness\"\n type=\"number\"\n value-key=\"annotation.strokeThickness\"\n .value=${String(currentAnnotation!.strokeThickness || 1)}\n />\n\n <label for=\"annotation-fill\"> <ox-i18n msgid=\"label.fill\">Fill</ox-i18n> </label>\n <ox-input-color\n id=\"annotation-fill\"\n value-key=\"annotation.fill\"\n .value=${currentAnnotation!.fill}\n ></ox-input-color>\n\n <label for=\"annotation-text\"> <ox-i18n msgid=\"label.annotation-text\">Text</ox-i18n> </label>\n <input id=\"annotation-text\" type=\"text\" value-key=\"annotation.text\" .value=${currentAnnotation!.text || ''} />\n\n <label for=\"annotation-horizontal-anchor\">\n <ox-i18n msgid=\"label.horizontal-anchor\">Horizontal Anchor</ox-i18n>\n </label>\n <select\n id=\"annotation-horizontal-anchor\"\n class=\"select-content\"\n value-key=\"annotation.horizontalAnchorPoint\"\n .value=${currentAnnotation!.horizontalAnchorPoint || ''}\n >\n <option value=\"\"> </option>\n <option value=\"Left\">Left</option>\n <option value=\"Center\">Center</option>\n <option value=\"Right\">Right</option>\n </select>\n\n <label for=\"annotation-vertical-anchor\">\n <ox-i18n msgid=\"label.vertical-anchor\">Vertical Anchor</ox-i18n>\n </label>\n <select\n id=\"annotation-vertical-anchor\"\n class=\"select-content\"\n value-key=\"annotation.verticalAnchorPoint\"\n .value=${currentAnnotation!.verticalAnchorPoint || ''}\n >\n <option value=\"\"> </option>\n <option value=\"Top\">Top</option>\n <option value=\"Center\">Center</option>\n <option value=\"Bottom\">Bottom</option>\n </select>\n\n <label for=\"annotation-x-coordinate-mode\">X Coordinate Mode</label>\n <select\n id=\"annotation-x-coordinate-mode\"\n class=\"select-content\"\n value-key=\"annotation.xCoordinateMode\"\n .value=${currentAnnotation!.xCoordinateMode || 'DataValue'}\n >\n <option value=\"\"> </option>\n <option value=\"DataValue\">DataValue</option>\n <option value=\"Pixel\">Pixel</option>\n <option value=\"Relative\">Relative</option>\n </select>\n\n <label for=\"annotation-y-coordinate-mode\">Y Coordinate Mode</label>\n <select\n id=\"annotation-y-coordinate-mode\"\n class=\"select-content\"\n value-key=\"annotation.yCoordinateMode\"\n .value=${currentAnnotation!.yCoordinateMode || 'DataValue'}\n >\n <option value=\"\"> </option>\n <option value=\"DataValue\">DataValue</option>\n <option value=\"Pixel\">Pixel</option>\n <option value=\"Relative\">Relative</option>\n </select>\n </div>\n `\n }\n\n private _selectTab(index: number) {\n this.configurer.setCurrentAnnotationIndex(index)\n this.requestUpdate()\n }\n\n private _removeAnnotation(index: number) {\n this.configurer.removeAnnotation(index)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _addAnnotation() {\n this.configurer.addAnnotation()\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _onWheelScroll(event: WheelEvent) {\n const tabContainer = this.annotationsTabs\n if (tabContainer) {\n event.preventDefault()\n\n tabContainer.scrollLeft += event.deltaY\n\n this._onTabScroll()\n }\n }\n\n private _scrollLeft() {\n this._scrollTabContainer(-1)\n }\n\n private _scrollRight() {\n this._scrollTabContainer(1)\n }\n\n private _scrollTabContainer(direction: number) {\n const tabContainer = this.renderRoot!.querySelector<HTMLElement>('#annotations-tabs')\n if (tabContainer) {\n tabContainer.style.scrollBehavior = 'smooth'\n tabContainer.scrollLeft += direction * tabContainer.clientWidth\n }\n\n setTimeout(() => {\n tabContainer!.style.scrollBehavior = 'auto'\n this._onTabScroll()\n }, 300)\n }\n\n private _onTabScroll() {\n let tabContainer: HTMLElement | null | undefined\n let tabNavLeftButton: MdIcon\n let tabNavRightButton: MdIcon\n\n tabContainer = this.annotationsTabs\n tabNavLeftButton = this.annotationsTabNavLeftButton\n tabNavRightButton = this.annotationsTabNavRightButton\n\n if (!tabContainer) {\n return\n }\n\n if (tabContainer.clientWidth == tabContainer.scrollWidth) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.setAttribute('disabled', '')\n } else if (tabContainer.scrollLeft <= 0) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.removeAttribute('disabled')\n } else if (tabContainer.scrollLeft + tabContainer.clientWidth >= tabContainer.scrollWidth) {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.setAttribute('disabled', '')\n } else {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.removeAttribute('disabled')\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-value.js","sourceRoot":"","sources":["../../../../src/editors/templates/display-value.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAKpD,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAC1C,gBAAgB;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IAID,MAAM;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;QAClC,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAA;QACnD,UAAU,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAA;QAE1G,OAAO,IAAI,CAAA;;;;;;;mBAOI,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;;;;;;;;;;;;;;;;;mBAiBnC,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;;;;;;;;mBAQnC,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;;;;4EAIsB,UAAU,CAAC,MAAM,CAAC,YAAY,IAAI,GAAG;;;;;;UAMvG,UAAU,CAAC,MAAM,CAAC,YAAY;YAC9B,CAAC,CAAC,IAAI,CAAA;;;;;yBAKS,UAAU,CAAC,MAAM,CAAC,gBAAgB,IAAI,MAAM;;;;;;;yBAO5C,UAAU,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE;;;;;;yBAMvC,UAAU,CAAC,MAAM,CAAC,eAAe,IAAI,QAAQ;;;;;;;;;;;yBAW7C,UAAU,CAAC,MAAM,CAAC,eAAe,IAAI,CAAC;;;;;;;yBAOtC,UAAU,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC;;aAEpD;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;;KAEb,CAAA;IACH,CAAC;CACF,CAAA;AA7F6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAwB;AALxC,YAAY;IADxB,aAAa,CAAC,wBAAwB,CAAC;GAC3B,YAAY,CAkGxB","sourcesContent":["import { LitElement, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Configurer } from '../configurer' // Configurer 경로에 맞게 수정하세요.\n\n@customElement('ox-chart-display-value')\nexport class DisplayValue extends LitElement {\n createRenderRoot() {\n return this\n }\n\n @property({ type: Object }) configurer!: Configurer\n\n render() {\n const configurer = this.configurer\n const displayValue = configurer.series.displayValue\n configurer.series.displayValue = displayValue === true ? 'T' : displayValue === false ? 'F' : displayValue\n\n return html`\n <div id=\"display-value-container\">\n <label for=\"value-format\"> <ox-i18n msgid=\"label.value-format\">Value Format</ox-i18n> </label>\n <input\n id=\"value-format\"\n type=\"text\"\n value-key=\"series.valueFormat\"\n .value=${configurer.series.valueFormat || ''}\n list=\"format-list\"\n />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n\n <label for=\"value-prefix\"> <ox-i18n msgid=\"label.value-prefix\">Value Prefix</ox-i18n> </label>\n <input\n id=\"value-prefix\"\n type=\"text\"\n value-key=\"series.valuePrefix\"\n .value=${configurer.series.valuePrefix || ''}\n />\n\n <label for=\"value-suffix\"> <ox-i18n msgid=\"label.value-suffix\">Value Suffix</ox-i18n> </label>\n <input\n id=\"value-suffix\"\n type=\"text\"\n value-key=\"series.valueSuffix\"\n .value=${configurer.series.valueSuffix || ''}\n />\n\n <label for=\"display-value\"> <ox-i18n msgid=\"label.value-display\">Value Display</ox-i18n> </label>\n <select id=\"display-value\" value-key=\"series.displayValue\" .value=${configurer.series.displayValue || 'F'}>\n <option value=\"T\">Show</option>\n <option value=\"F\">Hide</option>\n <option value=\"auto\">Hide to Overlap</option>\n </select>\n\n ${configurer.series.displayValue\n ? html`\n <label for=\"font-color\"> <ox-i18n msgid=\"label.font-color\">Font Color</ox-i18n> </label>\n <ox-input-color\n id=\"font-color\"\n value-key=\"series.defaultFontColor\"\n .value=${configurer.series.defaultFontColor || '#000'}\n ></ox-input-color>\n <label for=\"font-size\"> <ox-i18n msgid=\"label.font-size\">Font Size</ox-i18n> </label>\n <input\n id=\"font-size\"\n type=\"number\"\n value-key=\"series.defaultFontSize\"\n .value=${configurer.series.defaultFontSize || 10}\n />\n <label for=\"data-label-anchor\"> <ox-i18n msgid=\"label.data-label-anchor\">Position</ox-i18n> </label>\n <select\n id=\"data-label-anchor\"\n value-key=\"series.dataLabelAnchor\"\n .value=${configurer.series.dataLabelAnchor || 'center'}\n >\n <option value=\"center\">Center</option>\n <option value=\"start\">Start</option>\n <option value=\"end\">End</option>\n </select>\n <label for=\"data-label-offset\"> <ox-i18n msgid=\"label.data-label-offset\">Offset</ox-i18n> </label>\n <input\n id=\"data-label-offset\"\n type=\"number\"\n value-key=\"series.dataLabelOffset\"\n .value=${configurer.series.dataLabelOffset || 0}\n />\n <label for=\"data-label-rotation\"> <ox-i18n msgid=\"label.data-label-rotation\">Rotation</ox-i18n> </label>\n <input\n id=\"data-label-rotation\"\n type=\"number\"\n value-key=\"series.dataLabelRotation\"\n .value=${configurer.series.dataLabelRotation || 0}\n />\n `\n : html``}\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-chart-display-value': DisplayValue\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"display-value.js","sourceRoot":"","sources":["../../../../src/editors/templates/display-value.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAKpD,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAC1C,gBAAgB;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IAID,MAAM;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;QAClC,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAA;QACnD,UAAU,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAA;QAE1G,OAAO,IAAI,CAAA;;;;;;;mBAOI,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;;;;;;;;;;;;;;;;;mBAiBnC,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;;;;;;;;mBAQnC,UAAU,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE;;;;4EAIsB,UAAU,CAAC,MAAM,CAAC,YAAY,IAAI,GAAG;;;;;;UAMvG,UAAU,CAAC,MAAM,CAAC,YAAY;YAC9B,CAAC,CAAC,IAAI,CAAA;;;;;yBAKS,UAAU,CAAC,MAAM,CAAC,gBAAgB,IAAI,MAAM;;;;;;;yBAO5C,UAAU,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE;;;;;;yBAMvC,UAAU,CAAC,MAAM,CAAC,eAAe,IAAI,QAAQ;;;;;;;;;;;yBAW7C,UAAU,CAAC,MAAM,CAAC,eAAe,IAAI,CAAC;;;;;;;yBAOtC,UAAU,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC;;aAEpD;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;;KAEb,CAAA;IACH,CAAC;CACF,CAAA;AA7F6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAwB;AALxC,YAAY;IADxB,aAAa,CAAC,wBAAwB,CAAC;GAC3B,YAAY,CAkGxB","sourcesContent":["import { LitElement, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Configurer } from '../configurer.js' // Configurer 경로에 맞게 수정하세요.\n\n@customElement('ox-chart-display-value')\nexport class DisplayValue extends LitElement {\n createRenderRoot() {\n return this\n }\n\n @property({ type: Object }) configurer!: Configurer\n\n render() {\n const configurer = this.configurer\n const displayValue = configurer.series.displayValue\n configurer.series.displayValue = displayValue === true ? 'T' : displayValue === false ? 'F' : displayValue\n\n return html`\n <div id=\"display-value-container\">\n <label for=\"value-format\"> <ox-i18n msgid=\"label.value-format\">Value Format</ox-i18n> </label>\n <input\n id=\"value-format\"\n type=\"text\"\n value-key=\"series.valueFormat\"\n .value=${configurer.series.valueFormat || ''}\n list=\"format-list\"\n />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n\n <label for=\"value-prefix\"> <ox-i18n msgid=\"label.value-prefix\">Value Prefix</ox-i18n> </label>\n <input\n id=\"value-prefix\"\n type=\"text\"\n value-key=\"series.valuePrefix\"\n .value=${configurer.series.valuePrefix || ''}\n />\n\n <label for=\"value-suffix\"> <ox-i18n msgid=\"label.value-suffix\">Value Suffix</ox-i18n> </label>\n <input\n id=\"value-suffix\"\n type=\"text\"\n value-key=\"series.valueSuffix\"\n .value=${configurer.series.valueSuffix || ''}\n />\n\n <label for=\"display-value\"> <ox-i18n msgid=\"label.value-display\">Value Display</ox-i18n> </label>\n <select id=\"display-value\" value-key=\"series.displayValue\" .value=${configurer.series.displayValue || 'F'}>\n <option value=\"T\">Show</option>\n <option value=\"F\">Hide</option>\n <option value=\"auto\">Hide to Overlap</option>\n </select>\n\n ${configurer.series.displayValue\n ? html`\n <label for=\"font-color\"> <ox-i18n msgid=\"label.font-color\">Font Color</ox-i18n> </label>\n <ox-input-color\n id=\"font-color\"\n value-key=\"series.defaultFontColor\"\n .value=${configurer.series.defaultFontColor || '#000'}\n ></ox-input-color>\n <label for=\"font-size\"> <ox-i18n msgid=\"label.font-size\">Font Size</ox-i18n> </label>\n <input\n id=\"font-size\"\n type=\"number\"\n value-key=\"series.defaultFontSize\"\n .value=${configurer.series.defaultFontSize || 10}\n />\n <label for=\"data-label-anchor\"> <ox-i18n msgid=\"label.data-label-anchor\">Position</ox-i18n> </label>\n <select\n id=\"data-label-anchor\"\n value-key=\"series.dataLabelAnchor\"\n .value=${configurer.series.dataLabelAnchor || 'center'}\n >\n <option value=\"center\">Center</option>\n <option value=\"start\">Start</option>\n <option value=\"end\">End</option>\n </select>\n <label for=\"data-label-offset\"> <ox-i18n msgid=\"label.data-label-offset\">Offset</ox-i18n> </label>\n <input\n id=\"data-label-offset\"\n type=\"number\"\n value-key=\"series.dataLabelOffset\"\n .value=${configurer.series.dataLabelOffset || 0}\n />\n <label for=\"data-label-rotation\"> <ox-i18n msgid=\"label.data-label-rotation\">Rotation</ox-i18n> </label>\n <input\n id=\"data-label-rotation\"\n type=\"number\"\n value-key=\"series.dataLabelRotation\"\n .value=${configurer.series.dataLabelRotation || 0}\n />\n `\n : html``}\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-chart-display-value': DisplayValue\n }\n}\n"]}
|
|
@@ -2,8 +2,9 @@ import '@material/web/icon/icon.js';
|
|
|
2
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
3
|
import { MdIcon } from '@material/web/icon/icon.js';
|
|
4
4
|
import { TinyColor } from '@ctrl/tinycolor';
|
|
5
|
-
import { Configurer } from '../configurer';
|
|
6
|
-
import '
|
|
5
|
+
import { Configurer } from '../configurer.js';
|
|
6
|
+
import type { OperatoChart } from '../../../types/types.d.ts';
|
|
7
|
+
import './display-value.js';
|
|
7
8
|
export declare class MultipleSeriesTemplate extends LitElement {
|
|
8
9
|
createRenderRoot(): this;
|
|
9
10
|
configurer: Configurer;
|
|
@@ -13,7 +14,7 @@ export declare class MultipleSeriesTemplate extends LitElement {
|
|
|
13
14
|
seriesTabNavRightButton: MdIcon;
|
|
14
15
|
protected updated(_changedProperties: PropertyValues): void;
|
|
15
16
|
get value(): OperatoChart.Dataset[];
|
|
16
|
-
render(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/keyed").Keyed>;
|
|
17
|
+
render(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/keyed.js").Keyed>;
|
|
17
18
|
private _renderTabs;
|
|
18
19
|
private _renderSeriesForm;
|
|
19
20
|
_getSeriesModel({ chartType, datasetsLength, lastSeriesColor }: {
|
|
@@ -4,7 +4,7 @@ import { LitElement, html, nothing } from 'lit';
|
|
|
4
4
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
5
|
import { keyed } from 'lit/directives/keyed.js';
|
|
6
6
|
import { random as randomColor, TinyColor } from '@ctrl/tinycolor';
|
|
7
|
-
import './display-value';
|
|
7
|
+
import './display-value.js';
|
|
8
8
|
let MultipleSeriesTemplate = class MultipleSeriesTemplate extends LitElement {
|
|
9
9
|
createRenderRoot() {
|
|
10
10
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series.js","sourceRoot":"","sources":["../../../../src/editors/templates/series.ts"],"names":[],"mappings":";AAAA,OAAO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import { customElement, property, query } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { MdIcon } from '@material/web/icon/icon.js'\nimport { random as randomColor, TinyColor } from '@ctrl/tinycolor'\n\nimport { Configurer } from '../configurer'\nimport './display-value'\n\n@customElement('ox-chart-series')\nexport class MultipleSeriesTemplate extends LitElement {\n createRenderRoot() {\n return this\n }\n\n @property({ type: Object }) configurer!: Configurer\n @property({ type: String }) chartType?: OperatoChart.ChartType\n\n @query('#series-tabs') seriesTabs!: HTMLElement\n @query('#series-tab-nav-left-button') seriesTabNavLeftButton!: MdIcon\n @query('#series-tab-nav-right-button') seriesTabNavRightButton!: MdIcon\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('configurer') || _changedProperties.has('chartType')) {\n this.requestUpdate()\n }\n }\n\n get value() {\n return this.configurer.datasets\n }\n\n render() {\n return keyed(\n this.configurer.currentSeriesIndex,\n html`\n <div id=\"series-properties-container\" fullwidth>\n <div id=\"series-tab-header\" @wheel=${this._onWheelScroll}>\n <md-icon id=\"series-tab-nav-left-button\" @click=${this._scrollLeft}>chevron_left</md-icon>\n <div id=\"series-tabs\" active-tab-index=${this.configurer.currentSeriesIndex} fit-container>\n ${this._renderTabs()}\n </div>\n <md-icon id=\"series-tab-nav-right-button\" @click=${this._scrollRight}>chevron_right</md-icon>\n </div>\n <div id=\"add-series-button-container\">\n <md-icon id=\"add-series-button\" @click=${this._addSeries}>add</md-icon>\n </div>\n ${this._renderSeriesForm()}\n </div>\n `\n )\n }\n\n private _renderTabs() {\n return this.configurer.datasets.map(\n (dataset: OperatoChart.Dataset, index: number) => html`\n <div\n data-series=${index + 1}\n data-tab-index=${index}\n tab\n ?selected=${index === this.configurer.currentSeriesIndex}\n @click=${() => this._selectTab(index)}\n >\n ${index + 1}\n ${this.configurer.datasets.length > 1 && this.configurer.currentSeriesIndex === index\n ? html`<md-icon @click=${() => this._removeSeries(index)}>close</md-icon>`\n : html``}\n </div>\n `\n )\n }\n\n private _renderSeriesForm() {\n const configurer = this.configurer\n const chartType = this.chartType\n\n return html`\n <div class=\"tab-content\">\n <label for=\"data-key\"> <ox-i18n msgid=\"label.data-key\">Data Key</ox-i18n> </label>\n <input id=\"data-key\" type=\"text\" value-key=\"dataKey\" .value=${configurer.dataKey || ''} />\n\n ${chartType == 'horizontalBar' ||\n chartType === 'doughnut' ||\n chartType === 'pie' ||\n chartType == 'radar' ||\n chartType == 'polarArea'\n ? nothing\n : html`\n <label for=\"series-type\"> <ox-i18n msgid=\"label.series-type\">Type</ox-i18n> </label>\n <select\n id=\"series-type\"\n class=\"select-content\"\n value-key=\"series.type\"\n .value=${configurer.series.type || ''}\n >\n <option value=\"bar\" selected>Bar</option>\n <option value=\"line\">Line</option>\n </select>\n `}\n\n <label for=\"series-label\"> <ox-i18n msgid=\"label.label\">Label</ox-i18n> </label>\n <input id=\"series-label\" type=\"text\" value-key=\"series.label\" .value=${configurer.series.label || ''} />\n\n ${configurer.series.type === 'line'\n ? html`\n <label for=\"series-line-tension\"> <ox-i18n msgid=\"label.line-tension\">Line Tension</ox-i18n> </label>\n <select\n id=\"series-line-tension\"\n class=\"select-content\"\n value-key=\"series.lineTension\"\n .value=${String(configurer.series.lineTension || 0)}\n >\n <option value=\"0.4\">Smooth</option>\n <option value=\"0\">Angled</option>\n </select>\n `\n : html``}\n ${configurer.series.type === 'line'\n ? html`\n <label for=\"series-border-width\"> <ox-i18n msgid=\"label.border-width\">Border Width</ox-i18n> </label>\n <input\n id=\"series-border-width\"\n type=\"number\"\n value-key=\"series.borderWidth\"\n .value=${String(configurer.series.borderWidth || 0)}\n />\n `\n : html``}\n\n <label for=\"series-color\"> <ox-i18n msgid=\"label.color\">Color</ox-i18n> </label>\n <ox-input-color id=\"series-color\" value-key=\"color\" .value=${configurer.color}></ox-input-color>\n\n ${configurer.series.type === 'line'\n ? html`\n <label for=\"series-point-style\"> <ox-i18n msgid=\"label.point-shape\">Point Shape</ox-i18n> </label>\n <select\n id=\"series-point-style\"\n class=\"select-content\"\n value-key=\"series.pointStyle\"\n .value=${configurer.series.pointStyle || ''}\n >\n <option value=\"\"> </option>\n <option value=\"circle\">⚬</option>\n <option value=\"triangle\">▵</option>\n <option value=\"rect\">□</option>\n <option value=\"rectRot\">◇</option>\n <option value=\"cross\">+</option>\n <option value=\"crossRot\">⨉</option>\n <option value=\"star\">✱</option>\n <option value=\"line\">―</option>\n <option value=\"dash\">┄</option>\n </select>\n\n <label for=\"series-point-radius\"> <ox-i18n msgid=\"label.point-size\">Point Size</ox-i18n> </label>\n <input\n id=\"series-point-radius\"\n type=\"number\"\n value-key=\"series.pointRadius\"\n .value=${String(configurer.series.pointRadius || 0)}\n />\n `\n : html``}\n\n <label for=\"series-stack\"> <ox-i18n msgid=\"label.stack-group\">Stack group</ox-i18n> </label>\n <input id=\"series-stack\" type=\"text\" value-key=\"series.stack\" .value=${configurer.series.stack || ''} />\n\n ${configurer.series.type === 'line'\n ? html`\n <input id=\"series-fill\" type=\"checkbox\" value-key=\"series.fill\" ?checked=${configurer.series.fill} />\n <label for=\"series-fill\"> <ox-i18n msgid=\"label.fill\">Fill</ox-i18n> </label>\n `\n : html``}\n ${configurer.multiAxis && configurer.series.type !== 'horizontalBar'\n ? html`\n <label for=\"series-y-axis-id\"> <ox-i18n msgid=\"label.target-axis\">Target Axis</ox-i18n> </label>\n <select\n id=\"series-y-axis-id\"\n class=\"select-content\"\n value-key=\"series.yAxisID\"\n .value=${configurer.series.yAxisID || ''}\n >\n <option value=\"left\">Left</option>\n <option value=\"right\">Right</option>\n </select>\n `\n : html``}\n\n <label></label>\n <ox-chart-display-value .configurer=${configurer} fullwidth></ox-chart-display-value>\n </div>\n `\n }\n\n _getSeriesModel({\n chartType,\n datasetsLength,\n lastSeriesColor\n }: {\n chartType: string\n datasetsLength: number\n lastSeriesColor: TinyColor\n }) {\n const addSeriesOption: any = {\n label: `series ${datasetsLength + 1}`,\n data: [],\n borderWidth: 1,\n dataKey: '',\n yAxisID: 'left',\n color: randomColor({\n hue: lastSeriesColor.toHsv().h\n }).toRgbString(),\n stack: ''\n }\n\n addSeriesOption.type = addSeriesOption.chartType = chartType\n return addSeriesOption\n }\n\n private _selectTab(index: number) {\n this.configurer.setCurrentSeriesIndex(index)\n this.requestUpdate()\n }\n\n private _removeSeries(index: number) {\n this.configurer.removeSeries(index)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _addSeries() {\n const configurer = this.configurer\n\n if (!configurer.config.data.datasets) {\n return\n }\n\n const lastSeriesIndex = configurer.config.data.datasets.length\n const chartType = configurer.series.type || configurer.config.type\n const color = configurer.datasets[lastSeriesIndex - 1]?.backgroundColor\n const lastSeriesColor = new TinyColor(Array.isArray(color) ? color[0] : color)\n\n const seriesModel = this._getSeriesModel({\n chartType: chartType!,\n datasetsLength: lastSeriesIndex,\n lastSeriesColor\n })\n\n this.configurer.addSeries(seriesModel)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _onWheelScroll(event: WheelEvent) {\n const tabContainer = this.seriesTabs\n if (tabContainer) {\n event.preventDefault()\n\n tabContainer.scrollLeft += event.deltaY\n\n this._onTabScroll()\n }\n }\n\n private _scrollLeft() {\n this._scrollTabContainer(-1)\n }\n\n private _scrollRight() {\n this._scrollTabContainer(1)\n }\n\n private _scrollTabContainer(direction: number) {\n const tabContainer = this.renderRoot!.querySelector<HTMLElement>('#series-tabs')\n if (tabContainer) {\n tabContainer.style.scrollBehavior = 'smooth'\n tabContainer.scrollLeft += direction * tabContainer.clientWidth\n }\n\n setTimeout(() => {\n tabContainer!.style.scrollBehavior = 'auto'\n this._onTabScroll()\n }, 300)\n }\n\n private _onTabScroll() {\n let tabContainer: HTMLElement | null | undefined\n let tabNavLeftButton: MdIcon\n let tabNavRightButton: MdIcon\n\n tabContainer = this.seriesTabs\n tabNavLeftButton = this.seriesTabNavLeftButton\n tabNavRightButton = this.seriesTabNavRightButton\n\n if (!tabContainer) {\n return\n }\n\n if (tabContainer.clientWidth == tabContainer.scrollWidth) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.setAttribute('disabled', '')\n } else if (tabContainer.scrollLeft <= 0) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.removeAttribute('disabled')\n } else if (tabContainer.scrollLeft + tabContainer.clientWidth >= tabContainer.scrollWidth) {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.setAttribute('disabled', '')\n } else {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.removeAttribute('disabled')\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"series.js","sourceRoot":"","sources":["../../../../src/editors/templates/series.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAKlE,OAAO,oBAAoB,CAAA;AAGpB,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IACpD,gBAAgB;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IASS,OAAO,CAAC,kBAAkC;QAClD,IAAI,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAChF,IAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAA;IACjC,CAAC;IAED,MAAM;QACJ,OAAO,KAAK,CACV,IAAI,CAAC,UAAU,C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,CAAC,UAAU,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;CACF,CAAA;AA1S6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAwB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAmC;AAEvC;IAAtB,KAAK,CAAC,cAAc,CAAC;0DAAyB;AACT;IAArC,KAAK,CAAC,6BAA6B,CAAC;sEAAgC;AAC9B;IAAtC,KAAK,CAAC,8BAA8B,CAAC;uEAAiC;AAV5D,sBAAsB;IADlC,aAAa,CAAC,iBAAiB,CAAC;GACpB,sBAAsB,CA+SlC","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { LitElement, html, PropertyValues, nothing } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { MdIcon } from '@material/web/icon/icon.js'\nimport { random as randomColor, TinyColor } from '@ctrl/tinycolor'\n\nimport { Configurer } from '../configurer.js'\nimport type { OperatoChart } from '../../../types/types.d.ts'\n\nimport './display-value.js'\n\n@customElement('ox-chart-series')\nexport class MultipleSeriesTemplate extends LitElement {\n createRenderRoot() {\n return this\n }\n\n @property({ type: Object }) configurer!: Configurer\n @property({ type: String }) chartType?: OperatoChart.ChartType\n\n @query('#series-tabs') seriesTabs!: HTMLElement\n @query('#series-tab-nav-left-button') seriesTabNavLeftButton!: MdIcon\n @query('#series-tab-nav-right-button') seriesTabNavRightButton!: MdIcon\n\n protected updated(_changedProperties: PropertyValues): void {\n if (_changedProperties.has('configurer') || _changedProperties.has('chartType')) {\n this.requestUpdate()\n }\n }\n\n get value() {\n return this.configurer.datasets\n }\n\n render() {\n return keyed(\n this.configurer.currentSeriesIndex,\n html`\n <div id=\"series-properties-container\" fullwidth>\n <div id=\"series-tab-header\" @wheel=${this._onWheelScroll}>\n <md-icon id=\"series-tab-nav-left-button\" @click=${this._scrollLeft}>chevron_left</md-icon>\n <div id=\"series-tabs\" active-tab-index=${this.configurer.currentSeriesIndex} fit-container>\n ${this._renderTabs()}\n </div>\n <md-icon id=\"series-tab-nav-right-button\" @click=${this._scrollRight}>chevron_right</md-icon>\n </div>\n <div id=\"add-series-button-container\">\n <md-icon id=\"add-series-button\" @click=${this._addSeries}>add</md-icon>\n </div>\n ${this._renderSeriesForm()}\n </div>\n `\n )\n }\n\n private _renderTabs() {\n return this.configurer.datasets.map(\n (dataset: OperatoChart.Dataset, index: number) => html`\n <div\n data-series=${index + 1}\n data-tab-index=${index}\n tab\n ?selected=${index === this.configurer.currentSeriesIndex}\n @click=${() => this._selectTab(index)}\n >\n ${index + 1}\n ${this.configurer.datasets.length > 1 && this.configurer.currentSeriesIndex === index\n ? html`<md-icon @click=${() => this._removeSeries(index)}>close</md-icon>`\n : html``}\n </div>\n `\n )\n }\n\n private _renderSeriesForm() {\n const configurer = this.configurer\n const chartType = this.chartType\n\n return html`\n <div class=\"tab-content\">\n <label for=\"data-key\"> <ox-i18n msgid=\"label.data-key\">Data Key</ox-i18n> </label>\n <input id=\"data-key\" type=\"text\" value-key=\"dataKey\" .value=${configurer.dataKey || ''} />\n\n ${chartType == 'horizontalBar' ||\n chartType === 'doughnut' ||\n chartType === 'pie' ||\n chartType == 'radar' ||\n chartType == 'polarArea'\n ? nothing\n : html`\n <label for=\"series-type\"> <ox-i18n msgid=\"label.series-type\">Type</ox-i18n> </label>\n <select\n id=\"series-type\"\n class=\"select-content\"\n value-key=\"series.type\"\n .value=${configurer.series.type || ''}\n >\n <option value=\"bar\" selected>Bar</option>\n <option value=\"line\">Line</option>\n </select>\n `}\n\n <label for=\"series-label\"> <ox-i18n msgid=\"label.label\">Label</ox-i18n> </label>\n <input id=\"series-label\" type=\"text\" value-key=\"series.label\" .value=${configurer.series.label || ''} />\n\n ${configurer.series.type === 'line'\n ? html`\n <label for=\"series-line-tension\"> <ox-i18n msgid=\"label.line-tension\">Line Tension</ox-i18n> </label>\n <select\n id=\"series-line-tension\"\n class=\"select-content\"\n value-key=\"series.lineTension\"\n .value=${String(configurer.series.lineTension || 0)}\n >\n <option value=\"0.4\">Smooth</option>\n <option value=\"0\">Angled</option>\n </select>\n `\n : html``}\n ${configurer.series.type === 'line'\n ? html`\n <label for=\"series-border-width\"> <ox-i18n msgid=\"label.border-width\">Border Width</ox-i18n> </label>\n <input\n id=\"series-border-width\"\n type=\"number\"\n value-key=\"series.borderWidth\"\n .value=${String(configurer.series.borderWidth || 0)}\n />\n `\n : html``}\n\n <label for=\"series-color\"> <ox-i18n msgid=\"label.color\">Color</ox-i18n> </label>\n <ox-input-color id=\"series-color\" value-key=\"color\" .value=${configurer.color}></ox-input-color>\n\n ${configurer.series.type === 'line'\n ? html`\n <label for=\"series-point-style\"> <ox-i18n msgid=\"label.point-shape\">Point Shape</ox-i18n> </label>\n <select\n id=\"series-point-style\"\n class=\"select-content\"\n value-key=\"series.pointStyle\"\n .value=${configurer.series.pointStyle || ''}\n >\n <option value=\"\"> </option>\n <option value=\"circle\">⚬</option>\n <option value=\"triangle\">▵</option>\n <option value=\"rect\">□</option>\n <option value=\"rectRot\">◇</option>\n <option value=\"cross\">+</option>\n <option value=\"crossRot\">⨉</option>\n <option value=\"star\">✱</option>\n <option value=\"line\">―</option>\n <option value=\"dash\">┄</option>\n </select>\n\n <label for=\"series-point-radius\"> <ox-i18n msgid=\"label.point-size\">Point Size</ox-i18n> </label>\n <input\n id=\"series-point-radius\"\n type=\"number\"\n value-key=\"series.pointRadius\"\n .value=${String(configurer.series.pointRadius || 0)}\n />\n `\n : html``}\n\n <label for=\"series-stack\"> <ox-i18n msgid=\"label.stack-group\">Stack group</ox-i18n> </label>\n <input id=\"series-stack\" type=\"text\" value-key=\"series.stack\" .value=${configurer.series.stack || ''} />\n\n ${configurer.series.type === 'line'\n ? html`\n <input id=\"series-fill\" type=\"checkbox\" value-key=\"series.fill\" ?checked=${configurer.series.fill} />\n <label for=\"series-fill\"> <ox-i18n msgid=\"label.fill\">Fill</ox-i18n> </label>\n `\n : html``}\n ${configurer.multiAxis && configurer.series.type !== 'horizontalBar'\n ? html`\n <label for=\"series-y-axis-id\"> <ox-i18n msgid=\"label.target-axis\">Target Axis</ox-i18n> </label>\n <select\n id=\"series-y-axis-id\"\n class=\"select-content\"\n value-key=\"series.yAxisID\"\n .value=${configurer.series.yAxisID || ''}\n >\n <option value=\"left\">Left</option>\n <option value=\"right\">Right</option>\n </select>\n `\n : html``}\n\n <label></label>\n <ox-chart-display-value .configurer=${configurer} fullwidth></ox-chart-display-value>\n </div>\n `\n }\n\n _getSeriesModel({\n chartType,\n datasetsLength,\n lastSeriesColor\n }: {\n chartType: string\n datasetsLength: number\n lastSeriesColor: TinyColor\n }) {\n const addSeriesOption: any = {\n label: `series ${datasetsLength + 1}`,\n data: [],\n borderWidth: 1,\n dataKey: '',\n yAxisID: 'left',\n color: randomColor({\n hue: lastSeriesColor.toHsv().h\n }).toRgbString(),\n stack: ''\n }\n\n addSeriesOption.type = addSeriesOption.chartType = chartType\n return addSeriesOption\n }\n\n private _selectTab(index: number) {\n this.configurer.setCurrentSeriesIndex(index)\n this.requestUpdate()\n }\n\n private _removeSeries(index: number) {\n this.configurer.removeSeries(index)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _addSeries() {\n const configurer = this.configurer\n\n if (!configurer.config.data.datasets) {\n return\n }\n\n const lastSeriesIndex = configurer.config.data.datasets.length\n const chartType = configurer.series.type || configurer.config.type\n const color = configurer.datasets[lastSeriesIndex - 1]?.backgroundColor\n const lastSeriesColor = new TinyColor(Array.isArray(color) ? color[0] : color)\n\n const seriesModel = this._getSeriesModel({\n chartType: chartType!,\n datasetsLength: lastSeriesIndex,\n lastSeriesColor\n })\n\n this.configurer.addSeries(seriesModel)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.requestUpdate()\n }\n\n private _onWheelScroll(event: WheelEvent) {\n const tabContainer = this.seriesTabs\n if (tabContainer) {\n event.preventDefault()\n\n tabContainer.scrollLeft += event.deltaY\n\n this._onTabScroll()\n }\n }\n\n private _scrollLeft() {\n this._scrollTabContainer(-1)\n }\n\n private _scrollRight() {\n this._scrollTabContainer(1)\n }\n\n private _scrollTabContainer(direction: number) {\n const tabContainer = this.renderRoot!.querySelector<HTMLElement>('#series-tabs')\n if (tabContainer) {\n tabContainer.style.scrollBehavior = 'smooth'\n tabContainer.scrollLeft += direction * tabContainer.clientWidth\n }\n\n setTimeout(() => {\n tabContainer!.style.scrollBehavior = 'auto'\n this._onTabScroll()\n }, 300)\n }\n\n private _onTabScroll() {\n let tabContainer: HTMLElement | null | undefined\n let tabNavLeftButton: MdIcon\n let tabNavRightButton: MdIcon\n\n tabContainer = this.seriesTabs\n tabNavLeftButton = this.seriesTabNavLeftButton\n tabNavRightButton = this.seriesTabNavRightButton\n\n if (!tabContainer) {\n return\n }\n\n if (tabContainer.clientWidth == tabContainer.scrollWidth) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.setAttribute('disabled', '')\n } else if (tabContainer.scrollLeft <= 0) {\n tabNavLeftButton.setAttribute('disabled', '')\n tabNavRightButton.removeAttribute('disabled')\n } else if (tabContainer.scrollLeft + tabContainer.clientWidth >= tabContainer.scrollWidth) {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.setAttribute('disabled', '')\n } else {\n tabNavLeftButton.removeAttribute('disabled')\n tabNavRightButton.removeAttribute('disabled')\n }\n }\n}\n"]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './editors/index.js';
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,cAAc,oBAAoB,CAAA","sourcesContent":["/* never export ox-chart-js.js and ox-scichart.js to prevent chart.js version conflict */\nexport * from './editors/index.js'\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import type { OperatoChart } from '../../types/types.d.ts';
|
|
2
3
|
declare global {
|
|
3
4
|
interface Window {
|
|
4
5
|
sciChartLoaded: boolean;
|
|
@@ -17,7 +18,7 @@ declare class OxSciChart extends LitElement {
|
|
|
17
18
|
firstUpdated(): void;
|
|
18
19
|
loadSciChart(): Promise<void>;
|
|
19
20
|
initializeSciChart(): Promise<void>;
|
|
20
|
-
updated(changedProperties:
|
|
21
|
+
updated(changedProperties: PropertyValues<this>): Promise<void>;
|
|
21
22
|
appendData(appendum: {
|
|
22
23
|
[attr: string]: any;
|
|
23
24
|
}[]): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, html, css } from 'lit';
|
|
3
3
|
import { property, query, customElement } from 'lit/decorators.js';
|
|
4
|
-
import { buildSciChart } from './scichart-builder';
|
|
4
|
+
import { buildSciChart } from './scichart-builder.js';
|
|
5
5
|
let OxSciChart = class OxSciChart extends LitElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-scichart.js","sourceRoot":"","sources":["../../../src/scichart/ox-scichart.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"ox-scichart.js","sourceRoot":"","sources":["../../../src/scichart/ox-scichart.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EA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C5D,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,sDAAsD,CAAA;IACnE,CAAC;;AAlI2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAA+C;AAC/C;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wCAAqC;AAKvC;IAAvB,KAAK,CAAC,eAAe,CAAC;6CAA2B;AAP9C,UAAU;IADf,aAAa,CAAC,aAAa,CAAC;GACvB,UAAU,CAoIf","sourcesContent":["import { LitElement, html, css, PropertyValues } from 'lit'\nimport { property, query, customElement } from 'lit/decorators.js'\nimport { buildSciChart } from './scichart-builder.js'\nimport type { OperatoChart } from '../../types/types.d.ts'\n\ndeclare global {\n interface Window {\n sciChartLoaded: boolean\n sciChartLoadingPromise: Promise<void>\n }\n}\n\n@customElement('ox-scichart')\nclass OxSciChart extends LitElement {\n @property({ type: Object }) config: OperatoChart.ChartConfig | null = null\n @property({ type: Array }) data: { [attr: string]: any }[] = []\n\n private chart: any = null\n private dataSeries: any[] = []\n\n @query('div#container') container!: HTMLDivElement\n\n static styles = css`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .chart-container {\n display: flex;\n width: 100%;\n height: 100%;\n }\n\n .chart-content {\n flex: 1;\n position: relative;\n }\n `\n\n firstUpdated() {\n this.loadSciChart()\n }\n\n async loadSciChart() {\n if (!window.sciChartLoaded) {\n if (!window.sciChartLoadingPromise) {\n window.sciChartLoadingPromise = new Promise<void>(resolve => {\n const script = document.createElement('script')\n script.src = 'https://cdn.jsdelivr.net/npm/scichart/index.min.js'\n script.crossOrigin = 'anonymous'\n script.onload = () => {\n window.sciChartLoaded = true\n\n SciChart.SciChartSurface.UseCommunityLicense()\n\n resolve()\n }\n document.head.appendChild(script)\n })\n }\n\n await window.sciChartLoadingPromise\n }\n\n this.initializeSciChart()\n }\n\n async initializeSciChart() {\n const { chart, dataSeries } = (await buildSciChart(this.config, this.container, {})) || {}\n\n this.chart = chart\n this.dataSeries = dataSeries!\n\n this.updateDataSeries()\n }\n\n async updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has('config') && this.config) {\n await this.initializeSciChart()\n }\n\n if (changedProperties.has('data')) {\n this.updateDataSeries()\n this.chart?.sciChartSurface.zoomExtents()\n }\n }\n\n async appendData(appendum: { [attr: string]: any }[]) {}\n\n updateDataSeries() {\n if (!this.dataSeries?.length) return\n\n this.dataSeries.forEach(ds => ds.clear())\n const newData = this.dataSet\n\n newData.forEach((data, index) => {\n const filteredData = data.filter(d => typeof d.yValue === 'number')\n\n if (filteredData.length > 0) {\n this.dataSeries[index].appendRange(\n filteredData.map(d => d.xValue),\n filteredData.map(d => d.yValue)\n )\n }\n })\n\n this.chart?.sciChartSurface.zoomExtents()\n this.chart?.sciChartSurface.invalidateElement()\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 return html` <div id=\"container\" class=\"chart-container\"></div> `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-scichart': OxSciChart\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scichart-builder.js","sourceRoot":"","sources":["../../../src/scichart/scichart-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,SAAS,qBAAqB,CAAC,KAAiC;IAC9D,OAAO,IAAI,SAAS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;oBACF,MAAK;gBACP;oBACE,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;oBAC1D,MAAK;YACT,CAAC;YACD,IAAI,aAAa,EAAE,CAAC;gBAClB,eAAe,CAAC,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YAChD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAA;YAC3D,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,kBAAkB;IAClB,eAAe,CAAC,cAAc,CAAC,GAAG;IAChC,kCAAkC;IAClC,IAAI,eAAe,EAAE,EACrB,IAAI,sBAAsB,EAAE,EAC5B,IAAI,mBAAmB,EAAE,EACzB,IAAI,iBAAiB,EAAE,EACvB,IAAI,iBAAiB,EAAE,CACxB,CAAA;IAED,YAAY;IACZ,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC;YACxC,cAAc,EAAE,IAAI;YACpB,iBAAiB,EAAE,IAAI;YACvB,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,MAAM,CAAC,QAAQ,IAAI,cAAc;SAC7C,CAAC,CAAA;QACF,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IACpD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAC/C,CAAC","sourcesContent":["import { TinyColor } from '@ctrl/tinycolor'\nimport { format as formatText } from '@operato/utils/format.js'\n\nfunction getBaseColorFromTheme(theme?: 'light' | 'dark' | 'auto') {\n return new TinyColor(theme == 'dark' ? '#fff' : '#000')\n}\n\nfunction getThemeFromBrowser() {\n return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n}\n\nfunction convertColor(color: string | string[] | undefined, defaultColor?: string) {\n const tinyColor = new TinyColor(color as string)\n return tinyColor.toHex8String() || defaultColor\n}\n\nfunction getLocalTimeOffset() {\n const now = new Date()\n return now.getTimezoneOffset() * -60\n}\n\nfunction calculatePrecision(stepSize: number = 1) {\n // stepSize를 문자열로 변환한 다음, 소수점 이후 자릿수를 계산\n const stepSizeString = stepSize.toString()\n\n // 소수점이 있는 경우, 소수점 이후 자릿수 계산\n if (stepSizeString.indexOf('.') !== -1) {\n return stepSizeString.split('.')[1].length\n }\n\n // 소수점이 없는 경우, precision은 0\n return 0\n}\n\nexport async function buildSciChart(\n config: OperatoChart.ChartConfig | undefined | null,\n container: any,\n { fontSize = 14, fontFamily = 'Roboto', fontColor }: { fontSize?: number; fontFamily?: string; fontColor?: string }\n): Promise<{ chart: any; dataSeries: any[] } | undefined> {\n if (!config) {\n return\n }\n\n const {\n SciChartSurface,\n SciChartJSLightTheme,\n SciChartJSDarkv2Theme,\n XyDataSeries,\n FastLineRenderableSeries,\n SplineLineRenderableSeries,\n FastColumnRenderableSeries,\n StackedColumnRenderableSeries,\n StackedMountainRenderableSeries,\n StackedColumnCollection,\n StackedMountainCollection,\n NumericAxis,\n DateTimeNumericAxis,\n ENumericFormat,\n EAutoRange,\n EAxisAlignment,\n ECoordinateMode,\n EHorizontalAnchorPoint,\n EVerticalAnchorPoint,\n NumberRange,\n MouseWheelZoomModifier,\n RubberBandXyZoomModifier,\n ZoomPanModifier,\n ZoomExtentsModifier,\n RolloverModifier,\n SmartDateLabelProvider,\n NumericLabelProvider,\n EllipsePointMarker,\n SquarePointMarker,\n TrianglePointMarker,\n CrossPointMarker,\n XPointMarker,\n WaveAnimation,\n LegendModifier,\n XAxisDragModifier,\n YAxisDragModifier,\n TextAnnotation,\n LineAnnotation,\n BoxAnnotation,\n HorizontalLineAnnotation,\n VerticalLineAnnotation\n } = SciChart\n\n class LocalTimeLabelProvider extends SmartDateLabelProvider {\n formatLabel(value: number): string {\n const date = new Date(value)\n\n try {\n const formatter = new Intl.DateTimeFormat(navigator.language || 'en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n })\n\n return formatter.format(date)\n } catch (e) {\n console.warn('Invalid locale or options provided, falling back to default.', e)\n\n const fallbackFormatter = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n })\n\n return fallbackFormatter.format(date)\n }\n }\n }\n\n const { type: chartType, options, data: fromData } = config\n const { datasets = [] } = fromData || {}\n var {\n theme,\n tooltip = true,\n animation = true,\n legend = {\n display: true,\n position: 'top'\n },\n scales: fromScales,\n xGridLine = true,\n yGridLine = true,\n y2ndGridLine = false,\n stacked = false,\n multiAxis = false,\n annotations = []\n } = options || {}\n\n var baseColor = getBaseColorFromTheme(theme)\n\n if (theme === 'auto') {\n theme = getThemeFromBrowser()\n }\n\n fontColor = fontColor || baseColor.clone().toString()\n\n const { xAxes = [], yAxes = [] } = fromScales || {}\n\n const chart = await SciChartSurface.create(container, {\n theme: theme == 'dark' ? new SciChartJSDarkv2Theme() : new SciChartJSLightTheme()\n })\n const { sciChartSurface, wasmContext } = chart\n\n // X 축 설정\n xAxes.forEach((axis, index) => {\n const { axisTitle, ticks } = axis\n const {\n autoMax,\n autoMin,\n min,\n max,\n stepSize,\n beginAtZero,\n color = fontColor,\n textStrokeColor = fontColor,\n display = !!axisTitle\n } = ticks || {}\n\n const labelProvider = new SmartDateLabelProvider({\n showWiderDateOnFirstLabel: true,\n showYearOnWiderDate: true,\n dateOffset: getLocalTimeOffset()\n })\n\n labelProvider.cursorNumericFormat = ENumericFormat.Date_MMHHSS\n\n const xAxis = new DateTimeNumericAxis(wasmContext, {\n axisTitle,\n autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,\n axisAlignment: EAxisAlignment.Bottom,\n visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,\n majorDelta: stepSize,\n growBy: beginAtZero ? new NumberRange(0.1, 0.1) : undefined,\n labelStyle: {\n fontFamily,\n fontSize,\n color\n },\n axisTitleStyle: {\n fontFamily,\n fontSize,\n color: textStrokeColor\n },\n labelProvider\n })\n\n sciChartSurface.xAxes.add(xAxis)\n })\n\n // Y 축 설정\n ;(multiAxis ? yAxes : [yAxes[0]]).forEach((axis, index) => {\n const { axisTitle, ticks } = axis\n const { autoMax, autoMin, min, max, stepSize, beginAtZero, display } = ticks || {}\n\n const labelProvider = display ? new NumericLabelProvider() : undefined\n\n if (labelProvider) {\n labelProvider.numericFormat = ENumericFormat.Decimal\n labelProvider.precision = calculatePrecision(stepSize || 0.1)\n labelProvider.cursorNumericFormat = ENumericFormat.NoFormat\n }\n\n const yAxis = new NumericAxis(wasmContext, {\n id: index == 0 ? undefined : `yAxis${index}`,\n axisTitle,\n autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,\n axisAlignment: index === 0 ? EAxisAlignment.Left : EAxisAlignment.Right,\n visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,\n majorDelta: stepSize || 0.1,\n minorDelta: (stepSize || 1) * 0.1,\n growBy: beginAtZero ? new NumberRange(0.1, 0.1) : undefined,\n labelStyle: {\n display: !!display,\n fontFamily,\n fontSize,\n color: fontColor\n },\n axisTitleStyle: {\n fontFamily,\n fontSize,\n color: fontColor\n },\n labelProvider\n })\n\n sciChartSurface.yAxes.add(yAxis)\n })\n\n // 시리즈 설정\n const dataSeriesArray = datasets.map((dataset, index) => {\n const dataSeries = new XyDataSeries(wasmContext, {\n dataSeriesName: dataset.label,\n containsNaN: false\n })\n\n const yAxisId = dataset.yAxisID == 'right' && multiAxis ? 'yAxis1' : undefined\n const stackGroupId = dataset.stack || `__stack${index}__`\n\n let series: any\n if (dataset.type === 'bar') {\n if (stacked) {\n series = new StackedColumnRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n fill: convertColor(dataset.backgroundColor, '#FF6600'),\n yAxisId,\n stackedGroupId: stackGroupId\n })\n } else {\n series = new FastColumnRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.backgroundColor, '#FF6600'),\n animation: animation && new WaveAnimation({ duration: 1000, fadeEffect: true }),\n yAxisId\n })\n }\n } else {\n const { pointStyle, pointRadius = 10, lineTension } = dataset\n let pointMarker = null // 초기값을 null로 설정\n\n if (pointStyle) {\n switch (pointStyle) {\n case 'circle':\n pointMarker = new EllipsePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'triangle':\n pointMarker = new TrianglePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'rect':\n pointMarker = new SquarePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'cross':\n pointMarker = new CrossPointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'crossRot':\n pointMarker = new XPointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n default:\n pointMarker = new EllipsePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n }\n }\n\n if (stacked) {\n series = new StackedMountainRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.color, '#FF6600'),\n fill: dataset.backgroundColor || '#FF6600',\n yAxisId,\n stackedGroupId: stackGroupId\n })\n } else {\n series =\n !!lineTension && lineTension > 0\n ? new SplineLineRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.color, '#FF6600'),\n pointMarker,\n animation: animation && new WaveAnimation({ duration: 1000, fadeEffect: true }),\n yAxisId\n })\n : new FastLineRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.color, '#FF6600'),\n pointMarker,\n animation: animation && new WaveAnimation({ duration: 1000, fadeEffect: true }),\n yAxisId\n })\n }\n }\n\n sciChartSurface.renderableSeries.add(series)\n\n if (tooltip) {\n const rolloverModifier = new RolloverModifier({\n showTooltip: true,\n showAxisLabel: false /* 한글의 크기를 잘 계산하지 못하므로 false */,\n tooltipColor: 'white',\n tooltipBackgroundColor: 'rgba(0, 0, 0, 0.7)',\n rollOverDataSeries: dataSeries\n })\n\n sciChartSurface.chartModifiers.add(rolloverModifier)\n }\n\n return dataSeries\n })\n\n // Stacked collections 추가\n if (stacked) {\n const stackedColumnCollection = new StackedColumnCollection(wasmContext)\n const stackedMountainCollection = new StackedMountainCollection(wasmContext)\n\n sciChartSurface.renderableSeries.asArray().forEach((series: any) => {\n if (series instanceof StackedColumnRenderableSeries) {\n stackedColumnCollection.add(series)\n } else if (series instanceof StackedMountainRenderableSeries) {\n stackedMountainCollection.add(series)\n }\n })\n\n if (stackedColumnCollection.size() > 0) {\n sciChartSurface.renderableSeries.add(stackedColumnCollection)\n }\n\n if (stackedMountainCollection.size() > 0) {\n sciChartSurface.renderableSeries.add(stackedMountainCollection)\n }\n }\n\n if (annotations) {\n annotations.forEach(annotation => {\n let sciAnnotation\n let horizontalAnchorPoint =\n annotation.horizontalAnchorPoint == 'Right'\n ? EHorizontalAnchorPoint.Right\n : annotation.horizontalAnchorPoint == 'Left'\n ? EHorizontalAnchorPoint.Left\n : EHorizontalAnchorPoint.Center\n let verticalAnchorPoint =\n annotation.verticalAnchorPoint == 'Top'\n ? EVerticalAnchorPoint.Top\n : annotation.verticalAnchorPoint == 'Bottom'\n ? EVerticalAnchorPoint.Bottom\n : EVerticalAnchorPoint.Center\n\n switch (annotation.type) {\n case 'text':\n sciAnnotation = new TextAnnotation({\n x1: annotation.x1,\n y1: annotation.y1,\n text: annotation.text,\n horizontalAnchorPoint,\n verticalAnchorPoint,\n fontSize: annotation.fontSize,\n fontFamily: annotation.fontFamily,\n textColor: convertColor(annotation.stroke, fontColor),\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'line':\n sciAnnotation = new LineAnnotation({\n x1: annotation.x1,\n y1: annotation.y1,\n x2: annotation.x2,\n y2: annotation.y2,\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'box':\n sciAnnotation = new BoxAnnotation({\n x1: annotation.x1,\n y1: annotation.y1,\n x2: annotation.x2,\n y2: annotation.y2,\n fill: convertColor(annotation.fill, '#FF0000'),\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'horizontalLine':\n sciAnnotation = new HorizontalLineAnnotation({\n y1: annotation.y1,\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'verticalLine':\n sciAnnotation = new VerticalLineAnnotation({\n x1: annotation.x1,\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n default:\n console.error('Unknown annotation type:', annotation.type)\n break\n }\n if (sciAnnotation) {\n sciChartSurface.annotations.add(sciAnnotation)\n } else {\n console.error('Failed to create annotation:', annotation)\n }\n })\n }\n\n // 줌인/줌아웃 모디파이어 추가\n sciChartSurface.chartModifiers.add(\n // new RubberBandXyZoomModifier(),\n new ZoomPanModifier(),\n new MouseWheelZoomModifier(),\n new ZoomExtentsModifier(),\n new XAxisDragModifier(),\n new YAxisDragModifier()\n )\n\n // Legend 설정\n if (legend?.display) {\n const legendModifier = new LegendModifier({\n showCheckboxes: true,\n showSeriesMarkers: true,\n showLegend: true,\n placement: legend.position || 'bottom-right'\n })\n sciChartSurface.chartModifiers.add(legendModifier)\n }\n\n return { chart, dataSeries: dataSeriesArray }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scichart-builder.js","sourceRoot":"","sources":["../../../src/scichart/scichart-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,SAAS,qBAAqB,CAAC,KAAiC;IAC9D,OAAO,IAAI,SAAS,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AACzD,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;AAC1G,CAAC;AAED,SAAS,YAAY,CAAC,KAAoC,EAAE,YAAqB;IAC/E,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,KAAe,CAAC,CAAA;IAChD,OAAO,SAAS,CAAC,YAAY,EAAE,IAAI,YAAY,CAAA;AACjD,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,GAAG,GAAG,IAAI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B,IAAI,iBAAiB,EAAE,EACvB,IAAI,iBAAiB,EAAE,CACxB,CAAA;IAED,YAAY;IACZ,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC;YACxC,cAAc,EAAE,IAAI;YACpB,iBAAiB,EAAE,IAAI;YACvB,UAAU,EAAE,IAAI;YAChB,SAAS,EAAE,MAAM,CAAC,QAAQ,IAAI,cAAc;SAC7C,CAAC,CAAA;QACF,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IACpD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAC/C,CAAC","sourcesContent":["import { TinyColor } from '@ctrl/tinycolor'\nimport type { OperatoChart } from '../../types/types.d.ts'\n\nfunction getBaseColorFromTheme(theme?: 'light' | 'dark' | 'auto') {\n return new TinyColor(theme == 'dark' ? '#fff' : '#000')\n}\n\nfunction getThemeFromBrowser() {\n return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n}\n\nfunction convertColor(color: string | string[] | undefined, defaultColor?: string) {\n const tinyColor = new TinyColor(color as string)\n return tinyColor.toHex8String() || defaultColor\n}\n\nfunction getLocalTimeOffset() {\n const now = new Date()\n return now.getTimezoneOffset() * -60\n}\n\nfunction calculatePrecision(stepSize: number = 1) {\n // stepSize를 문자열로 변환한 다음, 소수점 이후 자릿수를 계산\n const stepSizeString = stepSize.toString()\n\n // 소수점이 있는 경우, 소수점 이후 자릿수 계산\n if (stepSizeString.indexOf('.') !== -1) {\n return stepSizeString.split('.')[1].length\n }\n\n // 소수점이 없는 경우, precision은 0\n return 0\n}\n\nexport async function buildSciChart(\n config: OperatoChart.ChartConfig | undefined | null,\n container: any,\n { fontSize = 14, fontFamily = 'Roboto', fontColor }: { fontSize?: number; fontFamily?: string; fontColor?: string }\n): Promise<{ chart: any; dataSeries: any[] } | undefined> {\n if (!config) {\n return\n }\n\n const {\n SciChartSurface,\n SciChartJSLightTheme,\n SciChartJSDarkv2Theme,\n XyDataSeries,\n FastLineRenderableSeries,\n SplineLineRenderableSeries,\n FastColumnRenderableSeries,\n StackedColumnRenderableSeries,\n StackedMountainRenderableSeries,\n StackedColumnCollection,\n StackedMountainCollection,\n NumericAxis,\n DateTimeNumericAxis,\n ENumericFormat,\n EAutoRange,\n EAxisAlignment,\n ECoordinateMode,\n EHorizontalAnchorPoint,\n EVerticalAnchorPoint,\n NumberRange,\n MouseWheelZoomModifier,\n RubberBandXyZoomModifier,\n ZoomPanModifier,\n ZoomExtentsModifier,\n RolloverModifier,\n SmartDateLabelProvider,\n NumericLabelProvider,\n EllipsePointMarker,\n SquarePointMarker,\n TrianglePointMarker,\n CrossPointMarker,\n XPointMarker,\n WaveAnimation,\n LegendModifier,\n XAxisDragModifier,\n YAxisDragModifier,\n TextAnnotation,\n LineAnnotation,\n BoxAnnotation,\n HorizontalLineAnnotation,\n VerticalLineAnnotation\n } = SciChart\n\n class LocalTimeLabelProvider extends SmartDateLabelProvider {\n formatLabel(value: number): string {\n const date = new Date(value)\n\n try {\n const formatter = new Intl.DateTimeFormat(navigator.language || 'en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n })\n\n return formatter.format(date)\n } catch (e) {\n console.warn('Invalid locale or options provided, falling back to default.', e)\n\n const fallbackFormatter = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n })\n\n return fallbackFormatter.format(date)\n }\n }\n }\n\n const { type: chartType, options, data: fromData } = config\n const { datasets = [] } = fromData || {}\n var {\n theme,\n tooltip = true,\n animation = true,\n legend = {\n display: true,\n position: 'top'\n },\n scales: fromScales,\n xGridLine = true,\n yGridLine = true,\n y2ndGridLine = false,\n stacked = false,\n multiAxis = false,\n annotations = []\n } = options || {}\n\n var baseColor = getBaseColorFromTheme(theme)\n\n if (theme === 'auto') {\n theme = getThemeFromBrowser()\n }\n\n fontColor = fontColor || baseColor.clone().toString()\n\n const { xAxes = [], yAxes = [] } = fromScales || {}\n\n const chart = await SciChartSurface.create(container, {\n theme: theme == 'dark' ? new SciChartJSDarkv2Theme() : new SciChartJSLightTheme()\n })\n const { sciChartSurface, wasmContext } = chart\n\n // X 축 설정\n xAxes.forEach((axis, index) => {\n const { axisTitle, ticks } = axis\n const {\n autoMax,\n autoMin,\n min,\n max,\n stepSize,\n beginAtZero,\n color = fontColor,\n textStrokeColor = fontColor,\n display = !!axisTitle\n } = ticks || {}\n\n const labelProvider = new SmartDateLabelProvider({\n showWiderDateOnFirstLabel: true,\n showYearOnWiderDate: true,\n dateOffset: getLocalTimeOffset()\n })\n\n labelProvider.cursorNumericFormat = ENumericFormat.Date_MMHHSS\n\n const xAxis = new DateTimeNumericAxis(wasmContext, {\n axisTitle,\n autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,\n axisAlignment: EAxisAlignment.Bottom,\n visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,\n majorDelta: stepSize,\n growBy: beginAtZero ? new NumberRange(0.1, 0.1) : undefined,\n labelStyle: {\n fontFamily,\n fontSize,\n color\n },\n axisTitleStyle: {\n fontFamily,\n fontSize,\n color: textStrokeColor\n },\n labelProvider\n })\n\n sciChartSurface.xAxes.add(xAxis)\n })\n\n // Y 축 설정\n ;(multiAxis ? yAxes : [yAxes[0]]).forEach((axis, index) => {\n const { axisTitle, ticks } = axis\n const { autoMax, autoMin, min, max, stepSize, beginAtZero, display } = ticks || {}\n\n const labelProvider = display ? new NumericLabelProvider() : undefined\n\n if (labelProvider) {\n labelProvider.numericFormat = ENumericFormat.Decimal\n labelProvider.precision = calculatePrecision(stepSize || 0.1)\n labelProvider.cursorNumericFormat = ENumericFormat.NoFormat\n }\n\n const yAxis = new NumericAxis(wasmContext, {\n id: index == 0 ? undefined : `yAxis${index}`,\n axisTitle,\n autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,\n axisAlignment: index === 0 ? EAxisAlignment.Left : EAxisAlignment.Right,\n visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,\n majorDelta: stepSize || 0.1,\n minorDelta: (stepSize || 1) * 0.1,\n growBy: beginAtZero ? new NumberRange(0.1, 0.1) : undefined,\n labelStyle: {\n display: !!display,\n fontFamily,\n fontSize,\n color: fontColor\n },\n axisTitleStyle: {\n fontFamily,\n fontSize,\n color: fontColor\n },\n labelProvider\n })\n\n sciChartSurface.yAxes.add(yAxis)\n })\n\n // 시리즈 설정\n const dataSeriesArray = datasets.map((dataset, index) => {\n const dataSeries = new XyDataSeries(wasmContext, {\n dataSeriesName: dataset.label,\n containsNaN: false\n })\n\n const yAxisId = dataset.yAxisID == 'right' && multiAxis ? 'yAxis1' : undefined\n const stackGroupId = dataset.stack || `__stack${index}__`\n\n let series: any\n if (dataset.type === 'bar') {\n if (stacked) {\n series = new StackedColumnRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n fill: convertColor(dataset.backgroundColor, '#FF6600'),\n yAxisId,\n stackedGroupId: stackGroupId\n })\n } else {\n series = new FastColumnRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.backgroundColor, '#FF6600'),\n animation: animation && new WaveAnimation({ duration: 1000, fadeEffect: true }),\n yAxisId\n })\n }\n } else {\n const { pointStyle, pointRadius = 10, lineTension } = dataset\n let pointMarker = null // 초기값을 null로 설정\n\n if (pointStyle) {\n switch (pointStyle) {\n case 'circle':\n pointMarker = new EllipsePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'triangle':\n pointMarker = new TrianglePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'rect':\n pointMarker = new SquarePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'cross':\n pointMarker = new CrossPointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n case 'crossRot':\n pointMarker = new XPointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n break\n default:\n pointMarker = new EllipsePointMarker(wasmContext, {\n width: pointRadius,\n height: pointRadius,\n strokeThickness: 2,\n fill: convertColor(dataset.color, '#FF6600'),\n stroke: '#000000'\n })\n }\n }\n\n if (stacked) {\n series = new StackedMountainRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.color, '#FF6600'),\n fill: dataset.backgroundColor || '#FF6600',\n yAxisId,\n stackedGroupId: stackGroupId\n })\n } else {\n series =\n !!lineTension && lineTension > 0\n ? new SplineLineRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.color, '#FF6600'),\n pointMarker,\n animation: animation && new WaveAnimation({ duration: 1000, fadeEffect: true }),\n yAxisId\n })\n : new FastLineRenderableSeries(wasmContext, {\n dataSeries,\n strokeThickness: dataset.borderWidth || 2,\n stroke: convertColor(dataset.color, '#FF6600'),\n pointMarker,\n animation: animation && new WaveAnimation({ duration: 1000, fadeEffect: true }),\n yAxisId\n })\n }\n }\n\n sciChartSurface.renderableSeries.add(series)\n\n if (tooltip) {\n const rolloverModifier = new RolloverModifier({\n showTooltip: true,\n showAxisLabel: false /* 한글의 크기를 잘 계산하지 못하므로 false */,\n tooltipColor: 'white',\n tooltipBackgroundColor: 'rgba(0, 0, 0, 0.7)',\n rollOverDataSeries: dataSeries\n })\n\n sciChartSurface.chartModifiers.add(rolloverModifier)\n }\n\n return dataSeries\n })\n\n // Stacked collections 추가\n if (stacked) {\n const stackedColumnCollection = new StackedColumnCollection(wasmContext)\n const stackedMountainCollection = new StackedMountainCollection(wasmContext)\n\n sciChartSurface.renderableSeries.asArray().forEach((series: any) => {\n if (series instanceof StackedColumnRenderableSeries) {\n stackedColumnCollection.add(series)\n } else if (series instanceof StackedMountainRenderableSeries) {\n stackedMountainCollection.add(series)\n }\n })\n\n if (stackedColumnCollection.size() > 0) {\n sciChartSurface.renderableSeries.add(stackedColumnCollection)\n }\n\n if (stackedMountainCollection.size() > 0) {\n sciChartSurface.renderableSeries.add(stackedMountainCollection)\n }\n }\n\n if (annotations) {\n annotations.forEach(annotation => {\n let sciAnnotation\n let horizontalAnchorPoint =\n annotation.horizontalAnchorPoint == 'Right'\n ? EHorizontalAnchorPoint.Right\n : annotation.horizontalAnchorPoint == 'Left'\n ? EHorizontalAnchorPoint.Left\n : EHorizontalAnchorPoint.Center\n let verticalAnchorPoint =\n annotation.verticalAnchorPoint == 'Top'\n ? EVerticalAnchorPoint.Top\n : annotation.verticalAnchorPoint == 'Bottom'\n ? EVerticalAnchorPoint.Bottom\n : EVerticalAnchorPoint.Center\n\n switch (annotation.type) {\n case 'text':\n sciAnnotation = new TextAnnotation({\n x1: annotation.x1,\n y1: annotation.y1,\n text: annotation.text,\n horizontalAnchorPoint,\n verticalAnchorPoint,\n fontSize: annotation.fontSize,\n fontFamily: annotation.fontFamily,\n textColor: convertColor(annotation.stroke, fontColor),\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'line':\n sciAnnotation = new LineAnnotation({\n x1: annotation.x1,\n y1: annotation.y1,\n x2: annotation.x2,\n y2: annotation.y2,\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'box':\n sciAnnotation = new BoxAnnotation({\n x1: annotation.x1,\n y1: annotation.y1,\n x2: annotation.x2,\n y2: annotation.y2,\n fill: convertColor(annotation.fill, '#FF0000'),\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'horizontalLine':\n sciAnnotation = new HorizontalLineAnnotation({\n y1: annotation.y1,\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n case 'verticalLine':\n sciAnnotation = new VerticalLineAnnotation({\n x1: annotation.x1,\n stroke: convertColor(annotation.stroke, '#FF0000'),\n strokeThickness: annotation.strokeThickness,\n xCoordinateMode: annotation.xCoordinateMode || ECoordinateMode.DataValue,\n yCoordinateMode: annotation.yCoordinateMode || ECoordinateMode.DataValue\n })\n break\n default:\n console.error('Unknown annotation type:', annotation.type)\n break\n }\n if (sciAnnotation) {\n sciChartSurface.annotations.add(sciAnnotation)\n } else {\n console.error('Failed to create annotation:', annotation)\n }\n })\n }\n\n // 줌인/줌아웃 모디파이어 추가\n sciChartSurface.chartModifiers.add(\n // new RubberBandXyZoomModifier(),\n new ZoomPanModifier(),\n new MouseWheelZoomModifier(),\n new ZoomExtentsModifier(),\n new XAxisDragModifier(),\n new YAxisDragModifier()\n )\n\n // Legend 설정\n if (legend?.display) {\n const legendModifier = new LegendModifier({\n showCheckboxes: true,\n showSeriesMarkers: true,\n showLegend: true,\n placement: legend.position || 'bottom-right'\n })\n sciChartSurface.chartModifiers.add(legendModifier)\n }\n\n return { chart, dataSeries: dataSeriesArray }\n}\n"]}
|
package/dist/stories/common.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperatoChart } from '../types/types';
|
|
1
2
|
export declare function getDefaultChartConfig(type: OperatoChart.ChartType, datasets?: OperatoChart.Dataset[]): OperatoChart.ChartConfig;
|
|
2
3
|
export declare function getDefaultAxisOptions(): OperatoChart.AxisOptions;
|
|
3
4
|
export declare const data: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../stories/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../stories/common.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CACnC,IAA4B,EAC5B,QAAiC;IAEjC,OAAO;QACL,IAAI,EAAE;YACJ,QAAQ,EAAE,QAAQ,IAAI,EAAE;YACxB,YAAY,EAAE,EAAE;SACjB;QACD,OAAO,EAAE;YACP,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI;YACf,MAAM,EAAE;gBACN,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,KAAK;aAChB;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,CAAC,qBAAqB,EAAE,CAAC;gBAChC,KAAK,EAAE,CAAC,qBAAqB,EAAE,EAAE,qBAAqB,EAAE,CAAC,CAAC,oCAAoC;aAC/F;YACD,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB;QACD,IAAI;KACL,CAAA;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,CAAC;QACb,eAAe,EAAE,CAAC;QAClB,aAAa,EAAE,GAAG;QAClB,KAAK,EAAE;YACL,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E,WAAW;YAClB,OAAO,EAAE,aAAa;SACvB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,mBAAmB;AACnB,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA","sourcesContent":["import type { OperatoChart } from '../types/types'\n\nexport function getDefaultChartConfig(\n type: OperatoChart.ChartType,\n datasets?: OperatoChart.Dataset[]\n): OperatoChart.ChartConfig {\n return {\n data: {\n datasets: datasets || [],\n labelDataKey: ''\n },\n options: {\n theme: 'light',\n tooltip: true,\n animation: true,\n legend: {\n display: true,\n position: 'top'\n },\n scales: {\n xAxes: [getDefaultAxisOptions()],\n yAxes: [getDefaultAxisOptions(), getDefaultAxisOptions()] // Two y-axes for multi-axis support\n },\n stacked: false,\n xGridLine: true,\n yGridLine: true,\n y2ndGridLine: false,\n multiAxis: false\n },\n type\n }\n}\n\nexport function getDefaultAxisOptions(): OperatoChart.AxisOptions {\n return {\n axisTitle: '',\n barSpacing: 0,\n categorySpacing: 0,\n barPercentage: 0.9,\n ticks: {\n display: true,\n autoMin: true,\n autoMax: true,\n min: undefined,\n max: undefined,\n stepSize: undefined\n }\n }\n}\n\n// export const data = [\n// { timestamp: 2010, count: 10, average: 120 },\n// { timestamp: 2011, count: 20, average: 110 },\n// { timestamp: 2012, count: 15, average: 80 },\n// { timestamp: 2013, count: 25, average: 130 },\n// { timestamp: 2014, count: 22, average: 120 },\n// { timestamp: 2015, count: 30, average: 60 },\n// { timestamp: 2016, count: 28, average: 90 }\n// ]\n// 랜덤한 범위의 숫자를 생성하는 함수\nfunction getRandomInRange(i: number, min: number, max: number) {\n if (!(i % 11)) {\n return null\n }\n return Math.floor(Math.random() * (max - min + 1)) + min\n}\n\n// 랜덤 데이터를 생성하는 함수\nfunction generateRandomData(count: number) {\n const randomData = []\n const startTimestamp = Math.floor(Date.now()) // 현재 시간을 Unix 타임스탬프로 설정\n\n for (let i = 0; i < count; i++) {\n const timestamp = startTimestamp + i * 360 * 30 * 1000 // 3초씩 증가하는 타임스탬프 설정\n const randomCount = getRandomInRange(i, 5, 35) // count 값을 5에서 35 사이로 랜덤 생성\n const randomAverage = getRandomInRange(i, 50, 150) // average 값을 50에서 150 사이로 랜덤 생성\n\n randomData.push({\n timestamp: timestamp,\n count: randomCount,\n average: randomAverage\n })\n }\n\n return randomData\n}\n\n// 100개의 랜덤 데이터를 생성\nexport const data = generateRandomData(100)\n"]}
|
|
@@ -2,6 +2,7 @@ import { TemplateResult } from 'lit';
|
|
|
2
2
|
import '../src/editors/ox-input-chart-mixed.js';
|
|
3
3
|
import '../src/chartjs/ox-chart-js.js';
|
|
4
4
|
import '../src/scichart/ox-scichart.js';
|
|
5
|
+
import type { OperatoChart } from '../types/types';
|
|
5
6
|
declare const _default: {
|
|
6
7
|
title: string;
|
|
7
8
|
component: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-input-chart-bar.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-bar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-input-chart-bar.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-bar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGzD,eAAe;IACb,KAAK,EAAE,8BAA8B;IACrC,SAAS,EAAE,sBAAsB;IACjC,QAAQ,E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AE,uBAAuB;oBACpC,WAAW,EAAE,CAAC;oBACd,IAAI,EAAE,KAAK;oBACX,WAAW,EAAE,GAAG;oBAChB,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,CAAC;oBACd,OAAO,EAAE,OAAO;iBACjB;aACF;YACD,YAAY,EAAE,WAAW;SAC1B;KACF;CACF,CAAA","sourcesContent":["import { html, TemplateResult } from 'lit'\n\nimport '../src/editors/ox-input-chart-mixed.js'\nimport '../src/chartjs/ox-chart-js.js'\nimport '../src/scichart/ox-scichart.js'\n\nimport { data, getDefaultChartConfig } from './common.js'\nimport type { OperatoChart } from '../types/types'\n\nexport default {\n title: 'ox-input-chart-mixed for bar',\n component: 'ox-input-chart-mixed',\n argTypes: {\n value: { control: 'object' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n value: OperatoChart.ChartConfig\n}\n\nfunction showCharts(e: Event) {\n const target = e.currentTarget as any\n const config = target.value\n const chartjs = document.querySelector('#chartjs') as HTMLElement\n if (chartjs) {\n ;(chartjs as any).config = { ...config }\n }\n const scichart = document.querySelector('#scichart') as HTMLElement\n if (scichart) {\n ;(scichart as any).config = config\n }\n}\n\nconst Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <style>\n .desc {\n color: var(--md-sys-color-background);\n background-color: var(--md-sys-color-on-background);\n padding: var(--spacing-small);\n }\n\n .container {\n display: flex;\n flex-direction: row;\n overflow-y: auto;\n padding: var(--spacing-medium);\n gap: var(--spacing-medium);\n\n color: var(--md-sys-color-on-background);\n background-color: var(--md-sys-color-background);\n }\n\n #editor {\n width: 300px;\n }\n\n #charts {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium);\n }\n\n #chartjs {\n flex: 1;\n }\n\n #scichart {\n flex: 1;\n }\n </style>\n\n <div class=\"desc\">Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey</div>\n\n <div class=\"container\">\n <ox-input-chart-mixed chart-type=\"bar\" id=\"editor\" .value=${value} @change=${showCharts}></ox-input-chart-mixed>\n <div id=\"charts\">\n <ox-chart-js id=\"chartjs\" .data=${data}></ox-chart-js>\n <ox-scichart id=\"scichart\"></ox-scichart>\n </div>\n </div>\n`\n\nexport const Default = Template.bind({})\nDefault.args = {\n value: {\n ...getDefaultChartConfig('bar')\n }\n}\n\nexport const WithData = Template.bind({})\nWithData.args = {\n value: {\n ...getDefaultChartConfig('bar'),\n data: {\n datasets: [\n {\n label: 'Bar Series',\n type: 'bar',\n dataKey: 'count',\n backgroundColor: 'rgba(255, 99, 132, 0.2)',\n borderColor: 'rgba(255, 99, 132, 1)',\n borderWidth: 1\n },\n {\n label: 'Line Series',\n type: 'line',\n dataKey: 'average',\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 1,\n fill: false,\n lineTension: 0.4,\n pointStyle: 'circle',\n pointRadius: 3\n }\n ],\n labelDataKey: 'timestamp'\n },\n options: {\n scales: {\n xAxes: [{ ticks: { beginAtZero: true } }],\n yAxes: [{ ticks: { beginAtZero: true } }]\n },\n legend: { display: true }\n }\n }\n}\n\nexport const MultiAxis = Template.bind({})\nMultiAxis.args = {\n value: {\n ...getDefaultChartConfig('bar'),\n options: {\n ...getDefaultChartConfig('bar').options,\n multiAxis: true\n },\n data: {\n datasets: [\n {\n label: 'Bar Series',\n type: 'bar',\n dataKey: 'count',\n backgroundColor: 'rgba(255, 99, 132, 0.2)',\n borderColor: 'rgba(255, 99, 132, 1)',\n borderWidth: 1,\n yAxisID: 'left'\n },\n {\n label: 'Line Series',\n type: 'line',\n dataKey: 'average',\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 1,\n fill: false,\n lineTension: 0.4,\n pointStyle: 'circle',\n pointRadius: 3,\n yAxisID: 'right'\n }\n ],\n labelDataKey: 'timestamp'\n }\n }\n}\n"]}
|