@operato/scene-chartjs 1.0.0-alpha.7 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +286 -7
- package/dist/editors/property-editor-chartjs-abstract.d.ts +3 -3
- package/dist/editors/property-editor-chartjs-hbar.d.ts +3 -4
- package/dist/editors/property-editor-chartjs-hbar.js +3 -4
- package/dist/editors/property-editor-chartjs-hbar.js.map +1 -1
- package/dist/editors/property-editor-chartjs-mixed.d.ts +1 -6
- package/dist/editors/property-editor-chartjs-mixed.js +0 -5
- package/dist/editors/property-editor-chartjs-mixed.js.map +1 -1
- package/dist/editors/property-editor-chartjs-multi-series-abstract.d.ts +3 -5
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js +1 -3
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js.map +1 -1
- package/dist/editors/property-editor-chartjs-pie.d.ts +1 -1
- package/dist/editors/property-editor-chartjs-radar.d.ts +1 -5
- package/dist/editors/property-editor-chartjs-radar.js +0 -4
- package/dist/editors/property-editor-chartjs-radar.js.map +1 -1
- package/dist/editors/property-editor-chartjs.d.ts +2 -7
- package/dist/editors/property-editor-chartjs.js +19 -23
- package/dist/editors/property-editor-chartjs.js.map +1 -1
- package/dist/ox-chart.d.ts +1 -1
- package/package.json +6 -9
- package/src/editors/property-editor-chartjs-hbar.ts +4 -4
- package/src/editors/property-editor-chartjs-mixed.ts +0 -6
- package/src/editors/property-editor-chartjs-multi-series-abstract.ts +3 -4
- package/src/editors/property-editor-chartjs-radar.ts +0 -5
- package/src/editors/property-editor-chartjs.ts +20 -25
- package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property-editor-chartjs-multi-series-abstract.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-multi-series-abstract.ts"],"names":[],"mappings":";AAAA,OAAO,8BAA8B,CAAA;AACrC,OAAO,gCAAgC,CAAA;AACvC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,8CAA8C,CAAA;AACrD,OAA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AK,CAAC,cAAc,GAAG,QAAQ,CAAA;QACjD,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,MAAM,CAAA;IACjD,CAAC;IAED,oBAAoB,CAAC,CAAQ;QAC3B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,OAAM;SACP;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAA;QACjD,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,MAAM,CAAA;IACjD,CAAC;;AAvXM,+CAAM,GAAG;IACd,GAAG,6BAA6B,CAAC,MAAM;IACvC,GAAG,CAAA;;;;;;;;KAQF;CACF,CAAA;AA2Be;IAAf,KAAK,CAAC,OAAO,CAAC;sEAAmB;AACH;IAA9B,KAAK,CAAC,sBAAsB,CAAC;kFAA0C;AACxC;IAA/B,KAAK,CAAC,uBAAuB,CAAC;mFAA2C","sourcesContent":["import '@polymer/iron-icon/iron-icon'\nimport '@polymer/iron-pages/iron-pages'\nimport '@polymer/paper-button/paper-button'\nimport '@polymer/paper-icon-button/paper-icon-button'\nimport '@polymer/paper-tabs/paper-tabs'\n\nimport { css, html } from 'lit'\n\nimport { PaperIconButtonElement } from '@polymer/paper-icon-button/paper-icon-button'\nimport { Properties } from '@hatiolab/things-scene'\nimport PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract'\nimport { query } from 'lit/decorators.js'\n\nexport default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEditorChartJSAbstract {\n static styles = [\n ...PropertyEditorChartJSAbstract.styles,\n css`\n paper-tabs {\n background-color: rgb(204, 204, 204);\n }\n input[type='text'],\n input[type='number'] {\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n `\n ]\n\n constructor() {\n super()\n\n this.value = {\n options: {\n legend: {},\n scales: {\n xAxes: [\n {\n ticks: {}\n }\n ],\n yAxes: [\n {\n ticks: {}\n }\n ]\n }\n },\n data: {\n datasets: []\n }\n }\n }\n\n @query('#tabs') tabs!: HTMLElement\n @query('#tab-nav-left-button') tabNavLeftButton!: PaperIconButtonElement\n @query('#tab-nav-right-button') tabNavRightButton!: PaperIconButtonElement\n\n get color() {\n var oldVersionColor = this.series.backgroundColor\n if (this.series.type == 'line') oldVersionColor = this.series.borderColor\n if (this.series.type == 'radar') oldVersionColor = this.series.borderColor\n return this.series.color || oldVersionColor\n }\n\n set color(color) {\n this.series.color = color\n delete this.series.backgroundColor\n delete this.series.borderColor\n }\n\n get xAxes0() {\n return this.scales.xAxes[0]\n }\n\n set xAxes0(xAxes0) {\n this.scales.xAxes[0] = xAxes0\n }\n\n get yAxes0() {\n return this.scales.yAxes[0]\n }\n\n set yAxes0(yAxes0) {\n this.scales.yAxes[0] = yAxes0\n }\n\n get yAxes1() {\n return this.scales.yAxes[1]\n }\n\n set yAxes1(yAxes1) {\n this.scales.yAxes[1] = yAxes1\n }\n\n get multiAxis() {\n return this.value.options.multiAxis\n }\n\n set multiAxis(multiAxis) {\n this.value.options.multiAxis = multiAxis\n }\n\n get tabContainer(): HTMLElement | null | undefined {\n return this.tabs.shadowRoot?.querySelector('#tabsContainer')\n }\n\n firstUpdated() {\n super.firstUpdated()\n\n this.tabContainer?.addEventListener('scroll', e => {\n this._onTabScroll(e)\n })\n }\n\n editorTemplate(props: Properties) {\n return html`\n <input type=\"checkbox\" value-key=\"multiAxis\" .checked=${this.multiAxis} />\n <label> <i18n-msg msgid=\"label.multi-axis\">Multi Axis</i18n-msg> </label>\n\n <legend><i18n-msg msgid=\"label.series\">Series</i18n-msg></legend>\n\n ${this.multiSeriesTabTemplate()}\n\n <legend><i18n-msg msgid=\"label.x-axes\">X Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.data-key\">Data Key</i18n-msg> </label>\n <input type=\"text\" value-key=\"labelDataKey\" .value=${this.labelDataKey} />\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"xAxes0.axisTitle\" .value=${this.xAxes0.axisTitle || ''} />\n\n <label> <i18n-msg msgid=\"label.thickness\">Thickness</i18n-msg> </label>\n <input type=\"number\" value-key=\"xAxes0.barPercentage\" .value=${this.xAxes0.barPercentage} />\n\n <input type=\"checkbox\" value-key=\"value.options.xGridLine\" .checked=${this.value.options.xGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"xAxes0.ticks.display\" .checked=${this.xAxes0.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n\n <legend><i18n-msg msgid=\"label.y-axes\">Y Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"yAxes0.axisTitle\" .value=${this.yAxes0.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.autoMin\" .checked=${this.yAxes0.ticks.autoMin} />\n <label> <i18n-msg msgid=\"label.axis-min-auto\">Min Auto</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.autoMax\" .checked=${this.yAxes0.ticks.autoMax} />\n <label> <i18n-msg msgid=\"label.axis-max-auto\">Max Auto</i18n-msg> </label>\n\n ${!this.yAxes0.ticks.autoMin\n ? html`\n <label> <i18n-msg msgid=\"label.axis-min\">Min</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.min\" .value=${this.yAxes0.ticks.min} />\n `\n : html``}\n ${!this.yAxes0.ticks.autoMax\n ? html`\n <label> <i18n-msg msgid=\"label.axis-max\">Max</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.max\" .value=${this.yAxes0.ticks.max} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.axis-step-size\">StepSize</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.stepSize\" .value=${this.yAxes0.ticks.stepSize} />\n\n <input type=\"checkbox\" value-key=\"value.options.yGridLine\" .checked=${this.value.options.yGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.display\" .checked=${this.yAxes0.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n\n ${this.value.options.multiAxis\n ? html`\n <legend><i18n-msg msgid=\"label.y-2nd-axes\">Y 2nd Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"yAxes1.axisTitle\" .value=${this.yAxes1.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.autoMin\" .checked=${this.yAxes1.ticks.autoMin} />\n <label> <i18n-msg msgid=\"label.axis-min-auto\">Min Auto</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.autoMax\" .checked=${this.yAxes1.ticks.autoMax} />\n <label> <i18n-msg msgid=\"label.axis-max-auto\">Max Auto</i18n-msg> </label>\n\n ${!this.yAxes1.ticks.autoMin\n ? html`\n <label> <i18n-msg msgid=\"label.axis-min\">Min</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.min\" .value=${this.yAxes1.ticks.min} />\n `\n : html``}\n ${!this.yAxes1.ticks.autoMax\n ? html`\n <label> <i18n-msg msgid=\"label.axis-max\">Max</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.max\" .value=${this.yAxes1.ticks.max} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.axis-step-size\">StepSize</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.stepSize\" .value=${this.yAxes1.ticks.stepSize} />\n\n <input type=\"checkbox\" value-key=\"value.options.y2ndGridLine\" .checked=${this.value.options.y2ndGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.display\" .checked=${this.yAxes1.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n `\n : html``}\n `\n }\n\n multiSeriesTabTemplate() {\n return html`\n <div id=\"series-properties-container\" fullwidth>\n <div id=\"tab-header\">\n <paper-icon-button\n id=\"tab-nav-left-button\"\n icon=\"chevron-left\"\n @click=${(e: Event) => {\n this._onTabScrollNavLeft(e)\n }}\n disabled\n ></paper-icon-button>\n <paper-tabs\n id=\"tabs\"\n @iron-select=${(e: Event) => (this.currentSeriesIndex = (e.target as any).selected)}\n .selected=${this.currentSeriesIndex}\n no-bar\n noink\n scrollable\n hide-scroll-buttons\n fit-container\n >\n ${this.datasets.map(\n (dataset: any, index: number) => html`\n <paper-tab data-series=\"${index + 1}\" noink\n >${index + 1}\n ${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)\n ? html`\n <paper-icon-button icon=\"close\" @tap=${(e: Event) => this.onTapRemoveCurrentTab(e)}>\n </paper-icon-button>\n `\n : html``}\n </paper-tab>\n `\n )}\n </paper-tabs>\n <paper-icon-button\n id=\"tab-nav-right-button\"\n icon=\"chevron-right\"\n @click=${(e: Event) => {\n this._onTabScrollNavRight(e)\n }}\n disabled\n ></paper-icon-button>\n </div>\n <div id=\"add-series-button-container\">\n <paper-icon-button\n id=\"add-series-button\"\n icon=\"add\"\n @tap=${(e: Event) => this.onTapAddTab(e)}\n ></paper-icon-button>\n </div>\n\n <iron-pages .selected=${this.currentSeriesIndex} .attr-for-selected=\"series-index\">\n ${this.datasets.map(\n (dataset: any, index: number) => html`\n <div class=\"tab-content\" series-index=\"${index}\">\n <label> <i18n-msg msgid=\"label.data-key\">Data Key</i18n-msg> </label>\n <input type=\"text\" value-key=\"dataKey\" .value=${this.dataKey} />\n\n ${this.value.type == 'bar'\n ? html`\n <label> <i18n-msg msgid=\"label.type\">type</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.type\" .value=${this.series.type}>\n <option value=\"bar\" selected>bar</option>\n <option value=\"line\">line</option>\n </select>\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.label\">label</i18n-msg> </label>\n <input type=\"text\" value-key=\"series.label\" .value=${this.series.label} />\n\n ${this.series.type == 'line'\n ? html`\n <label> <i18n-msg msgid=\"label.line-tension\">line tension</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.lineTension\" .value=${this.series.lineTension}>\n <option value=\"0.4\">smooth</option>\n <option value=\"0\">angled</option>\n </select>\n `\n : html``}\n ${this.series.type == 'line'\n ? html`\n <label> <i18n-msg msgid=\"label.border-width\">border width</i18n-msg> </label>\n <input type=\"number\" value-key=\"series.borderWidth\" .value=${this.series.borderWidth} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.color\">color</i18n-msg> </label>\n <ox-input-color value-key=\"color\" .value=${this.color}></ox-input-color>\n\n ${this.series.type == 'line'\n ? html`\n <label> <i18n-msg msgid=\"label.point-shape\">point shape</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.pointStyle\" .value=${this.series.pointStyle}>\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> <i18n-msg msgid=\"label.point-size\">point size</i18n-msg> </label>\n <input type=\"number\" value-key=\"series.pointRadius\" .value=${this.series.pointRadius} />\n `\n : html``} <label> <i18n-msg msgid=\"label.stack-group\">Stack group</i18n-msg> </label>\n <input type=\"text\" value-key=\"series.stack\" .value=${this.series.stack || ''} /> ${this.series.type ==\n 'line'\n ? html`\n <input type=\"checkbox\" value-key=\"series.fill\" .checked=${this.series.fill} />\n <label> <i18n-msg msgid=\"label.fill\">fill</i18n-msg> </label>\n `\n : html``}\n ${this.multiAxis\n ? html`\n <label> <i18n-msg msgid=\"label.target-axis\">target axis</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.yAxisID\" .value=${this.series.yAxisID}>\n <option value=\"left\">left</option>\n <option value=\"right\">right</option>\n </select>\n `\n : html``}\n ${this.displayValueTemplate()}\n </div>\n `\n )}\n </iron-pages>\n </div>\n `\n }\n\n _onTabScroll(e: Event) {\n if (!this.tabContainer) {\n return\n }\n\n if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {\n this.tabNavLeftButton.disabled = true\n this.tabNavRightButton.disabled = true\n }\n // left-end\n else if (this.tabContainer.scrollLeft == 0) {\n this.tabNavLeftButton.disabled = true\n this.tabNavRightButton.disabled = false\n }\n // right-end\n else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {\n this.tabNavLeftButton.disabled = false\n this.tabNavRightButton.disabled = true\n } else {\n this.tabNavLeftButton.disabled = false\n this.tabNavRightButton.disabled = false\n }\n }\n\n _onTabScrollNavLeft(e: Event) {\n if (!this.tabContainer) {\n return\n }\n\n this.tabContainer.style.scrollBehavior = 'smooth'\n this.tabContainer.scrollLeft -= this.tabContainer.clientWidth\n this.tabContainer.style.scrollBehavior = 'auto'\n }\n\n _onTabScrollNavRight(e: Event) {\n if (!this.tabContainer) {\n return\n }\n\n this.tabContainer.style.scrollBehavior = 'smooth'\n this.tabContainer.scrollLeft += this.tabContainer.clientWidth\n this.tabContainer.style.scrollBehavior = 'auto'\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"property-editor-chartjs-multi-series-abstract.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-multi-series-abstract.ts"],"names":[],"mappings":";AAAA,OAAO,gCAAgC,CAAA;AACvC,OAAO,8CAA8C,CAAA;AACrD,OAAO,gCAAgC,CAAA;AAEvC,OA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,CAAA;QACjD,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,MAAM,CAAA;IACjD,CAAC;IAED,oBAAoB,CAAC,CAAQ;QAC3B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,OAAM;SACP;QAED,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAA;QACjD,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAA;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,GAAG,MAAM,CAAA;IACjD,CAAC;;AAvXM,+CAAM,GAAG;IACd,GAAG,6BAA6B,CAAC,MAAM;IACvC,GAAG,CAAA;;;;;;;;KAQF;CACF,CAAA;AA2Be;IAAf,KAAK,CAAC,OAAO,CAAC;sEAAmB;AACH;IAA9B,KAAK,CAAC,sBAAsB,CAAC;kFAA0C;AACxC;IAA/B,KAAK,CAAC,uBAAuB,CAAC;mFAA2C","sourcesContent":["import '@polymer/iron-pages/iron-pages'\nimport '@polymer/paper-icon-button/paper-icon-button'\nimport '@polymer/paper-tabs/paper-tabs'\n\nimport { css, html } from 'lit'\nimport { query } from 'lit/decorators.js'\n\nimport { Properties } from '@hatiolab/things-scene'\nimport { PaperIconButtonElement } from '@polymer/paper-icon-button/paper-icon-button'\n\nimport PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract'\n\nexport default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEditorChartJSAbstract {\n static styles = [\n ...PropertyEditorChartJSAbstract.styles,\n css`\n paper-tabs {\n background-color: rgb(204, 204, 204);\n }\n input[type='text'],\n input[type='number'] {\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n `\n ]\n\n constructor() {\n super()\n\n this.value = {\n options: {\n legend: {},\n scales: {\n xAxes: [\n {\n ticks: {}\n }\n ],\n yAxes: [\n {\n ticks: {}\n }\n ]\n }\n },\n data: {\n datasets: []\n }\n }\n }\n\n @query('#tabs') tabs!: HTMLElement\n @query('#tab-nav-left-button') tabNavLeftButton!: PaperIconButtonElement\n @query('#tab-nav-right-button') tabNavRightButton!: PaperIconButtonElement\n\n get color() {\n var oldVersionColor = this.series.backgroundColor\n if (this.series.type == 'line') oldVersionColor = this.series.borderColor\n if (this.series.type == 'radar') oldVersionColor = this.series.borderColor\n return this.series.color || oldVersionColor\n }\n\n set color(color) {\n this.series.color = color\n delete this.series.backgroundColor\n delete this.series.borderColor\n }\n\n get xAxes0() {\n return this.scales.xAxes[0]\n }\n\n set xAxes0(xAxes0) {\n this.scales.xAxes[0] = xAxes0\n }\n\n get yAxes0() {\n return this.scales.yAxes[0]\n }\n\n set yAxes0(yAxes0) {\n this.scales.yAxes[0] = yAxes0\n }\n\n get yAxes1() {\n return this.scales.yAxes[1]\n }\n\n set yAxes1(yAxes1) {\n this.scales.yAxes[1] = yAxes1\n }\n\n get multiAxis() {\n return this.value.options.multiAxis\n }\n\n set multiAxis(multiAxis) {\n this.value.options.multiAxis = multiAxis\n }\n\n get tabContainer(): HTMLElement | null | undefined {\n return this.tabs.shadowRoot?.querySelector('#tabsContainer')\n }\n\n firstUpdated() {\n super.firstUpdated()\n\n this.tabContainer?.addEventListener('scroll', e => {\n this._onTabScroll(e)\n })\n }\n\n editorTemplate(props: Properties) {\n return html`\n <input type=\"checkbox\" value-key=\"multiAxis\" .checked=${this.multiAxis} />\n <label> <i18n-msg msgid=\"label.multi-axis\">Multi Axis</i18n-msg> </label>\n\n <legend><i18n-msg msgid=\"label.series\">Series</i18n-msg></legend>\n\n ${this.multiSeriesTabTemplate()}\n\n <legend><i18n-msg msgid=\"label.x-axes\">X Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.data-key\">Data Key</i18n-msg> </label>\n <input type=\"text\" value-key=\"labelDataKey\" .value=${this.labelDataKey} />\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"xAxes0.axisTitle\" .value=${this.xAxes0.axisTitle || ''} />\n\n <label> <i18n-msg msgid=\"label.thickness\">Thickness</i18n-msg> </label>\n <input type=\"number\" value-key=\"xAxes0.barPercentage\" .value=${this.xAxes0.barPercentage} />\n\n <input type=\"checkbox\" value-key=\"value.options.xGridLine\" .checked=${this.value.options.xGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"xAxes0.ticks.display\" .checked=${this.xAxes0.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n\n <legend><i18n-msg msgid=\"label.y-axes\">Y Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"yAxes0.axisTitle\" .value=${this.yAxes0.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.autoMin\" .checked=${this.yAxes0.ticks.autoMin} />\n <label> <i18n-msg msgid=\"label.axis-min-auto\">Min Auto</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.autoMax\" .checked=${this.yAxes0.ticks.autoMax} />\n <label> <i18n-msg msgid=\"label.axis-max-auto\">Max Auto</i18n-msg> </label>\n\n ${!this.yAxes0.ticks.autoMin\n ? html`\n <label> <i18n-msg msgid=\"label.axis-min\">Min</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.min\" .value=${this.yAxes0.ticks.min} />\n `\n : html``}\n ${!this.yAxes0.ticks.autoMax\n ? html`\n <label> <i18n-msg msgid=\"label.axis-max\">Max</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.max\" .value=${this.yAxes0.ticks.max} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.axis-step-size\">StepSize</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.stepSize\" .value=${this.yAxes0.ticks.stepSize} />\n\n <input type=\"checkbox\" value-key=\"value.options.yGridLine\" .checked=${this.value.options.yGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.display\" .checked=${this.yAxes0.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n\n ${this.value.options.multiAxis\n ? html`\n <legend><i18n-msg msgid=\"label.y-2nd-axes\">Y 2nd Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"yAxes1.axisTitle\" .value=${this.yAxes1.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.autoMin\" .checked=${this.yAxes1.ticks.autoMin} />\n <label> <i18n-msg msgid=\"label.axis-min-auto\">Min Auto</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.autoMax\" .checked=${this.yAxes1.ticks.autoMax} />\n <label> <i18n-msg msgid=\"label.axis-max-auto\">Max Auto</i18n-msg> </label>\n\n ${!this.yAxes1.ticks.autoMin\n ? html`\n <label> <i18n-msg msgid=\"label.axis-min\">Min</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.min\" .value=${this.yAxes1.ticks.min} />\n `\n : html``}\n ${!this.yAxes1.ticks.autoMax\n ? html`\n <label> <i18n-msg msgid=\"label.axis-max\">Max</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.max\" .value=${this.yAxes1.ticks.max} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.axis-step-size\">StepSize</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.stepSize\" .value=${this.yAxes1.ticks.stepSize} />\n\n <input type=\"checkbox\" value-key=\"value.options.y2ndGridLine\" .checked=${this.value.options.y2ndGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.display\" .checked=${this.yAxes1.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n `\n : html``}\n `\n }\n\n multiSeriesTabTemplate() {\n return html`\n <div id=\"series-properties-container\" fullwidth>\n <div id=\"tab-header\">\n <paper-icon-button\n id=\"tab-nav-left-button\"\n icon=\"chevron-left\"\n @click=${(e: Event) => {\n this._onTabScrollNavLeft(e)\n }}\n disabled\n ></paper-icon-button>\n <paper-tabs\n id=\"tabs\"\n @iron-select=${(e: Event) => (this.currentSeriesIndex = (e.target as any).selected)}\n .selected=${this.currentSeriesIndex}\n no-bar\n noink\n scrollable\n hide-scroll-buttons\n fit-container\n >\n ${this.datasets.map(\n (dataset: any, index: number) => html`\n <paper-tab data-series=\"${index + 1}\" noink\n >${index + 1}\n ${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)\n ? html`\n <paper-icon-button icon=\"close\" @tap=${(e: Event) => this.onTapRemoveCurrentTab(e)}>\n </paper-icon-button>\n `\n : html``}\n </paper-tab>\n `\n )}\n </paper-tabs>\n <paper-icon-button\n id=\"tab-nav-right-button\"\n icon=\"chevron-right\"\n @click=${(e: Event) => {\n this._onTabScrollNavRight(e)\n }}\n disabled\n ></paper-icon-button>\n </div>\n <div id=\"add-series-button-container\">\n <paper-icon-button\n id=\"add-series-button\"\n icon=\"add\"\n @tap=${(e: Event) => this.onTapAddTab(e)}\n ></paper-icon-button>\n </div>\n\n <iron-pages .selected=${this.currentSeriesIndex} .attr-for-selected=\"series-index\">\n ${this.datasets.map(\n (dataset: any, index: number) => html`\n <div class=\"tab-content\" series-index=\"${index}\">\n <label> <i18n-msg msgid=\"label.data-key\">Data Key</i18n-msg> </label>\n <input type=\"text\" value-key=\"dataKey\" .value=${this.dataKey} />\n\n ${this.value.type == 'bar'\n ? html`\n <label> <i18n-msg msgid=\"label.type\">type</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.type\" .value=${this.series.type}>\n <option value=\"bar\" selected>bar</option>\n <option value=\"line\">line</option>\n </select>\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.label\">label</i18n-msg> </label>\n <input type=\"text\" value-key=\"series.label\" .value=${this.series.label} />\n\n ${this.series.type == 'line'\n ? html`\n <label> <i18n-msg msgid=\"label.line-tension\">line tension</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.lineTension\" .value=${this.series.lineTension}>\n <option value=\"0.4\">smooth</option>\n <option value=\"0\">angled</option>\n </select>\n `\n : html``}\n ${this.series.type == 'line'\n ? html`\n <label> <i18n-msg msgid=\"label.border-width\">border width</i18n-msg> </label>\n <input type=\"number\" value-key=\"series.borderWidth\" .value=${this.series.borderWidth} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.color\">color</i18n-msg> </label>\n <ox-input-color value-key=\"color\" .value=${this.color}></ox-input-color>\n\n ${this.series.type == 'line'\n ? html`\n <label> <i18n-msg msgid=\"label.point-shape\">point shape</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.pointStyle\" .value=${this.series.pointStyle}>\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> <i18n-msg msgid=\"label.point-size\">point size</i18n-msg> </label>\n <input type=\"number\" value-key=\"series.pointRadius\" .value=${this.series.pointRadius} />\n `\n : html``} <label> <i18n-msg msgid=\"label.stack-group\">Stack group</i18n-msg> </label>\n <input type=\"text\" value-key=\"series.stack\" .value=${this.series.stack || ''} /> ${this.series.type ==\n 'line'\n ? html`\n <input type=\"checkbox\" value-key=\"series.fill\" .checked=${this.series.fill} />\n <label> <i18n-msg msgid=\"label.fill\">fill</i18n-msg> </label>\n `\n : html``}\n ${this.multiAxis\n ? html`\n <label> <i18n-msg msgid=\"label.target-axis\">target axis</i18n-msg> </label>\n <select class=\"select-content\" value-key=\"series.yAxisID\" .value=${this.series.yAxisID}>\n <option value=\"left\">left</option>\n <option value=\"right\">right</option>\n </select>\n `\n : html``}\n ${this.displayValueTemplate()}\n </div>\n `\n )}\n </iron-pages>\n </div>\n `\n }\n\n _onTabScroll(e: Event) {\n if (!this.tabContainer) {\n return\n }\n\n if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {\n this.tabNavLeftButton.disabled = true\n this.tabNavRightButton.disabled = true\n }\n // left-end\n else if (this.tabContainer.scrollLeft == 0) {\n this.tabNavLeftButton.disabled = true\n this.tabNavRightButton.disabled = false\n }\n // right-end\n else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {\n this.tabNavLeftButton.disabled = false\n this.tabNavRightButton.disabled = true\n } else {\n this.tabNavLeftButton.disabled = false\n this.tabNavRightButton.disabled = false\n }\n }\n\n _onTabScrollNavLeft(e: Event) {\n if (!this.tabContainer) {\n return\n }\n\n this.tabContainer.style.scrollBehavior = 'smooth'\n this.tabContainer.scrollLeft -= this.tabContainer.clientWidth\n this.tabContainer.style.scrollBehavior = 'auto'\n }\n\n _onTabScrollNavRight(e: Event) {\n if (!this.tabContainer) {\n return\n }\n\n this.tabContainer.style.scrollBehavior = 'smooth'\n this.tabContainer.scrollLeft += this.tabContainer.clientWidth\n this.tabContainer.style.scrollBehavior = 'auto'\n }\n}\n"]}
|
@@ -11,5 +11,5 @@ export default class PropertyEditorChartJSPie extends PropertyEditorChartJSAbstr
|
|
11
11
|
set color(color: any);
|
12
12
|
get displayValue(): any;
|
13
13
|
set displayValue(displayValue: any);
|
14
|
-
editorTemplate(props: Properties): import("lit").TemplateResult<1>;
|
14
|
+
editorTemplate(props: Properties): import("lit-html").TemplateResult<1>;
|
15
15
|
}
|
@@ -1,11 +1,7 @@
|
|
1
|
-
import '@polymer/iron-icon/iron-icon';
|
2
|
-
import '@polymer/paper-button/paper-button';
|
3
|
-
import '@polymer/paper-icon-button/paper-icon-button';
|
4
|
-
import '@polymer/paper-tabs/paper-tabs';
|
5
1
|
import { Properties } from '@hatiolab/things-scene';
|
6
2
|
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract';
|
7
3
|
export default class PropertyEditorChartJSRadar extends PropertyEditorChartJSMultiSeriesAbstract {
|
8
4
|
static styles: import("lit").CSSResult[];
|
9
5
|
constructor();
|
10
|
-
editorTemplate(props: Properties): import("lit").TemplateResult<1>;
|
6
|
+
editorTemplate(props: Properties): import("lit-html").TemplateResult<1>;
|
11
7
|
}
|
@@ -1,8 +1,4 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import '@polymer/iron-icon/iron-icon';
|
3
|
-
import '@polymer/paper-button/paper-button';
|
4
|
-
import '@polymer/paper-icon-button/paper-icon-button';
|
5
|
-
import '@polymer/paper-tabs/paper-tabs';
|
6
2
|
import { html } from 'lit';
|
7
3
|
import { customElement } from 'lit/decorators.js';
|
8
4
|
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property-editor-chartjs-radar.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-radar.ts"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"property-editor-chartjs-radar.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-radar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAIjD,OAAO,wCAAwC,MAAM,iDAAiD,CAAA;AAGtG,IAAqB,0BAA0B,GAA/C,MAAqB,0BAA2B,SAAQ,wCAAwC;IAG9F;QACE,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,KAAK,GAAG;YACX,OAAO,EAAE;gBACP,MAAM,EAAE,EAAE;aACX;YACD,IAAI,EAAE;gBACJ,QAAQ,EAAE,EAAE;aACb;SACF,CAAA;IACH,CAAC;IAED,cAAc,CAAC,KAAiB;QAC9B,OAAO,IAAI,CAAA;;;uBAGQ,IAAI,CAAC,sBAAsB,EAAE;;;;;2DAKO,IAAI,CAAC,YAAY;KACvE,CAAA;IACH,CAAC;CACF,CAAA;AA3BQ,iCAAM,GAAG,wCAAwC,CAAC,MAAM,CAAA;AAD5C,0BAA0B;IAD9C,aAAa,CAAC,+BAA+B,CAAC;GAC1B,0BAA0B,CA4B9C;eA5BoB,0BAA0B","sourcesContent":["import { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { Properties } from '@hatiolab/things-scene'\n\nimport PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract'\n\n@customElement('property-editor-chartjs-radar')\nexport default class PropertyEditorChartJSRadar extends PropertyEditorChartJSMultiSeriesAbstract {\n static styles = PropertyEditorChartJSMultiSeriesAbstract.styles\n\n constructor() {\n super()\n\n this.value = {\n options: {\n legend: {}\n },\n data: {\n datasets: []\n }\n }\n }\n\n editorTemplate(props: Properties) {\n return html`\n <legend><i18n-msg msgid=\"label.series\">Series</i18n-msg></legend>\n\n <div fullwidth>${this.multiSeriesTabTemplate()}</div>\n\n <legend><i18n-msg msgid=\"label.axes\">Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.data-key\">Data Key</i18n-msg> </label>\n <input type=\"text\" value-key=\"labelDataKey\" .value=${this.labelDataKey} />\n `\n }\n}\n"]}
|
@@ -1,14 +1,9 @@
|
|
1
|
-
import '@polymer/iron-icon';
|
2
|
-
import '@polymer/iron-icons';
|
3
|
-
import '@polymer/paper-icon-button';
|
4
|
-
import '@polymer/paper-tabs';
|
5
1
|
import './property-editor-chartjs-hbar';
|
6
2
|
import './property-editor-chartjs-mixed';
|
7
3
|
import './property-editor-chartjs-pie';
|
8
4
|
import './property-editor-chartjs-radar';
|
9
|
-
import { OxPropertyEditor } from '@operato/property-editor';
|
10
|
-
import { Properties } from '@hatiolab/things-scene';
|
5
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
|
11
6
|
export default class ChartJSEditor extends OxPropertyEditor {
|
12
7
|
static styles: import("lit").CSSResult[];
|
13
|
-
editorTemplate(
|
8
|
+
editorTemplate(value: any, spec: PropertySpec): import("lit-html").TemplateResult<1>;
|
14
9
|
}
|
@@ -1,42 +1,38 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
|
-
import '@polymer/iron-icon';
|
3
|
-
import '@polymer/iron-icons';
|
4
|
-
import '@polymer/paper-icon-button';
|
5
|
-
import '@polymer/paper-tabs';
|
6
2
|
import './property-editor-chartjs-hbar';
|
7
3
|
import './property-editor-chartjs-mixed';
|
8
4
|
import './property-editor-chartjs-pie';
|
9
5
|
import './property-editor-chartjs-radar';
|
10
6
|
import { css, html } from 'lit';
|
11
|
-
import { OxPropertyEditor } from '@operato/property-editor';
|
12
7
|
import { customElement } from 'lit/decorators.js';
|
8
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
13
9
|
let ChartJSEditor = class ChartJSEditor extends OxPropertyEditor {
|
14
|
-
editorTemplate(
|
10
|
+
editorTemplate(value, spec) {
|
15
11
|
return html `
|
16
|
-
${
|
12
|
+
${value
|
17
13
|
? html `
|
18
14
|
<div id="chart-type">
|
19
15
|
<label> <i18n-msg msgid="label.chart-type">Chart Type</i18n-msg> </label>
|
20
|
-
<input type="text" .value=${
|
16
|
+
<input type="text" .value=${value.type} readonly />
|
21
17
|
</div>
|
22
18
|
`
|
23
19
|
: html ``}
|
24
|
-
${!
|
20
|
+
${!value
|
25
21
|
? html ``
|
26
|
-
:
|
27
|
-
? html ` <property-editor-chartjs-mixed .value=${
|
28
|
-
:
|
29
|
-
? html ` <property-editor-chartjs-hbar .value=${
|
30
|
-
:
|
31
|
-
? html ` <property-editor-chartjs-mixed .value=${
|
32
|
-
:
|
33
|
-
? html ` <property-editor-chartjs-pie .value=${
|
34
|
-
:
|
35
|
-
? html ` <property-editor-chartjs-pie .value=${
|
36
|
-
:
|
37
|
-
? html ` <property-editor-chartjs-pie .value=${
|
38
|
-
:
|
39
|
-
? html ` <property-editor-chartjs-radar .value=${
|
22
|
+
: value.type == 'line'
|
23
|
+
? html ` <property-editor-chartjs-mixed .value=${value} fullwidth></property-editor-chartjs-mixed> `
|
24
|
+
: value.type == 'horizontalBar'
|
25
|
+
? html ` <property-editor-chartjs-hbar .value=${value} fullwidth></property-editor-chartjs-hbar> `
|
26
|
+
: value.type == 'bar'
|
27
|
+
? html ` <property-editor-chartjs-mixed .value=${value} fullwidth></property-editor-chartjs-mixed> `
|
28
|
+
: value.type == 'pie'
|
29
|
+
? html ` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `
|
30
|
+
: value.type == 'doughnut'
|
31
|
+
? html ` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `
|
32
|
+
: value.type == 'polarArea'
|
33
|
+
? html ` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `
|
34
|
+
: value.type == 'radar'
|
35
|
+
? html ` <property-editor-chartjs-radar .value=${value} fullwidth></property-editor-chartjs-radar> `
|
40
36
|
: html ``}
|
41
37
|
`;
|
42
38
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"property-editor-chartjs.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs.ts"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"property-editor-chartjs.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs.ts"],"names":[],"mappings":";AAAA,OAAO,gCAAgC,CAAA;AACvC,OAAO,iCAAiC,CAAA;AACxC,OAAO,+BAA+B,CAAA;AACtC,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAA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;;;;;;;;;;;;;;;;;KA6BF;CACF,CAAA;AAhCkB,aAAa;IADjC,aAAa,CAAC,yBAAyB,CAAC;GACpB,aAAa,CA+DjC;eA/DoB,aAAa","sourcesContent":["import './property-editor-chartjs-hbar'\nimport './property-editor-chartjs-mixed'\nimport './property-editor-chartjs-pie'\nimport './property-editor-chartjs-radar'\n\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec } from '@operato/property-editor'\n\n@customElement('property-editor-chartjs')\nexport default class ChartJSEditor extends OxPropertyEditor {\n static styles = [\n css`\n :host {\n display: block;\n padding: 5px;\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(--primary-text-color);\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 return html`\n ${value\n ? html`\n <div id=\"chart-type\">\n <label> <i18n-msg msgid=\"label.chart-type\">Chart Type</i18n-msg> </label>\n <input type=\"text\" .value=${value.type} readonly />\n </div>\n `\n : html``}\n ${!value\n ? html``\n : value.type == 'line'\n ? html` <property-editor-chartjs-mixed .value=${value} fullwidth></property-editor-chartjs-mixed> `\n : value.type == 'horizontalBar'\n ? html` <property-editor-chartjs-hbar .value=${value} fullwidth></property-editor-chartjs-hbar> `\n : value.type == 'bar'\n ? html` <property-editor-chartjs-mixed .value=${value} fullwidth></property-editor-chartjs-mixed> `\n : value.type == 'pie'\n ? html` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `\n : value.type == 'doughnut'\n ? html` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `\n : value.type == 'polarArea'\n ? html` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `\n : value.type == 'radar'\n ? html` <property-editor-chartjs-radar .value=${value} fullwidth></property-editor-chartjs-radar> `\n : html``}\n `\n }\n}\n"]}
|
package/dist/ox-chart.d.ts
CHANGED
@@ -10,7 +10,7 @@ export declare class OxChart extends LitElement {
|
|
10
10
|
private _chart?;
|
11
11
|
_canvas: HTMLCanvasElement;
|
12
12
|
firstUpdated(): void;
|
13
|
-
render(): import("lit").TemplateResult<1>;
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
14
14
|
updated(changes: PropertyValues<this>): void;
|
15
15
|
initChart(): void;
|
16
16
|
updateChartSize(): void;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@operato/scene-chartjs",
|
3
3
|
"description": "Things Scene ChartJS Component",
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.1",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "heartyoh",
|
7
7
|
"main": "dist/index.js",
|
@@ -27,10 +27,8 @@
|
|
27
27
|
},
|
28
28
|
"dependencies": {
|
29
29
|
"@ctrl/tinycolor": "^3.1.6",
|
30
|
-
"@hatiolab/things-scene": "^
|
31
|
-
"@polymer/iron-icon": "^3.0.1",
|
30
|
+
"@hatiolab/things-scene": "^3.0.19",
|
32
31
|
"@polymer/iron-pages": "^3.0.1",
|
33
|
-
"@polymer/paper-button": "^3.0.1",
|
34
32
|
"@polymer/paper-icon-button": "^3.0.2",
|
35
33
|
"@polymer/paper-tabs": "^3.1.0",
|
36
34
|
"@webcomponents/template": "^1.5.0",
|
@@ -41,14 +39,13 @@
|
|
41
39
|
"chartjs-plugin-datalabels": "^0.7.0",
|
42
40
|
"chartjs-plugin-style": "^0.5.0",
|
43
41
|
"core-js": "^3.16.0",
|
44
|
-
"lit": "^2.2.
|
42
|
+
"lit": "^2.2.7",
|
45
43
|
"regenerator-runtime": "^0.13.3"
|
46
44
|
},
|
47
45
|
"devDependencies": {
|
48
46
|
"@hatiolab/prettier-config": "^1.0.0",
|
49
|
-
"@
|
50
|
-
"@things-factory/
|
51
|
-
"@things-factory/operato-board": "^5.0.0-alpha.28",
|
47
|
+
"@things-factory/builder": "^5.0.0",
|
48
|
+
"@things-factory/operato-board": "^5.0.0",
|
52
49
|
"@types/chart.js": "2.9.34",
|
53
50
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
54
51
|
"@typescript-eslint/parser": "^4.33.0",
|
@@ -74,5 +71,5 @@
|
|
74
71
|
"prettier --write"
|
75
72
|
]
|
76
73
|
},
|
77
|
-
"gitHead": "
|
74
|
+
"gitHead": "e6fb800ef3b9e163dcb140c1229d4ed4ee7668d9"
|
78
75
|
}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import '@polymer/iron-icon/iron-icon'
|
2
|
-
import '@polymer/paper-button/paper-button'
|
3
1
|
import '@polymer/paper-icon-button/paper-icon-button'
|
4
2
|
import '@polymer/paper-tabs/paper-tabs'
|
3
|
+
import '@polymer/iron-pages/iron-pages'
|
5
4
|
|
6
|
-
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract'
|
7
|
-
import { customElement } from 'lit/decorators.js'
|
8
5
|
import { html } from 'lit'
|
6
|
+
import { customElement } from 'lit/decorators.js'
|
7
|
+
|
8
|
+
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract'
|
9
9
|
|
10
10
|
@customElement('property-editor-chartjs-hbar')
|
11
11
|
export default class PropertyEditorChartJSHBar extends PropertyEditorChartJSMultiSeriesAbstract {
|
@@ -1,9 +1,3 @@
|
|
1
|
-
import '@polymer/iron-icon/iron-icon'
|
2
|
-
import '@polymer/iron-pages/iron-pages'
|
3
|
-
import '@polymer/paper-button/paper-button'
|
4
|
-
import '@polymer/paper-icon-button/paper-icon-button'
|
5
|
-
import '@polymer/paper-tabs/paper-tabs'
|
6
|
-
|
7
1
|
import { html } from 'lit'
|
8
2
|
import { customElement } from 'lit/decorators.js'
|
9
3
|
|
@@ -1,15 +1,14 @@
|
|
1
|
-
import '@polymer/iron-icon/iron-icon'
|
2
1
|
import '@polymer/iron-pages/iron-pages'
|
3
|
-
import '@polymer/paper-button/paper-button'
|
4
2
|
import '@polymer/paper-icon-button/paper-icon-button'
|
5
3
|
import '@polymer/paper-tabs/paper-tabs'
|
6
4
|
|
7
5
|
import { css, html } from 'lit'
|
6
|
+
import { query } from 'lit/decorators.js'
|
8
7
|
|
9
|
-
import { PaperIconButtonElement } from '@polymer/paper-icon-button/paper-icon-button'
|
10
8
|
import { Properties } from '@hatiolab/things-scene'
|
9
|
+
import { PaperIconButtonElement } from '@polymer/paper-icon-button/paper-icon-button'
|
10
|
+
|
11
11
|
import PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract'
|
12
|
-
import { query } from 'lit/decorators.js'
|
13
12
|
|
14
13
|
export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEditorChartJSAbstract {
|
15
14
|
static styles = [
|
@@ -1,8 +1,3 @@
|
|
1
|
-
import '@polymer/iron-icon/iron-icon'
|
2
|
-
import '@polymer/paper-button/paper-button'
|
3
|
-
import '@polymer/paper-icon-button/paper-icon-button'
|
4
|
-
import '@polymer/paper-tabs/paper-tabs'
|
5
|
-
|
6
1
|
import { html } from 'lit'
|
7
2
|
import { customElement } from 'lit/decorators.js'
|
8
3
|
|
@@ -1,18 +1,13 @@
|
|
1
|
-
import '@polymer/iron-icon'
|
2
|
-
import '@polymer/iron-icons'
|
3
|
-
import '@polymer/paper-icon-button'
|
4
|
-
import '@polymer/paper-tabs'
|
5
1
|
import './property-editor-chartjs-hbar'
|
6
2
|
import './property-editor-chartjs-mixed'
|
7
3
|
import './property-editor-chartjs-pie'
|
8
4
|
import './property-editor-chartjs-radar'
|
9
5
|
|
10
6
|
import { css, html } from 'lit'
|
11
|
-
|
12
|
-
import { OxPropertyEditor } from '@operato/property-editor'
|
13
|
-
import { Properties } from '@hatiolab/things-scene'
|
14
7
|
import { customElement } from 'lit/decorators.js'
|
15
8
|
|
9
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor'
|
10
|
+
|
16
11
|
@customElement('property-editor-chartjs')
|
17
12
|
export default class ChartJSEditor extends OxPropertyEditor {
|
18
13
|
static styles = [
|
@@ -48,32 +43,32 @@ export default class ChartJSEditor extends OxPropertyEditor {
|
|
48
43
|
`
|
49
44
|
]
|
50
45
|
|
51
|
-
editorTemplate(
|
46
|
+
editorTemplate(value: any, spec: PropertySpec) {
|
52
47
|
return html`
|
53
|
-
${
|
48
|
+
${value
|
54
49
|
? html`
|
55
50
|
<div id="chart-type">
|
56
51
|
<label> <i18n-msg msgid="label.chart-type">Chart Type</i18n-msg> </label>
|
57
|
-
<input type="text" .value=${
|
52
|
+
<input type="text" .value=${value.type} readonly />
|
58
53
|
</div>
|
59
54
|
`
|
60
55
|
: html``}
|
61
|
-
${!
|
56
|
+
${!value
|
62
57
|
? html``
|
63
|
-
:
|
64
|
-
? html` <property-editor-chartjs-mixed .value=${
|
65
|
-
:
|
66
|
-
? html` <property-editor-chartjs-hbar .value=${
|
67
|
-
:
|
68
|
-
? html` <property-editor-chartjs-mixed .value=${
|
69
|
-
:
|
70
|
-
? html` <property-editor-chartjs-pie .value=${
|
71
|
-
:
|
72
|
-
? html` <property-editor-chartjs-pie .value=${
|
73
|
-
:
|
74
|
-
? html` <property-editor-chartjs-pie .value=${
|
75
|
-
:
|
76
|
-
? html` <property-editor-chartjs-radar .value=${
|
58
|
+
: value.type == 'line'
|
59
|
+
? html` <property-editor-chartjs-mixed .value=${value} fullwidth></property-editor-chartjs-mixed> `
|
60
|
+
: value.type == 'horizontalBar'
|
61
|
+
? html` <property-editor-chartjs-hbar .value=${value} fullwidth></property-editor-chartjs-hbar> `
|
62
|
+
: value.type == 'bar'
|
63
|
+
? html` <property-editor-chartjs-mixed .value=${value} fullwidth></property-editor-chartjs-mixed> `
|
64
|
+
: value.type == 'pie'
|
65
|
+
? html` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `
|
66
|
+
: value.type == 'doughnut'
|
67
|
+
? html` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `
|
68
|
+
: value.type == 'polarArea'
|
69
|
+
? html` <property-editor-chartjs-pie .value=${value} fullwidth></property-editor-chartjs-pie> `
|
70
|
+
: value.type == 'radar'
|
71
|
+
? html` <property-editor-chartjs-radar .value=${value} fullwidth></property-editor-chartjs-radar> `
|
77
72
|
: html``}
|
78
73
|
`
|
79
74
|
}
|