@c2n/chart 0.0.7 → 0.0.8
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/README.md +44 -14
- package/dist/area-chart.js +2 -2
- package/dist/bar-chart.js +4 -3
- package/dist/candlestick-chart.js +139 -0
- package/dist/{chart-base-C4-1TyKq.js → chart-base-BwPwRgHt.js} +89 -10
- package/dist/chart-base.js +1 -1
- package/dist/chart-legend-DJE3HO7C.js +49 -0
- package/dist/chart-legend.js +2 -0
- package/dist/chart-link-C9vN9Y6c.js +75 -0
- package/dist/chart-series.js +75 -1
- package/dist/chart-tooltip-J-oC2DKZ.js +130 -0
- package/dist/chart-tooltip.js +2 -0
- package/dist/chart.js +10 -5
- package/dist/decorate-BkO8ArQg.js +9 -0
- package/dist/{echarts-chart-base-LogCQN10.js → echarts-chart-base-6JsZbB05.js} +2 -4
- package/dist/echarts-chart-base.js +1 -1
- package/dist/gauge-chart.js +103 -0
- package/dist/line-chart.js +4 -3
- package/dist/pie-chart.js +11 -2
- package/dist/scatter-chart.js +40 -0
- package/dist/sparkline.js +4 -4
- package/dist/{uplot-chart-base-BWr0zJE2.js → uplot-chart-base-CDHzOLwa.js} +21 -5
- package/dist/uplot-chart-base.js +1 -1
- package/dist/{uplot-paths-ChKohvIX.js → uplot-paths-BRtF33Wh.js} +1 -1
- package/package.json +26 -3
- package/react.d.ts +10 -0
- package/types/src/candlestick-chart.d.ts +52 -0
- package/types/src/candlestick-chart.d.ts.map +1 -0
- package/types/src/chart-base.d.ts +31 -1
- package/types/src/chart-base.d.ts.map +1 -1
- package/types/src/chart-legend.d.ts +37 -0
- package/types/src/chart-legend.d.ts.map +1 -0
- package/types/src/chart-link.d.ts +26 -0
- package/types/src/chart-link.d.ts.map +1 -0
- package/types/src/chart-tooltip.d.ts +42 -0
- package/types/src/chart-tooltip.d.ts.map +1 -0
- package/types/src/chart.d.ts +11 -1
- package/types/src/chart.d.ts.map +1 -1
- package/types/src/engines/echarts-loader.d.ts +1 -1
- package/types/src/engines/echarts-loader.d.ts.map +1 -1
- package/types/src/engines/uplot-adapter.d.ts.map +1 -1
- package/types/src/gauge-chart.d.ts +52 -0
- package/types/src/gauge-chart.d.ts.map +1 -0
- package/types/src/pie-chart.d.ts +3 -0
- package/types/src/pie-chart.d.ts.map +1 -1
- package/types/src/scatter-chart.d.ts +41 -0
- package/types/src/scatter-chart.d.ts.map +1 -0
- package/vue.d.ts +81 -0
- package/dist/chart-series-BnpHO3lm.js +0 -83
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { property } from "lit/decorators.js";
|
|
2
|
-
import { customElement } from "@c2n/core/element-helper.js";
|
|
3
|
-
import { LitElement, css } from "lit";
|
|
4
|
-
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorate.js
|
|
5
|
-
function __decorate(decorators, target, key, desc) {
|
|
6
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/chart-series.ts
|
|
13
|
-
/** Fired at the parent chart whenever a series definition changes. */
|
|
14
|
-
var SERIES_CHANGE_EVENT = "c2-chart-series-change";
|
|
15
|
-
/** The tag, so a chart can match a definition by name rather than by class identity. */
|
|
16
|
-
var SERIES_TAG = "c2-chart-series";
|
|
17
|
-
var ChartSeries = class ChartSeries extends LitElement {
|
|
18
|
-
constructor(..._args) {
|
|
19
|
-
super(..._args);
|
|
20
|
-
this.field = "";
|
|
21
|
-
this.axis = "left";
|
|
22
|
-
this.spanGaps = false;
|
|
23
|
-
this.hidden = false;
|
|
24
|
-
}
|
|
25
|
-
static {
|
|
26
|
-
this.styles = css`
|
|
27
|
-
:host {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
/** A plain snapshot of this definition, so the chart never holds a reference to the element. */
|
|
33
|
-
toConfig() {
|
|
34
|
-
return {
|
|
35
|
-
field: this.field,
|
|
36
|
-
label: this.label,
|
|
37
|
-
color: this.color,
|
|
38
|
-
lineWidth: this.lineWidth,
|
|
39
|
-
axis: this.axis,
|
|
40
|
-
spanGaps: this.spanGaps,
|
|
41
|
-
hidden: this.hidden,
|
|
42
|
-
format: this.format
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
connectedCallback() {
|
|
46
|
-
super.connectedCallback();
|
|
47
|
-
this.#notify();
|
|
48
|
-
}
|
|
49
|
-
disconnectedCallback() {
|
|
50
|
-
super.disconnectedCallback();
|
|
51
|
-
this.#notify();
|
|
52
|
-
}
|
|
53
|
-
updated(_changed) {
|
|
54
|
-
this.#notify();
|
|
55
|
-
}
|
|
56
|
-
/** Composed so it crosses the shadow boundary of a chart that wraps its slot; the chart stops it there. */
|
|
57
|
-
#notify() {
|
|
58
|
-
this.dispatchEvent(new CustomEvent(SERIES_CHANGE_EVENT, {
|
|
59
|
-
bubbles: true,
|
|
60
|
-
composed: true
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
__decorate([property({ type: String })], ChartSeries.prototype, "field", void 0);
|
|
65
|
-
__decorate([property({ type: String })], ChartSeries.prototype, "label", void 0);
|
|
66
|
-
__decorate([property({ type: String })], ChartSeries.prototype, "color", void 0);
|
|
67
|
-
__decorate([property({
|
|
68
|
-
type: Number,
|
|
69
|
-
attribute: "line-width"
|
|
70
|
-
})], ChartSeries.prototype, "lineWidth", void 0);
|
|
71
|
-
__decorate([property({ type: String })], ChartSeries.prototype, "axis", void 0);
|
|
72
|
-
__decorate([property({
|
|
73
|
-
type: Boolean,
|
|
74
|
-
attribute: "span-gaps"
|
|
75
|
-
})], ChartSeries.prototype, "spanGaps", void 0);
|
|
76
|
-
__decorate([property({
|
|
77
|
-
type: Boolean,
|
|
78
|
-
reflect: true
|
|
79
|
-
})], ChartSeries.prototype, "hidden", void 0);
|
|
80
|
-
__decorate([property({ attribute: false })], ChartSeries.prototype, "format", void 0);
|
|
81
|
-
ChartSeries = __decorate([customElement("c2-chart-series")], ChartSeries);
|
|
82
|
-
//#endregion
|
|
83
|
-
export { __decorate as i, SERIES_CHANGE_EVENT as n, SERIES_TAG as r, ChartSeries as t };
|