@record-evolution/widget-linechart 1.4.9 → 1.4.11

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent widget-linechart following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "widget-linechart",
6
- "version": "1.4.9",
6
+ "version": "1.4.11",
7
7
  "type": "module",
8
8
  "main": "dist/widget-linechart.js",
9
9
  "types": "dist/src/widget-linechart.d.ts",
@@ -14,8 +14,9 @@
14
14
  "scripts": {
15
15
  "analyze": "cem analyze --litelement",
16
16
  "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
17
- "build": "rollup -c rollup.config.js --bundleConfigAsCjs",
18
- "watch": "rollup -w -c rollup.config.js --bundleConfigAsCjs",
17
+ "build": "rollup -c rollup.config.js",
18
+ "watch": "rollup -w -c rollup.config.js",
19
+ "types": "cat src/definition-schema.json | json2ts > src/definition-schema.d.ts",
19
20
  "release": "npm version patch --tag-version-prefix='' && git push && git push --tag"
20
21
  },
21
22
  "dependencies": {
@@ -39,6 +40,7 @@
39
40
  "@types/tinycolor2": "^1.4.6",
40
41
  "@web/dev-server": "^0.4.0",
41
42
  "concurrently": "^8.2.2",
43
+ "json-schema-to-typescript": "^13.1.1",
42
44
  "tslib": "^2.6.2",
43
45
  "typescript": "^5.2.2"
44
46
  },
@@ -0,0 +1,115 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export type Title = string;
9
+ export type Subtitle = string;
10
+ /**
11
+ * This will apply a proper time series x-Axis. Check if your x-values are timestamps.
12
+ */
13
+ export type TimeseriesChart = boolean;
14
+ export type XAxisLabel = string;
15
+ export type YAxisLabel = string;
16
+ /**
17
+ * When multiple charts are drawn, then they will be layed out horizontically or vertically.
18
+ */
19
+ export type VerticalLayout = boolean;
20
+ /**
21
+ * The name for this data series
22
+ */
23
+ export type Label = string;
24
+ /**
25
+ * Determines the draw order of the series. Dataseries with lower numbers are drawn on top of ones with higher numbers.
26
+ */
27
+ export type DrawOrder = number;
28
+ /**
29
+ * If two dataseries have the same 'Chart' name, they will be drawn in the same chart. Otherwise they will get their own chart. If the name ends with #pivot# then a separat chart will be drawn for each pivoted dataseries.
30
+ */
31
+ export type Chart = string;
32
+ export type DrawingStyle = "bar" | "line" | "bubble";
33
+ /**
34
+ * To disable points, set this to 0.
35
+ */
36
+ export type PointRadius = number;
37
+ export type PointStyle =
38
+ | "circle"
39
+ | "cross"
40
+ | "crossRot"
41
+ | "dash"
42
+ | "line"
43
+ | "rect"
44
+ | "rectRounded"
45
+ | "rectRot"
46
+ | "star"
47
+ | "triangle";
48
+ /**
49
+ * The inner color of the bars if you chose Drawing Type 'bar' or the inner colors of the points if you chose Drawing Type 'line'.
50
+ */
51
+ export type PointOrBarColor = string;
52
+ export type LineColor = string;
53
+ /**
54
+ * In case of Drawing Type 'bar' this determines the bar's border line width.
55
+ */
56
+ export type LineWidth = number;
57
+ /**
58
+ * Specify dash length and space-between-dashes length like this: [10, 5].
59
+ */
60
+ export type LineDashStyle = string;
61
+ /**
62
+ * Check this box to turn a line chart into an area chart.
63
+ */
64
+ export type LineAreaFill = boolean;
65
+ /**
66
+ * Valid only for Bubble Chart type.
67
+ */
68
+ export type PointRadius1 = number;
69
+ /**
70
+ * You can specify a column in the input data to autogenerate dataseries for each distinct entry in this column. E.g. if you have a table with columns [city, timestamp, temperature] and specify 'city' as pivot column, then you will get a line for each city.
71
+ */
72
+ export type PivotColumn = string;
73
+ /**
74
+ * The data used to draw this data series.
75
+ */
76
+ export type Data = {
77
+ /**
78
+ * If timeseries is checked in the settings, then this should be an ISO String date like 2023-11-04T22:47:52.351152+00:00. But this works with many other formats as well.
79
+ */
80
+ x: string;
81
+ y: number;
82
+ r?: PointRadius1;
83
+ pivot?: PivotColumn;
84
+ [k: string]: unknown;
85
+ }[];
86
+ export type Dataseries = {
87
+ label: Label;
88
+ order?: DrawOrder;
89
+ chartName?: Chart;
90
+ type: DrawingStyle;
91
+ radius?: PointRadius;
92
+ pointStyle?: PointStyle;
93
+ backgroundColor?: PointOrBarColor;
94
+ borderColor?: LineColor;
95
+ borderWidth?: LineWidth;
96
+ borderDash?: LineDashStyle;
97
+ fill?: LineAreaFill;
98
+ data?: Data;
99
+ [k: string]: unknown;
100
+ }[];
101
+
102
+ export interface ConfigureTheChart {
103
+ settings?: GlobalSettings;
104
+ dataseries?: Dataseries;
105
+ [k: string]: unknown;
106
+ }
107
+ export interface GlobalSettings {
108
+ title?: Title;
109
+ subTitle?: Subtitle;
110
+ timeseries?: TimeseriesChart;
111
+ xAxisLabel?: XAxisLabel;
112
+ yAxisLabel?: YAxisLabel;
113
+ columnLayout?: VerticalLayout;
114
+ [k: string]: unknown;
115
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  {
3
2
  "title": "Configure the Chart",
4
3
  "type": "object",
@@ -86,18 +85,31 @@
86
85
  "pointStyle": {
87
86
  "title": "Point Style",
88
87
  "type": "string",
89
- "enum": ["circle", "cross", "crossRot", "dash", "line", "rect", "rectRounded", "rectRot", "star", "triangle"],
88
+ "enum": [
89
+ "circle",
90
+ "cross",
91
+ "crossRot",
92
+ "dash",
93
+ "line",
94
+ "rect",
95
+ "rectRounded",
96
+ "rectRot",
97
+ "star",
98
+ "triangle"
99
+ ],
90
100
  "order": 7
91
101
  },
92
102
  "backgroundColor": {
93
103
  "title": "Point or Bar Color",
94
104
  "description": "The inner color of the bars if you chose Drawing Type 'bar' or the inner colors of the points if you chose Drawing Type 'line'.",
95
105
  "type": "color",
106
+ "color": true,
96
107
  "order": 8
97
108
  },
98
109
  "borderColor": {
99
110
  "title": "Line Color",
100
111
  "type": "color",
112
+ "color": true,
101
113
  "order": 9
102
114
  },
103
115
  "borderWidth": {