@operato/chart 7.0.37 → 7.0.40
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 +20 -0
- package/dist/src/editors/configurer.d.ts +4 -2
- package/dist/src/editors/configurer.js +27 -14
- package/dist/src/editors/configurer.js.map +1 -1
- package/dist/src/editors/input-chart-abstract.d.ts +0 -26
- package/dist/src/editors/input-chart-abstract.js +1 -607
- package/dist/src/editors/input-chart-abstract.js.map +1 -1
- package/dist/src/editors/input-chart-styles.js +27 -0
- package/dist/src/editors/input-chart-styles.js.map +1 -1
- package/dist/src/editors/ox-input-chart-hbar.d.ts +1 -1
- package/dist/src/editors/ox-input-chart-hbar.js +2 -69
- package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-mixed.d.ts +1 -0
- 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 +1 -0
- package/dist/src/editors/ox-input-chart-pie.js +3 -1
- package/dist/src/editors/ox-input-chart-pie.js.map +1 -1
- package/dist/src/editors/ox-input-chart-radar.d.ts +1 -0
- 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 +2 -0
- package/dist/src/editors/ox-input-chart-timeseries.js +9 -3
- package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
- package/dist/src/editors/ox-property-editor-chart.js.map +1 -1
- package/dist/src/editors/templates/annotations.d.ts +23 -0
- package/dist/src/editors/templates/annotations.js +270 -0
- package/dist/src/editors/templates/annotations.js.map +1 -0
- package/dist/src/editors/templates/display-value.d.ts +12 -0
- package/dist/src/editors/templates/display-value.js +105 -0
- package/dist/src/editors/templates/display-value.js.map +1 -0
- package/dist/src/editors/templates/series.d.ts +31 -0
- package/dist/src/editors/templates/series.js +277 -0
- package/dist/src/editors/templates/series.js.map +1 -0
- package/dist/src/scichart/ox-scichart.js +4 -3
- package/dist/src/scichart/ox-scichart.js.map +1 -1
- package/dist/src/scichart/scichart-builder.js +25 -7
- package/dist/src/scichart/scichart-builder.js.map +1 -1
- package/dist/stories/common.d.ts +2 -2
- package/dist/stories/common.js +6 -3
- package/dist/stories/common.js.map +1 -1
- package/dist/stories/ox-input-chart-timeseries.stories.js +2 -2
- package/dist/stories/ox-input-chart-timeseries.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/editors/configurer.ts +28 -15
- package/src/editors/input-chart-abstract.ts +1 -655
- package/src/editors/input-chart-styles.ts +27 -0
- package/src/editors/ox-input-chart-hbar.ts +3 -73
- package/src/editors/ox-input-chart-mixed.ts +2 -2
- package/src/editors/ox-input-chart-pie.ts +3 -2
- package/src/editors/ox-input-chart-radar.ts +3 -2
- package/src/editors/ox-input-chart-timeseries.ts +10 -3
- package/src/editors/ox-property-editor-chart.ts +1 -1
- package/src/editors/templates/annotations.ts +287 -0
- package/src/editors/templates/display-value.ts +110 -0
- package/src/editors/templates/series.ts +304 -0
- package/src/scichart/ox-scichart.ts +7 -3
- package/src/scichart/scichart-builder.ts +30 -6
- package/stories/common.ts +6 -3
- package/stories/ox-input-chart-timeseries.stories.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-input-chart-timeseries.js","sourceRoot":"","sources":["../../../src/editors/ox-input-chart-timeseries.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAGpD,IAAM,sB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,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO;;;WAG/C;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;;;;;iBAKC,GAAG,EAAE;YACV,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAA;QACpD,CAAC;aACE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;;;kCAGlC,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,sBAAsB,EAAE;KACtF,CAAA;IACH,CAAC;IAED,aAAa,CAAC,MAAW;QACvB,IAAI,YAAY,GAAG,KAAK,CAAA;QACxB,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,CAAA;QAEtE,OAAO,YAAY,CAAA;IACrB,CAAC;;AA1OQ;IAAR,KAAK,EAAE;kEAA2B;AArBxB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAgQlC","sourcesContent":["import '@operato/i18n/ox-i18n.js'\n\nimport { html, css } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { InputChartAbstract } from './input-chart-abstract'\n\n@customElement('ox-input-chart-timeseries')\nexport class OxInputChartTimeseries extends InputChartAbstract {\n static styles = [\n ...InputChartAbstract.styles,\n css`\n legend[collapsable] {\n box-sizing: border-box;\n width: 100%;\n }\n\n legend[collapsable] md-icon {\n float: right;\n font-size: medium;\n margin: 0;\n }\n\n div[collapsed] {\n display: none;\n }\n `\n ]\n\n @state() annotationExpanded = false\n\n subTemplate() {\n const configurer = this.configurer\n\n return html`\n <input id=\"multi-axis\" type=\"checkbox\" value-key=\"multiAxis\" ?checked=${configurer.multiAxis} />\n <label for=\"multi-axis\"> <ox-i18n msgid=\"label.multi-axis\">Multi Axis</ox-i18n> </label>\n\n <legend><ox-i18n msgid=\"label.series\">Series</ox-i18n></legend>\n <div fullwidth>${this.multiSeriesTabTemplate()}</div>\n\n <legend><ox-i18n msgid=\"label.x-axes\">X Axes</ox-i18n></legend>\n\n <label for=\"series-data-key\"> <ox-i18n msgid=\"label.data-key\">Data Key</ox-i18n> </label>\n <input id=\"series-data-key\" type=\"text\" value-key=\"labelDataKey\" value=${ifDefined(configurer.labelDataKey)} />\n\n <label for=\"x-axes0-axis-title\"> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input\n id=\"x-axes0-axis-title\"\n type=\"text\"\n value-key=\"xAxes0.axisTitle\"\n value=${ifDefined(configurer.xAxes0.axisTitle)}\n />\n\n ${this._hasBarSeries(configurer.value)\n ? html`\n <label for=\"bar-spacing\"><ox-i18n msgid=\"label.bar-spacing\">Bar Spacing</ox-i18n></label>\n <input\n id=\"bar-spacing\"\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"xAxes0.barSpacing\"\n value=${ifDefined(configurer.xAxes0.barSpacing)}\n />\n <label for=\"tick-spacing\"><ox-i18n msgid=\"label.tick-spacing\">Tick Spacing</ox-i18n></label>\n <input\n id=\"tick-spacing\"\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"xAxes0.categorySpacing\"\n value=${ifDefined(configurer.xAxes0.categorySpacing)}\n />\n `\n : html``}\n\n <input\n id=\"x-grid-line\"\n type=\"checkbox\"\n value-key=\"value.options.xGridLine\"\n ?checked=${configurer.config.options?.xGridLine}\n />\n <label for=\"x-grid-line\"> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input\n id=\"x-axes0-ticks-display\"\n type=\"checkbox\"\n value-key=\"xAxes0.ticks.display\"\n ?checked=${configurer.xAxes0.ticks?.display}\n />\n <label for=\"x-axes0-ticks-display\"> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n\n <legend><ox-i18n msgid=\"label.y-axes\">Y Axes</ox-i18n></legend>\n\n <label for=\"y-axes0-axis-title\"> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input\n id=\"y-axes0-axis-title\"\n type=\"text\"\n value-key=\"yAxes0.axisTitle\"\n value=${configurer.yAxes0.axisTitle || ''}\n />\n\n <input\n id=\"axis-min-auto\"\n type=\"checkbox\"\n value-key=\"yAxes0.ticks.autoMin\"\n ?checked=${configurer.yAxes0.ticks?.autoMin}\n />\n <label for=\"axis-min-auto\"> <ox-i18n msgid=\"label.axis-min-auto\">Min Auto</ox-i18n> </label>\n\n <input\n id=\"axis-max-auto\"\n type=\"checkbox\"\n value-key=\"yAxes0.ticks.autoMax\"\n ?checked=${configurer.yAxes0.ticks?.autoMax}\n />\n <label for=\"axis-max-auto\"> <ox-i18n msgid=\"label.axis-max-auto\">Max Auto</ox-i18n> </label>\n\n ${!configurer.yAxes0.ticks?.autoMin\n ? html`\n <label for=\"y-axes0-ticks-min\"> <ox-i18n msgid=\"label.axis-min\">Min</ox-i18n> </label>\n <input\n id=\"y-axes0-ticks-min\"\n type=\"number\"\n value-key=\"yAxes0.ticks.min\"\n value=${ifDefined(configurer.yAxes0.ticks?.min)}\n />\n `\n : html``}\n ${!configurer.yAxes0.ticks?.autoMax\n ? html`\n <label for=\"y-axes0-ticks-max\"> <ox-i18n msgid=\"label.axis-max\">Max</ox-i18n> </label>\n <input\n id=\"y-axes0-ticks-max\"\n type=\"number\"\n value-key=\"yAxes0.ticks.max\"\n value=${ifDefined(configurer.yAxes0.ticks?.max)}\n />\n `\n : html``}\n\n <label for=\"y-axes0-ticks-step-size\"> <ox-i18n msgid=\"label.axis-step-size\">StepSize</ox-i18n> </label>\n <input\n id=\"y-axes0-ticks-step-size\"\n type=\"number\"\n value-key=\"yAxes0.ticks.stepSize\"\n value=${ifDefined(configurer.yAxes0.ticks?.stepSize)}\n />\n\n <input\n id=\"y-grid-line\"\n type=\"checkbox\"\n value-key=\"value.options.yGridLine\"\n ?checked=${configurer.config.options?.yGridLine}\n />\n <label for=\"y-grid-line\"> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input\n id=\"y-axes0-ticks-display\"\n type=\"checkbox\"\n value-key=\"yAxes0.ticks.display\"\n ?checked=${configurer.yAxes0.ticks?.display}\n />\n <label for=\"y-axes0-ticks-display\"> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n\n ${configurer.config.options?.multiAxis\n ? html`\n <legend><ox-i18n msgid=\"label.y-2nd-axes\">Y 2nd Axes</ox-i18n></legend>\n\n <label for=\"y-axes1.axis-title\"> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input\n id=\"y-axes1.axis-title\"\n type=\"text\"\n value-key=\"yAxes1.axisTitle\"\n value=${ifDefined(configurer.yAxes1?.axisTitle)}\n />\n\n <input\n id=\"y-axes1-ticks-auto-min\"\n type=\"checkbox\"\n value-key=\"yAxes1.ticks.autoMin\"\n ?checked=${configurer.yAxes1?.ticks?.autoMin}\n />\n <label for=\"y-axes1-ticks-auto-min\"> <ox-i18n msgid=\"label.axis-min-auto\">Min Auto</ox-i18n> </label>\n\n <input\n id=\"y-axes1-ticks-auto-max\"\n type=\"checkbox\"\n value-key=\"yAxes1.ticks.autoMax\"\n ?checked=${configurer.yAxes1?.ticks?.autoMax}\n />\n <label for=\"y-axes1-ticks-auto-max\"> <ox-i18n msgid=\"label.axis-max-auto\">Max Auto</ox-i18n> </label>\n\n ${!configurer.yAxes1?.ticks?.autoMin\n ? html`\n <label for=\"y-axes1-ticks-min\"> <ox-i18n msgid=\"label.axis-min\">Min</ox-i18n> </label>\n <input\n id=\"y-axes1-ticks-min\"\n type=\"number\"\n value-key=\"yAxes1.ticks.min\"\n value=${ifDefined(configurer.yAxes1?.ticks?.min)}\n />\n `\n : html``}\n ${!configurer.yAxes1?.ticks?.autoMax\n ? html`\n <label for=\"y-axes1-ticks-max\"> <ox-i18n msgid=\"label.axis-max\">Max</ox-i18n> </label>\n <input\n id=\"y-axes1-ticks-max\"\n type=\"number\"\n value-key=\"yAxes1.ticks.max\"\n value=${ifDefined(configurer.yAxes1?.ticks?.max)}\n />\n `\n : html``}\n\n <label for=\"y-axes1-ticks-step-size\"> <ox-i18n msgid=\"label.axis-step-size\">StepSize</ox-i18n> </label>\n <input\n id=\"y-axes1-ticks-step-size\"\n type=\"number\"\n value-key=\"yAxes1.ticks.stepSize\"\n value=${ifDefined(configurer.yAxes1?.ticks?.stepSize)}\n />\n\n <input\n id=\"y-2nd-grid-line\"\n type=\"checkbox\"\n value-key=\"value.options.y2ndGridLine\"\n ?checked=${configurer.config.options?.y2ndGridLine}\n />\n <label for=\"y-2nd-grid-line\"> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input\n id=\"y-axes1-ticks-display\"\n type=\"checkbox\"\n value-key=\"yAxes1.ticks.display\"\n ?checked=${configurer.yAxes1?.ticks?.display}\n />\n <label for=\"y-axes1-ticks-display\"> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n `\n : html``}\n\n <legend collapsable>\n <ox-i18n msgid=\"label.chart-annotation\">Annotations</ox-i18n>\n <md-icon\n @tap=${() => {\n this.annotationExpanded = !this.annotationExpanded\n }}\n >${this.annotationExpanded ? 'expand_less' : 'expand_more'}</md-icon\n >\n </legend>\n <div fullwidth ?collapsed=${!this.annotationExpanded}>${this.annotationsTabTemplate()}</div>\n `\n }\n\n _hasBarSeries(config: any) {\n var hasBarSeries = false\n hasBarSeries = config.data.datasets?.some((s: any) => s.type == 'bar')\n\n return hasBarSeries\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-input-chart-timeseries.js","sourceRoot":"","sources":["../../../src/editors/ox-input-chart-timeseries.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE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G,CAAC;;iBAEnD;gBACH,CAAC,CAAC,IAAI,CAAA,EAAE;;;;;;;sBAOA,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC;;;;;;;yBAO1C,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY;;;;;;;;yBAQvC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO;;;WAG/C;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;;;;;iBAKC,GAAG,EAAE;YACV,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAA;QACpD,CAAC;aACE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa;;;;sBAI9C,UAAU;qBACX,CAAC,IAAI,CAAC,kBAAkB;;;KAGxC,CAAA;IACH,CAAC;IAED,aAAa,CAAC,MAAW;QACvB,IAAI,YAAY,GAAG,KAAK,CAAA;QACxB,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,CAAA;QAEtE,OAAO,YAAY,CAAA;IACrB,CAAC;;AA9OQ;IAAR,KAAK,EAAE;kEAA2B;AArBxB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAoQlC","sourcesContent":["import '@operato/i18n/ox-i18n.js'\n\nimport { html, css } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { InputChartAbstract } from './input-chart-abstract'\n\nimport './templates/annotations'\nimport './templates/series'\n\n@customElement('ox-input-chart-timeseries')\nexport class OxInputChartTimeseries extends InputChartAbstract {\n static styles = [\n ...InputChartAbstract.styles,\n css`\n legend[collapsable] {\n box-sizing: border-box;\n width: 100%;\n }\n\n legend[collapsable] md-icon {\n float: right;\n font-size: medium;\n margin: 0;\n }\n\n [collapsed] {\n display: none;\n }\n `\n ]\n\n @state() annotationExpanded = false\n\n subTemplate() {\n const configurer = this.configurer\n\n return html`\n <input id=\"multi-axis\" type=\"checkbox\" value-key=\"multiAxis\" ?checked=${configurer.multiAxis} />\n <label for=\"multi-axis\"> <ox-i18n msgid=\"label.multi-axis\">Multi Axis</ox-i18n> </label>\n\n <legend><ox-i18n msgid=\"label.series\">Series</ox-i18n></legend>\n <ox-chart-series .configurer=${configurer} .chartType=${this.chartType} fullwidth></ox-chart-series>\n\n <legend><ox-i18n msgid=\"label.x-axes\">X Axes</ox-i18n></legend>\n\n <label for=\"series-data-key\"> <ox-i18n msgid=\"label.data-key\">Data Key</ox-i18n> </label>\n <input id=\"series-data-key\" type=\"text\" value-key=\"labelDataKey\" value=${ifDefined(configurer.labelDataKey)} />\n\n <label for=\"x-axes0-axis-title\"> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input\n id=\"x-axes0-axis-title\"\n type=\"text\"\n value-key=\"xAxes0.axisTitle\"\n value=${ifDefined(configurer.xAxes0.axisTitle)}\n />\n\n ${this._hasBarSeries(configurer.value)\n ? html`\n <label for=\"bar-spacing\"><ox-i18n msgid=\"label.bar-spacing\">Bar Spacing</ox-i18n></label>\n <input\n id=\"bar-spacing\"\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"xAxes0.barSpacing\"\n value=${ifDefined(configurer.xAxes0.barSpacing)}\n />\n <label for=\"tick-spacing\"><ox-i18n msgid=\"label.tick-spacing\">Tick Spacing</ox-i18n></label>\n <input\n id=\"tick-spacing\"\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"xAxes0.categorySpacing\"\n value=${ifDefined(configurer.xAxes0.categorySpacing)}\n />\n `\n : html``}\n\n <input\n id=\"x-grid-line\"\n type=\"checkbox\"\n value-key=\"value.options.xGridLine\"\n ?checked=${configurer.config.options?.xGridLine}\n />\n <label for=\"x-grid-line\"> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input\n id=\"x-axes0-ticks-display\"\n type=\"checkbox\"\n value-key=\"xAxes0.ticks.display\"\n ?checked=${configurer.xAxes0.ticks?.display}\n />\n <label for=\"x-axes0-ticks-display\"> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n\n <legend><ox-i18n msgid=\"label.y-axes\">Y Axes</ox-i18n></legend>\n\n <label for=\"y-axes0-axis-title\"> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input\n id=\"y-axes0-axis-title\"\n type=\"text\"\n value-key=\"yAxes0.axisTitle\"\n value=${configurer.yAxes0.axisTitle || ''}\n />\n\n <input\n id=\"axis-min-auto\"\n type=\"checkbox\"\n value-key=\"yAxes0.ticks.autoMin\"\n ?checked=${configurer.yAxes0.ticks?.autoMin}\n />\n <label for=\"axis-min-auto\"> <ox-i18n msgid=\"label.axis-min-auto\">Min Auto</ox-i18n> </label>\n\n <input\n id=\"axis-max-auto\"\n type=\"checkbox\"\n value-key=\"yAxes0.ticks.autoMax\"\n ?checked=${configurer.yAxes0.ticks?.autoMax}\n />\n <label for=\"axis-max-auto\"> <ox-i18n msgid=\"label.axis-max-auto\">Max Auto</ox-i18n> </label>\n\n ${!configurer.yAxes0.ticks?.autoMin\n ? html`\n <label for=\"y-axes0-ticks-min\"> <ox-i18n msgid=\"label.axis-min\">Min</ox-i18n> </label>\n <input\n id=\"y-axes0-ticks-min\"\n type=\"number\"\n value-key=\"yAxes0.ticks.min\"\n value=${ifDefined(configurer.yAxes0.ticks?.min)}\n />\n `\n : html``}\n ${!configurer.yAxes0.ticks?.autoMax\n ? html`\n <label for=\"y-axes0-ticks-max\"> <ox-i18n msgid=\"label.axis-max\">Max</ox-i18n> </label>\n <input\n id=\"y-axes0-ticks-max\"\n type=\"number\"\n value-key=\"yAxes0.ticks.max\"\n value=${ifDefined(configurer.yAxes0.ticks?.max)}\n />\n `\n : html``}\n\n <label for=\"y-axes0-ticks-step-size\"> <ox-i18n msgid=\"label.axis-step-size\">StepSize</ox-i18n> </label>\n <input\n id=\"y-axes0-ticks-step-size\"\n type=\"number\"\n value-key=\"yAxes0.ticks.stepSize\"\n value=${ifDefined(configurer.yAxes0.ticks?.stepSize)}\n />\n\n <input\n id=\"y-grid-line\"\n type=\"checkbox\"\n value-key=\"value.options.yGridLine\"\n ?checked=${configurer.config.options?.yGridLine}\n />\n <label for=\"y-grid-line\"> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input\n id=\"y-axes0-ticks-display\"\n type=\"checkbox\"\n value-key=\"yAxes0.ticks.display\"\n ?checked=${configurer.yAxes0.ticks?.display}\n />\n <label for=\"y-axes0-ticks-display\"> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n\n ${configurer.config.options?.multiAxis\n ? html`\n <legend><ox-i18n msgid=\"label.y-2nd-axes\">Y 2nd Axes</ox-i18n></legend>\n\n <label for=\"y-axes1.axis-title\"> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input\n id=\"y-axes1.axis-title\"\n type=\"text\"\n value-key=\"yAxes1.axisTitle\"\n value=${ifDefined(configurer.yAxes1?.axisTitle)}\n />\n\n <input\n id=\"y-axes1-ticks-auto-min\"\n type=\"checkbox\"\n value-key=\"yAxes1.ticks.autoMin\"\n ?checked=${configurer.yAxes1?.ticks?.autoMin}\n />\n <label for=\"y-axes1-ticks-auto-min\"> <ox-i18n msgid=\"label.axis-min-auto\">Min Auto</ox-i18n> </label>\n\n <input\n id=\"y-axes1-ticks-auto-max\"\n type=\"checkbox\"\n value-key=\"yAxes1.ticks.autoMax\"\n ?checked=${configurer.yAxes1?.ticks?.autoMax}\n />\n <label for=\"y-axes1-ticks-auto-max\"> <ox-i18n msgid=\"label.axis-max-auto\">Max Auto</ox-i18n> </label>\n\n ${!configurer.yAxes1?.ticks?.autoMin\n ? html`\n <label for=\"y-axes1-ticks-min\"> <ox-i18n msgid=\"label.axis-min\">Min</ox-i18n> </label>\n <input\n id=\"y-axes1-ticks-min\"\n type=\"number\"\n value-key=\"yAxes1.ticks.min\"\n value=${ifDefined(configurer.yAxes1?.ticks?.min)}\n />\n `\n : html``}\n ${!configurer.yAxes1?.ticks?.autoMax\n ? html`\n <label for=\"y-axes1-ticks-max\"> <ox-i18n msgid=\"label.axis-max\">Max</ox-i18n> </label>\n <input\n id=\"y-axes1-ticks-max\"\n type=\"number\"\n value-key=\"yAxes1.ticks.max\"\n value=${ifDefined(configurer.yAxes1?.ticks?.max)}\n />\n `\n : html``}\n\n <label for=\"y-axes1-ticks-step-size\"> <ox-i18n msgid=\"label.axis-step-size\">StepSize</ox-i18n> </label>\n <input\n id=\"y-axes1-ticks-step-size\"\n type=\"number\"\n value-key=\"yAxes1.ticks.stepSize\"\n value=${ifDefined(configurer.yAxes1?.ticks?.stepSize)}\n />\n\n <input\n id=\"y-2nd-grid-line\"\n type=\"checkbox\"\n value-key=\"value.options.y2ndGridLine\"\n ?checked=${configurer.config.options?.y2ndGridLine}\n />\n <label for=\"y-2nd-grid-line\"> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input\n id=\"y-axes1-ticks-display\"\n type=\"checkbox\"\n value-key=\"yAxes1.ticks.display\"\n ?checked=${configurer.yAxes1?.ticks?.display}\n />\n <label for=\"y-axes1-ticks-display\"> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n `\n : html``}\n\n <legend collapsable>\n <ox-i18n msgid=\"label.chart-annotation\">Annotations</ox-i18n>\n <md-icon\n @tap=${() => {\n this.annotationExpanded = !this.annotationExpanded\n }}\n >${this.annotationExpanded ? 'expand_less' : 'expand_more'}</md-icon\n >\n </legend>\n <ox-chart-annotations\n .configurer=${configurer}\n ?collapsed=${!this.annotationExpanded}\n fullwidth\n ></ox-chart-annotations>\n `\n }\n\n _hasBarSeries(config: any) {\n var hasBarSeries = false\n hasBarSeries = config.data.datasets?.some((s: any) => s.type == 'bar')\n\n return hasBarSeries\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-property-editor-chart.js","sourceRoot":"","sources":["../../../src/editors/ox-property-editor-chart.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,GAAG,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"ox-property-editor-chart.js","sourceRoot":"","sources":["../../../src/editors/ox-property-editor-chart.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,uBAAuB,CAAA;AAC9B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,sBAAsB,CAAA;AAC7B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAGlE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,gBAAgB;aACxC,WAAM,GAAG;QACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BF;KACF,AAjCY,CAiCZ;IAED,cAAc,CAAC,KAAU,EAAE,IAAkB;QAC3C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,MAAM,CAAC;YACZ,KAAK,KAAK;gBACR,OAAO,IAAI,CAAA,iCAAiC,KAAK,eAAe,KAAK,qCAAqC,CAAA;YAC5G,KAAK,eAAe;gBAClB,OAAO,IAAI,CAAA,gCAAgC,KAAK,eAAe,KAAK,oCAAoC,CAAA;YAC1G,KAAK,KAAK,CAAC;YACX,KAAK,UAAU,CAAC;YAChB,KAAK,WAAW;gBACd,OAAO,IAAI,CAAA,+BAA+B,KAAK,eAAe,KAAK,mCAAmC,CAAA;YACxG,KAAK,OAAO;gBACV,OAAO,IAAI,CAAA,iCAAiC,KAAK,eAAe,KAAK,qCAAqC,CAAA;YAC5G,KAAK,YAAY;gBACf,OAAO,IAAI,CAAA;8CAC2B,KAAK,eAAe,KAAK;SAC9D,CAAA;QACL,CAAC;QAED,OAAO,IAAI,CAAA,EAAE,CAAA;IACf,CAAC;;AAxDU,WAAW;IADvB,aAAa,CAAC,0BAA0B,CAAC;GAC7B,WAAW,CAyDvB","sourcesContent":["import '@operato/i18n/ox-i18n.js'\n\nimport './ox-input-chart-hbar'\nimport './ox-input-chart-mixed'\nimport './ox-input-chart-pie'\nimport './ox-input-chart-radar'\nimport './ox-input-chart-timeseries'\n\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\n\n@customElement('ox-property-editor-chart')\nexport class ChartEditor extends OxPropertyEditor {\n static styles = [\n css`\n :host {\n display: block;\n padding: 5px;\n\n --md-elevated-button-container-height: 20px;\n }\n\n #chart-type {\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n grid-gap: 5px;\n }\n\n #chart-type > label {\n box-sizing: border-box;\n grid-column: span 3;\n\n text-align: right;\n\n color: var(--md-sys-color-on-secondary-container);\n font-size: 0.8em;\n line-height: 2;\n text-transform: capitalize;\n }\n\n #chart-type > input {\n box-sizing: border-box;\n grid-column: span 7;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n `\n ]\n\n editorTemplate(value: any, spec: PropertySpec) {\n switch (value.type) {\n case 'line':\n case 'bar':\n return html` <ox-input-chart-mixed .value=${value} chart-type=${value} fullwidth></ox-input-chart-mixed> `\n case 'horizontalBar':\n return html` <ox-input-chart-hbar .value=${value} chart-type=${value} fullwidth></ox-input-chart-hbar> `\n case 'pie':\n case 'doughnut':\n case 'polarArea':\n return html` <ox-input-chart-pie .value=${value} chart-type=${value} fullwidth></ox-input-chart-pie> `\n case 'radar':\n return html` <ox-input-chart-radar .value=${value} chart-type=${value} fullwidth></ox-input-chart-radar> `\n case 'timeseries':\n return html`\n <ox-input-chart-timeseries .value=${value} chart-type=${value} fullwidth></ox-input-chart-timeseries>\n `\n }\n\n return html``\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
+
import { MdIcon } from '@material/web/icon/icon.js';
|
|
4
|
+
import { Configurer } from '../configurer';
|
|
5
|
+
export declare class AnnotationsTemplate extends LitElement {
|
|
6
|
+
createRenderRoot(): this;
|
|
7
|
+
configurer: Configurer;
|
|
8
|
+
annotationsTabs: HTMLElement;
|
|
9
|
+
annotationsTabNavLeftButton: MdIcon;
|
|
10
|
+
annotationsTabNavRightButton: MdIcon;
|
|
11
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
12
|
+
render(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/keyed").Keyed>;
|
|
13
|
+
private _renderTabs;
|
|
14
|
+
private _renderAnnotationForm;
|
|
15
|
+
private _selectTab;
|
|
16
|
+
private _removeAnnotation;
|
|
17
|
+
private _addAnnotation;
|
|
18
|
+
private _onWheelScroll;
|
|
19
|
+
private _scrollLeft;
|
|
20
|
+
private _scrollRight;
|
|
21
|
+
private _scrollTabContainer;
|
|
22
|
+
private _onTabScroll;
|
|
23
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import { LitElement, html } from 'lit';
|
|
4
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
|
+
import { keyed } from 'lit/directives/keyed.js';
|
|
6
|
+
let AnnotationsTemplate = class AnnotationsTemplate extends LitElement {
|
|
7
|
+
createRenderRoot() {
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
updated(_changedProperties) {
|
|
11
|
+
if (_changedProperties.has('configurer')) {
|
|
12
|
+
this.requestUpdate();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return keyed(this.configurer.currentAnnotationIndex, html `
|
|
17
|
+
<div id="annotations-properties-container" fullwidth>
|
|
18
|
+
<div id="annotations-tab-header" @wheel=${this._onWheelScroll}>
|
|
19
|
+
<md-icon id="annotations-tab-nav-left-button" @click=${this._scrollLeft}>chevron_left</md-icon>
|
|
20
|
+
<div id="annotations-tabs" active-tab-index=${this.configurer.currentAnnotationIndex} fit-container>
|
|
21
|
+
${this._renderTabs()}
|
|
22
|
+
</div>
|
|
23
|
+
<md-icon id="annotations-tab-nav-right-button" @click=${this._scrollRight}>chevron_right</md-icon>
|
|
24
|
+
</div>
|
|
25
|
+
<div id="add-annotation-button-container">
|
|
26
|
+
<md-icon id="add-annotation-button" @click=${this._addAnnotation}>add</md-icon>
|
|
27
|
+
</div>
|
|
28
|
+
${this._renderAnnotationForm()}
|
|
29
|
+
</div>
|
|
30
|
+
`);
|
|
31
|
+
}
|
|
32
|
+
_renderTabs() {
|
|
33
|
+
return this.configurer.annotations.map((annotation, index) => html `
|
|
34
|
+
<div
|
|
35
|
+
data-annotation=${index + 1}
|
|
36
|
+
data-tab-index=${index}
|
|
37
|
+
tab
|
|
38
|
+
?selected=${index === this.configurer.currentAnnotationIndex}
|
|
39
|
+
@click=${() => this._selectTab(index)}
|
|
40
|
+
>
|
|
41
|
+
${index + 1}
|
|
42
|
+
${this.configurer.annotations.length > 0 && this.configurer.currentAnnotationIndex === index
|
|
43
|
+
? html `<md-icon @click=${() => this._removeAnnotation(index)}>close</md-icon>`
|
|
44
|
+
: html ``}
|
|
45
|
+
</div>
|
|
46
|
+
`);
|
|
47
|
+
}
|
|
48
|
+
_renderAnnotationForm() {
|
|
49
|
+
const currentAnnotation = this.configurer.currentAnnotationIndex >= 0
|
|
50
|
+
? this.configurer.annotations[this.configurer.currentAnnotationIndex]
|
|
51
|
+
: undefined;
|
|
52
|
+
if (!currentAnnotation) {
|
|
53
|
+
return html `<p>No annotations available. Add one using the button above.</p>`;
|
|
54
|
+
}
|
|
55
|
+
return html `
|
|
56
|
+
<div class="tab-content">
|
|
57
|
+
<label for="annotation-type"> <ox-i18n msgid="label.chart-annotation-type">Type</ox-i18n> </label>
|
|
58
|
+
<select
|
|
59
|
+
id="annotation-type"
|
|
60
|
+
class="select-content"
|
|
61
|
+
value-key="annotation.type"
|
|
62
|
+
.value=${currentAnnotation.type || ''}
|
|
63
|
+
>
|
|
64
|
+
<option value=""> </option>
|
|
65
|
+
<option value="line">Line</option>
|
|
66
|
+
<option value="text">Text</option>
|
|
67
|
+
<option value="box">Box</option>
|
|
68
|
+
<option value="horizontalLine">Horizontal Line</option>
|
|
69
|
+
<option value="verticalLine">Vertical Line</option>
|
|
70
|
+
</select>
|
|
71
|
+
|
|
72
|
+
<label for="annotation-x1">X1</label>
|
|
73
|
+
<input
|
|
74
|
+
id="annotation-x1"
|
|
75
|
+
type="number"
|
|
76
|
+
value-key="annotation.x1"
|
|
77
|
+
.value=${String(currentAnnotation.x1 || 0)}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<label for="annotation-y1">Y1</label>
|
|
81
|
+
<input
|
|
82
|
+
id="annotation-y1"
|
|
83
|
+
type="number"
|
|
84
|
+
value-key="annotation.y1"
|
|
85
|
+
.value=${String(currentAnnotation.y1 || 0)}
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
<label for="annotation-x2">X2</label>
|
|
89
|
+
<input
|
|
90
|
+
id="annotation-x2"
|
|
91
|
+
type="number"
|
|
92
|
+
value-key="annotation.x2"
|
|
93
|
+
.value=${String(currentAnnotation.x2 || 0)}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<label for="annotation-y2">Y2</label>
|
|
97
|
+
<input
|
|
98
|
+
id="annotation-y2"
|
|
99
|
+
type="number"
|
|
100
|
+
value-key="annotation.y2"
|
|
101
|
+
.value=${String(currentAnnotation.y2 || 0)}
|
|
102
|
+
/>
|
|
103
|
+
|
|
104
|
+
<label for="annotation-stroke"> <ox-i18n msgid="label.stroke-style">Stroke Style</ox-i18n> </label>
|
|
105
|
+
<ox-input-color
|
|
106
|
+
id="annotation-stroke"
|
|
107
|
+
value-key="annotation.stroke"
|
|
108
|
+
.value=${currentAnnotation.stroke}
|
|
109
|
+
></ox-input-color>
|
|
110
|
+
|
|
111
|
+
<label for="annotation-stroke-thickness">
|
|
112
|
+
<ox-i18n msgid="label.stroke-thickness">Stroke Thickness</ox-i18n>
|
|
113
|
+
</label>
|
|
114
|
+
<input
|
|
115
|
+
id="annotation-stroke-thickness"
|
|
116
|
+
type="number"
|
|
117
|
+
value-key="annotation.strokeThickness"
|
|
118
|
+
.value=${String(currentAnnotation.strokeThickness || 1)}
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<label for="annotation-fill"> <ox-i18n msgid="label.fill">Fill</ox-i18n> </label>
|
|
122
|
+
<ox-input-color
|
|
123
|
+
id="annotation-fill"
|
|
124
|
+
value-key="annotation.fill"
|
|
125
|
+
.value=${currentAnnotation.fill}
|
|
126
|
+
></ox-input-color>
|
|
127
|
+
|
|
128
|
+
<label for="annotation-text"> <ox-i18n msgid="label.annotation-text">Text</ox-i18n> </label>
|
|
129
|
+
<input id="annotation-text" type="text" value-key="annotation.text" .value=${currentAnnotation.text || ''} />
|
|
130
|
+
|
|
131
|
+
<label for="annotation-horizontal-anchor">
|
|
132
|
+
<ox-i18n msgid="label.horizontal-anchor">Horizontal Anchor</ox-i18n>
|
|
133
|
+
</label>
|
|
134
|
+
<select
|
|
135
|
+
id="annotation-horizontal-anchor"
|
|
136
|
+
class="select-content"
|
|
137
|
+
value-key="annotation.horizontalAnchorPoint"
|
|
138
|
+
.value=${currentAnnotation.horizontalAnchorPoint || ''}
|
|
139
|
+
>
|
|
140
|
+
<option value=""> </option>
|
|
141
|
+
<option value="Left">Left</option>
|
|
142
|
+
<option value="Center">Center</option>
|
|
143
|
+
<option value="Right">Right</option>
|
|
144
|
+
</select>
|
|
145
|
+
|
|
146
|
+
<label for="annotation-vertical-anchor">
|
|
147
|
+
<ox-i18n msgid="label.vertical-anchor">Vertical Anchor</ox-i18n>
|
|
148
|
+
</label>
|
|
149
|
+
<select
|
|
150
|
+
id="annotation-vertical-anchor"
|
|
151
|
+
class="select-content"
|
|
152
|
+
value-key="annotation.verticalAnchorPoint"
|
|
153
|
+
.value=${currentAnnotation.verticalAnchorPoint || ''}
|
|
154
|
+
>
|
|
155
|
+
<option value=""> </option>
|
|
156
|
+
<option value="Top">Top</option>
|
|
157
|
+
<option value="Center">Center</option>
|
|
158
|
+
<option value="Bottom">Bottom</option>
|
|
159
|
+
</select>
|
|
160
|
+
|
|
161
|
+
<label for="annotation-x-coordinate-mode">X Coordinate Mode</label>
|
|
162
|
+
<select
|
|
163
|
+
id="annotation-x-coordinate-mode"
|
|
164
|
+
class="select-content"
|
|
165
|
+
value-key="annotation.xCoordinateMode"
|
|
166
|
+
.value=${currentAnnotation.xCoordinateMode || 'DataValue'}
|
|
167
|
+
>
|
|
168
|
+
<option value=""> </option>
|
|
169
|
+
<option value="DataValue">DataValue</option>
|
|
170
|
+
<option value="Pixel">Pixel</option>
|
|
171
|
+
<option value="Relative">Relative</option>
|
|
172
|
+
</select>
|
|
173
|
+
|
|
174
|
+
<label for="annotation-y-coordinate-mode">Y Coordinate Mode</label>
|
|
175
|
+
<select
|
|
176
|
+
id="annotation-y-coordinate-mode"
|
|
177
|
+
class="select-content"
|
|
178
|
+
value-key="annotation.yCoordinateMode"
|
|
179
|
+
.value=${currentAnnotation.yCoordinateMode || 'DataValue'}
|
|
180
|
+
>
|
|
181
|
+
<option value=""> </option>
|
|
182
|
+
<option value="DataValue">DataValue</option>
|
|
183
|
+
<option value="Pixel">Pixel</option>
|
|
184
|
+
<option value="Relative">Relative</option>
|
|
185
|
+
</select>
|
|
186
|
+
</div>
|
|
187
|
+
`;
|
|
188
|
+
}
|
|
189
|
+
_selectTab(index) {
|
|
190
|
+
this.configurer.setCurrentAnnotationIndex(index);
|
|
191
|
+
this.requestUpdate();
|
|
192
|
+
}
|
|
193
|
+
_removeAnnotation(index) {
|
|
194
|
+
this.configurer.removeAnnotation(index);
|
|
195
|
+
this.requestUpdate();
|
|
196
|
+
}
|
|
197
|
+
_addAnnotation() {
|
|
198
|
+
this.configurer.addAnnotation();
|
|
199
|
+
this.requestUpdate();
|
|
200
|
+
}
|
|
201
|
+
_onWheelScroll(event) {
|
|
202
|
+
const tabContainer = this.annotationsTabs;
|
|
203
|
+
if (tabContainer) {
|
|
204
|
+
event.preventDefault();
|
|
205
|
+
tabContainer.scrollLeft += event.deltaY;
|
|
206
|
+
this._onTabScroll();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
_scrollLeft() {
|
|
210
|
+
this._scrollTabContainer(-1);
|
|
211
|
+
}
|
|
212
|
+
_scrollRight() {
|
|
213
|
+
this._scrollTabContainer(1);
|
|
214
|
+
}
|
|
215
|
+
_scrollTabContainer(direction) {
|
|
216
|
+
const tabContainer = this.renderRoot.querySelector('#annotations-tabs');
|
|
217
|
+
if (tabContainer) {
|
|
218
|
+
tabContainer.style.scrollBehavior = 'smooth';
|
|
219
|
+
tabContainer.scrollLeft += direction * tabContainer.clientWidth;
|
|
220
|
+
}
|
|
221
|
+
setTimeout(() => {
|
|
222
|
+
tabContainer.style.scrollBehavior = 'auto';
|
|
223
|
+
this._onTabScroll();
|
|
224
|
+
}, 300);
|
|
225
|
+
}
|
|
226
|
+
_onTabScroll() {
|
|
227
|
+
let tabContainer;
|
|
228
|
+
let tabNavLeftButton;
|
|
229
|
+
let tabNavRightButton;
|
|
230
|
+
tabContainer = this.annotationsTabs;
|
|
231
|
+
tabNavLeftButton = this.annotationsTabNavLeftButton;
|
|
232
|
+
tabNavRightButton = this.annotationsTabNavRightButton;
|
|
233
|
+
if (!tabContainer) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (tabContainer.clientWidth == tabContainer.scrollWidth) {
|
|
237
|
+
tabNavLeftButton.setAttribute('disabled', '');
|
|
238
|
+
tabNavRightButton.setAttribute('disabled', '');
|
|
239
|
+
}
|
|
240
|
+
else if (tabContainer.scrollLeft <= 0) {
|
|
241
|
+
tabNavLeftButton.setAttribute('disabled', '');
|
|
242
|
+
tabNavRightButton.removeAttribute('disabled');
|
|
243
|
+
}
|
|
244
|
+
else if (tabContainer.scrollLeft + tabContainer.clientWidth >= tabContainer.scrollWidth) {
|
|
245
|
+
tabNavLeftButton.removeAttribute('disabled');
|
|
246
|
+
tabNavRightButton.setAttribute('disabled', '');
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
tabNavLeftButton.removeAttribute('disabled');
|
|
250
|
+
tabNavRightButton.removeAttribute('disabled');
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
__decorate([
|
|
255
|
+
property({ type: Object })
|
|
256
|
+
], AnnotationsTemplate.prototype, "configurer", void 0);
|
|
257
|
+
__decorate([
|
|
258
|
+
query('#annotations-tabs')
|
|
259
|
+
], AnnotationsTemplate.prototype, "annotationsTabs", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
query('#annotations-tab-nav-left-button')
|
|
262
|
+
], AnnotationsTemplate.prototype, "annotationsTabNavLeftButton", void 0);
|
|
263
|
+
__decorate([
|
|
264
|
+
query('#annotations-tab-nav-right-button')
|
|
265
|
+
], AnnotationsTemplate.prototype, "annotationsTabNavRightButton", void 0);
|
|
266
|
+
AnnotationsTemplate = __decorate([
|
|
267
|
+
customElement('ox-chart-annotations')
|
|
268
|
+
], AnnotationsTemplate);
|
|
269
|
+
export { AnnotationsTemplate };
|
|
270
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.js","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ACd;IAA1C,KAAK,CAAC,kCAAkC,CAAC;wEAAqC;AACnC;IAA3C,KAAK,CAAC,mCAAmC,CAAC;yEAAsC;AATtE,mBAAmB;IAD/B,aAAa,CAAC,sBAAsB,CAAC;GACzB,mBAAmB,CAoR/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 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.requestUpdate()\n }\n\n private _addAnnotation() {\n this.configurer.addAnnotation()\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"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Configurer } from '../configurer';
|
|
3
|
+
export declare class DisplayValue extends LitElement {
|
|
4
|
+
createRenderRoot(): this;
|
|
5
|
+
configurer: Configurer;
|
|
6
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'ox-chart-display-value': DisplayValue;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { LitElement, html } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
let DisplayValue = class DisplayValue extends LitElement {
|
|
5
|
+
createRenderRoot() {
|
|
6
|
+
return this;
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
const configurer = this.configurer;
|
|
10
|
+
return html `
|
|
11
|
+
<div id="display-value-container">
|
|
12
|
+
<label for="value-format"> <ox-i18n msgid="label.value-format">Value Format</ox-i18n> </label>
|
|
13
|
+
<input
|
|
14
|
+
id="value-format"
|
|
15
|
+
type="text"
|
|
16
|
+
value-key="series.valueFormat"
|
|
17
|
+
.value=${configurer.series.valueFormat || ''}
|
|
18
|
+
list="format-list"
|
|
19
|
+
/>
|
|
20
|
+
<datalist id="format-list">
|
|
21
|
+
<option value="#,###."></option>
|
|
22
|
+
<option value="#,###.#"></option>
|
|
23
|
+
<option value="#,###.0"></option>
|
|
24
|
+
<option value="#,##0.#"></option>
|
|
25
|
+
<option value="#,##0.0"></option>
|
|
26
|
+
<option value="#,##0.0%"></option>
|
|
27
|
+
</datalist>
|
|
28
|
+
|
|
29
|
+
<label for="value-prefix"> <ox-i18n msgid="label.value-prefix">Value Prefix</ox-i18n> </label>
|
|
30
|
+
<input
|
|
31
|
+
id="value-prefix"
|
|
32
|
+
type="text"
|
|
33
|
+
value-key="series.valuePrefix"
|
|
34
|
+
.value=${configurer.series.valuePrefix || ''}
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<label for="value-suffix"> <ox-i18n msgid="label.value-suffix">Value Suffix</ox-i18n> </label>
|
|
38
|
+
<input
|
|
39
|
+
id="value-suffix"
|
|
40
|
+
type="text"
|
|
41
|
+
value-key="series.valueSuffix"
|
|
42
|
+
.value=${configurer.series.valueSuffix || ''}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<input
|
|
46
|
+
id="display-value"
|
|
47
|
+
type="checkbox"
|
|
48
|
+
value-key="series.displayValue"
|
|
49
|
+
?checked=${!!configurer.series.displayValue}
|
|
50
|
+
/>
|
|
51
|
+
<label for="display-value"> <ox-i18n msgid="label.value-display">Value Display</ox-i18n> </label>
|
|
52
|
+
|
|
53
|
+
${configurer.series.displayValue
|
|
54
|
+
? html `
|
|
55
|
+
<label for="font-color"> <ox-i18n msgid="label.font-color">Font Color</ox-i18n> </label>
|
|
56
|
+
<ox-input-color
|
|
57
|
+
id="font-color"
|
|
58
|
+
value-key="series.defaultFontColor"
|
|
59
|
+
.value=${configurer.series.defaultFontColor || '#000'}
|
|
60
|
+
></ox-input-color>
|
|
61
|
+
<label for="font-size"> <ox-i18n msgid="label.font-size">Font Size</ox-i18n> </label>
|
|
62
|
+
<input
|
|
63
|
+
id="font-size"
|
|
64
|
+
type="number"
|
|
65
|
+
value-key="series.defaultFontSize"
|
|
66
|
+
.value=${configurer.series.defaultFontSize || 10}
|
|
67
|
+
/>
|
|
68
|
+
<label for="data-label-anchor"> <ox-i18n msgid="label.data-label-anchor">Position</ox-i18n> </label>
|
|
69
|
+
<select
|
|
70
|
+
id="data-label-anchor"
|
|
71
|
+
value-key="series.dataLabelAnchor"
|
|
72
|
+
.value=${configurer.series.dataLabelAnchor || 'center'}
|
|
73
|
+
>
|
|
74
|
+
<option value="center">Center</option>
|
|
75
|
+
<option value="start">Start</option>
|
|
76
|
+
<option value="end">End</option>
|
|
77
|
+
</select>
|
|
78
|
+
<label for="data-label-offset"> <ox-i18n msgid="label.data-label-offset">Offset</ox-i18n> </label>
|
|
79
|
+
<input
|
|
80
|
+
id="data-label-offset"
|
|
81
|
+
type="number"
|
|
82
|
+
value-key="series.dataLabelOffset"
|
|
83
|
+
.value=${configurer.series.dataLabelOffset || 0}
|
|
84
|
+
/>
|
|
85
|
+
<label for="data-label-rotation"> <ox-i18n msgid="label.data-label-rotation">Rotation</ox-i18n> </label>
|
|
86
|
+
<input
|
|
87
|
+
id="data-label-rotation"
|
|
88
|
+
type="number"
|
|
89
|
+
value-key="series.dataLabelRotation"
|
|
90
|
+
.value=${configurer.series.dataLabelRotation || 0}
|
|
91
|
+
/>
|
|
92
|
+
`
|
|
93
|
+
: html ``}
|
|
94
|
+
</div>
|
|
95
|
+
`;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: Object })
|
|
100
|
+
], DisplayValue.prototype, "configurer", void 0);
|
|
101
|
+
DisplayValue = __decorate([
|
|
102
|
+
customElement('ox-chart-display-value')
|
|
103
|
+
], DisplayValue);
|
|
104
|
+
export { DisplayValue };
|
|
105
|
+
//# sourceMappingURL=display-value.js.map
|
|
@@ -0,0 +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;QAElC,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;;;;;;;qBAOjC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY;;;;UAI3C,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;AA5F6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAwB;AALxC,YAAY;IADxB,aAAa,CAAC,wBAAwB,CAAC;GAC3B,YAAY,CAiGxB","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\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 <input\n id=\"display-value\"\n type=\"checkbox\"\n value-key=\"series.displayValue\"\n ?checked=${!!configurer.series.displayValue}\n />\n <label for=\"display-value\"> <ox-i18n msgid=\"label.value-display\">Value Display</ox-i18n> </label>\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"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
+
import { MdIcon } from '@material/web/icon/icon.js';
|
|
4
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
|
5
|
+
import { Configurer } from '../configurer';
|
|
6
|
+
import './display-value';
|
|
7
|
+
export declare class MultipleSeriesTemplate extends LitElement {
|
|
8
|
+
createRenderRoot(): this;
|
|
9
|
+
configurer: Configurer;
|
|
10
|
+
chartType?: 'bar' | 'horizontalBar' | 'line' | 'radar' | 'pie' | 'doughnut' | 'polarArea';
|
|
11
|
+
seriesTabs: HTMLElement;
|
|
12
|
+
seriesTabNavLeftButton: MdIcon;
|
|
13
|
+
seriesTabNavRightButton: MdIcon;
|
|
14
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
15
|
+
render(): import("lit-html/directive").DirectiveResult<typeof import("lit-html/directives/keyed").Keyed>;
|
|
16
|
+
private _renderTabs;
|
|
17
|
+
private _renderSeriesForm;
|
|
18
|
+
_getSeriesModel({ chartType, datasetsLength, lastSeriesColor }: {
|
|
19
|
+
chartType: string;
|
|
20
|
+
datasetsLength: number;
|
|
21
|
+
lastSeriesColor: TinyColor;
|
|
22
|
+
}): any;
|
|
23
|
+
private _selectTab;
|
|
24
|
+
private _removeSeries;
|
|
25
|
+
private _addSeries;
|
|
26
|
+
private _onWheelScroll;
|
|
27
|
+
private _scrollLeft;
|
|
28
|
+
private _scrollRight;
|
|
29
|
+
private _scrollTabContainer;
|
|
30
|
+
private _onTabScroll;
|
|
31
|
+
}
|