@oliasoft-open-source/charts-library 3.6.9-beta-8 → 3.6.9

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.
@@ -1,4 +1,4 @@
1
- export interface IAnnotationData {
1
+ interface IAnnotationData {
2
2
  annotationAxis?: string;
3
3
  color?: string;
4
4
  type?: string;
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "3.6.9-beta-8",
3
+ "version": "3.6.9",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
+ "resolutions": {
7
+ "jackspeak": "2.1.1"
8
+ },
6
9
  "bugs": {
7
10
  "url": "https://gitlab.com/oliasoft-open-source/charts-library/issues"
8
11
  },
@@ -12,15 +15,15 @@
12
15
  },
13
16
  "license": "MIT",
14
17
  "author": "Oliasoft AS and contributors",
15
- "main": "index.js",
18
+ "main": "./dist/index.js",
16
19
  "module": "./dist/index.js",
17
20
  "types": "./dist/index.d.ts",
18
21
  "files": [
19
22
  "dist"
20
23
  ],
21
24
  "scripts": {
22
- "build:package": "tsc && vite build",
23
- "build": "yarn build:package && storybook build --quiet --output-dir ./public/storybook",
25
+ "build:package": "vite build --config vite.config.mjs",
26
+ "build": "yarn build:package && storybook build --quiet --output-dir ./public",
24
27
  "dev:storybook": "storybook dev -p 6006",
25
28
  "lint:check": "eslint \"**/*.{js,jsx,ts,tsx}\"",
26
29
  "lint:fix": "eslint --fix \"**/*.{js,jsx,ts,tsx}\"",
@@ -53,7 +56,7 @@
53
56
  "react-use": "^17.4.0"
54
57
  },
55
58
  "devDependencies": {
56
- "@oliasoft-open-source/react-ui-library": "^3.11.10",
59
+ "@oliasoft-open-source/react-ui-library": "^3.11.9",
57
60
  "@oliasoft-open-source/units": "^3.4.2",
58
61
  "@storybook/addon-actions": "^7.0.18",
59
62
  "@storybook/addon-docs": "^7.0.18",
@@ -73,7 +76,6 @@
73
76
  "eslint-config-airbnb": "^19.0.4",
74
77
  "eslint-config-prettier": "^9.0.0",
75
78
  "eslint-import-resolver-alias": "^1.1.2",
76
- "eslint-import-resolver-typescript": "^3.6.1",
77
79
  "eslint-plugin-import": "^2.26.0",
78
80
  "eslint-plugin-jsx-a11y": "^6.6.1",
79
81
  "eslint-plugin-react": "^7.31.1",
@@ -91,23 +93,22 @@
91
93
  "prettier": "3.0.3",
92
94
  "react": "^18.2.0",
93
95
  "react-dom": "^18.2.0",
96
+ "rollup-plugin-peer-deps-external": "^2.2.4",
94
97
  "storybook": "^7.0.18",
95
98
  "storybook-dark-mode": "^3.0.0",
96
99
  "vite": "^4.3.9",
100
+ "vite-plugin-css-injected-by-js": "^3.1.1",
97
101
  "vite-plugin-dts": "3.6.0",
98
102
  "vite-tsconfig-paths": "^4.2.0",
99
103
  "vitest": "^0.34.6"
100
104
  },
101
105
  "peerDependencies": {
102
- "@oliasoft-open-source/react-ui-library": "^3.11.10",
106
+ "@oliasoft-open-source/react-ui-library": "^3.9.7",
103
107
  "@oliasoft-open-source/units": "^3.4.2",
104
108
  "classnames": "^2.3.2",
105
109
  "immer": "^10.0.2",
106
110
  "lodash": "^4.17.21",
107
111
  "react": "^17",
108
112
  "react-dom": "^17"
109
- },
110
- "resolutions": {
111
- "jackspeak": "2.1.1"
112
113
  }
113
114
  }
package/dist/global.css DELETED
@@ -1 +0,0 @@
1
- html[data-theme=dark] ._chart_1v6ps_1 canvas{filter:invert(1) hue-rotate(180deg)}html[data-theme=dark] ._chart_e3qdd_1 canvas{filter:invert(1) hue-rotate(180deg)}._chart_e3qdd_1{border:1px solid rgba(255,255,255,0);position:relative;display:flex;flex-direction:column;gap:8px}._chart_e3qdd_1 ._canvas_e3qdd_11{flex-grow:1;min-height:0;position:relative}._chart_e3qdd_1 ._canvas_e3qdd_11 canvas{width:100%!important;height:100%!important}._chart_e3qdd_1._fixedHeight_e3qdd_20{display:flex;align-items:flex-start;justify-content:flex-start;height:auto}._chart_e3qdd_1._stretchHeight_e3qdd_26{display:flex;align-items:stretch;justify-content:stretch;height:100%}._chart_e3qdd_1._squareAspectRatio_e3qdd_32{aspect-ratio:1;min-height:0;min-width:0}._chart_e3qdd_1:focus{outline:none}._chart_e3qdd_1::-moz-focus-inner{border:0}._zoomForm_e3qdd_43{position:absolute;display:flex;align-items:center;justify-content:center;top:0;right:0}._zoomForm_e3qdd_43 ._zoomReset_e3qdd_51{margin-left:10px}._zoomForm_e3qdd_43 ._help_e3qdd_54{margin-left:5px;line-height:0}._autoWeight_e3qdd_58{width:auto;height:auto}._table_e3qdd_62{overflow:auto}._controls_fa3yo_1{display:flex;align-items:center;flex-wrap:wrap;gap:8px}._buttons_fa3yo_7{display:flex;margin-left:auto;gap:4px}._legend_wpro0_1{position:absolute;opacity:.9;display:flex;flex-direction:column;z-index:1}._legend_wpro0_1._isDragging_wpro0_8{opacity:0}._legendItems_wpro0_11{background-color:var(--color-background-raised);border:1px solid var(--color-border);padding:4px 8px;border-radius:2px;overflow-y:auto;max-height:100%;overflow:overlay;--scrollbar-color: #00000040}._legendItems_wpro0_11::-webkit-scrollbar{display:block;width:16px;z-index:2}._legendItems_wpro0_11::-webkit-scrollbar-button{display:none}._legendItems_wpro0_11::-webkit-scrollbar-track{background-color:#0000}._legendItems_wpro0_11::-webkit-scrollbar-track-piece{background-color:#0000}._legendItems_wpro0_11::-webkit-scrollbar-thumb{background-color:#0000;border:5px solid transparent;border-radius:24px;box-shadow:4px 0 0 4px var(--scrollbar-color) inset}._legendItems_wpro0_11::-webkit-scrollbar-corner{background:rgba(0,0,0,0)}._legend_wpro0_1._isDragging_wpro0_8 ._legendItems_wpro0_11._legendItems_wpro0_11{pointer-events:none}._legend_wpro0_1._isHidden_wpro0_47 ._legendItems_wpro0_11._legendItems_wpro0_11{display:none}._legendToggle_wpro0_50{position:absolute;top:0;right:0;transform:translate(50%,-50%);display:none}._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50,._legend_wpro0_1:hover ._legendToggle_wpro0_50._legendToggle_wpro0_50{display:block}._legend_wpro0_1:active ._legendToggle_wpro0_50._legendToggle_wpro0_50:not(:hover){display:none}._legend_wpro0_1._isHidden_wpro0_47 ._legendToggle_wpro0_50._legendToggle_wpro0_50{position:static;transform:none}._legend_wpro0_1._isDragging_wpro0_8 ._legendToggle_wpro0_50._legendToggle_wpro0_50{display:none}._legendItem_wpro0_11{display:flex;align-items:flex-start;gap:8px;-webkit-user-select:none;user-select:none;cursor:pointer;font-size:12px;line-height:16px}._legendItemSymbol_wpro0_80{display:flex;align-items:center;height:16px;position:relative;flex-shrink:0}html[data-theme=dark] ._legendItemSymbol_wpro0_80._legendItemSymbol_wpro0_80{filter:invert(1) hue-rotate(180deg)}._legendItemBox_wpro0_90{width:100%;height:12px;display:block}._legendItemLine_wpro0_95{position:absolute;display:flex;top:50%;left:0;width:100%;transform:translateY(-50%)}._legendItemPoint_wpro0_103{position:absolute;display:flex;top:50%;left:50%;transform:translate(-50%,-50%)}._isHidden_wpro0_47 ._legendItemText_wpro0_110._legendItemText_wpro0_110{text-decoration:line-through}._scrollbars_wpro0_113{overflow:overlay;--scrollbar-color: #00000040}._scrollbars_wpro0_113::-webkit-scrollbar{display:block;width:16px;z-index:2}._scrollbars_wpro0_113::-webkit-scrollbar-button{display:none}._scrollbars_wpro0_113::-webkit-scrollbar-track{background-color:#0000}._scrollbars_wpro0_113::-webkit-scrollbar-track-piece{background-color:#0000}._scrollbars_wpro0_113::-webkit-scrollbar-thumb{background-color:#0000;border:5px solid transparent;border-radius:24px;box-shadow:4px 0 0 4px var(--scrollbar-color) inset}._scrollbars_wpro0_113::-webkit-scrollbar-corner{background:rgba(0,0,0,0)}._dropzoneContainer_wpro0_140{position:absolute}._dropzone_wpro0_140{position:absolute;width:50%;height:50%;display:flex}._dropzone_wpro0_140._left_wpro0_149{left:0;justify-content:flex-start}._dropzone_wpro0_140._right_wpro0_153{right:0;justify-content:flex-end}._dropzone_wpro0_140._top_wpro0_157{top:0;align-items:flex-start}._dropzone_wpro0_140._bottom_wpro0_161{bottom:0;align-items:flex-end}._dropzonePlaceholder_wpro0_165{position:absolute;background-color:#0000000d;display:none}[data-theme=dark] ._dropzonePlaceholder_wpro0_165{background-color:#ffffff0d}._isActive_wpro0_173 ._dropzonePlaceholder_wpro0_165._dropzonePlaceholder_wpro0_165{display:block}._resizeContainer_wpro0_176{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}html[data-theme=dark] ._chart_1jdnu_1 canvas{filter:invert(1) hue-rotate(180deg)}._chart_1jdnu_1{border:1px solid rgba(255,255,255,0);padding-top:10px;position:relative}._chart_1jdnu_1 canvas{width:100%!important;height:100%!important}._chart_1jdnu_1._fixedHeight_1jdnu_13{display:flex;align-items:flex-start;justify-content:flex-start;height:auto}._chart_1jdnu_1._stretchHeight_1jdnu_19{display:flex;align-items:stretch;justify-content:stretch;height:100%}._chart_1jdnu_1:focus{border:1px solid #85b7d9;outline:none}._chart_1jdnu_1::-moz-focus-inner{border:0}._zoomForm_1jdnu_32{position:absolute;display:flex;align-items:center;justify-content:center;top:0;right:0}._zoomForm_1jdnu_32 ._zoomReset_1jdnu_40{margin-left:10px}._zoomForm_1jdnu_32 ._help_1jdnu_43{margin-left:5px;line-height:0}._autoWeight_1jdnu_47{width:"auto";height:"auto"}html[data-theme=dark] ._chart_1t41j_1 canvas{filter:invert(1) hue-rotate(180deg)}._chart_1t41j_1{border:1px solid rgba(255,255,255,0);padding-top:10px;position:relative}._chart_1t41j_1 canvas{width:100%!important;height:100%!important}._chart_1t41j_1._fixedHeight_1t41j_13{display:flex;align-items:flex-start;justify-content:flex-start;height:auto}._chart_1t41j_1._stretchHeight_1t41j_19{display:flex;align-items:stretch;justify-content:stretch;height:100%}._chart_1t41j_1:focus{border:1px solid #85b7d9;outline:none}._chart_1t41j_1::-moz-focus-inner{border:0}._zoomForm_1t41j_32{position:absolute;display:flex;align-items:center;justify-content:center;top:0;right:0}._zoomForm_1t41j_32 ._zoomReset_1t41j_40{margin-left:10px}._zoomForm_1t41j_32 ._help_1t41j_43{margin-left:5px;line-height:0}._autoWeight_1t41j_47{width:auto;height:auto}
@@ -1,281 +0,0 @@
1
- import { Dispatch, RefObject } from 'react';
2
- import { Chart } from 'chart.js';
3
- import { IState } from '../state/state.interfaces';
4
- import { ILineChartDataset, ILineChartOptions } from '../line-chart.interface';
5
- import { ChartHoverMode, Events, PanZoomMode, PointStyle } from '../../common/helpers/enums';
6
- interface IUseChartOptions {
7
- chartRef: RefObject<Chart>;
8
- state: IState;
9
- options: ILineChartOptions;
10
- dispatch: Dispatch<any>;
11
- generatedDatasets: ILineChartDataset[];
12
- }
13
- /**
14
- * Custom hook to generate chart options.
15
- */
16
- export declare const useChartOptions: ({ chartRef, state, options, dispatch, generatedDatasets, }: IUseChartOptions) => {
17
- layout: {
18
- padding: string | number | {
19
- top: number;
20
- bottom: number;
21
- left: number;
22
- right: number;
23
- } | undefined;
24
- };
25
- onHover: (evt: import("chart.js").ChartEvent, hoveredItems: import("../../common/common.interface").ICommonHoveredItems[]) => void;
26
- maintainAspectRatio: boolean | undefined;
27
- aspectRatio: number;
28
- animation: boolean | {
29
- duration: number;
30
- onComplete: (() => void) | undefined;
31
- };
32
- hover: {
33
- mode: ChartHoverMode;
34
- intersect: boolean;
35
- };
36
- elements: {
37
- line: {
38
- pointStyle: PointStyle;
39
- showLine: boolean;
40
- };
41
- };
42
- scales: any;
43
- plugins: {
44
- datalabels: {
45
- display: string;
46
- align: (context: any) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
47
- formatter: (_value: any, context: import("chart.js").TooltipItem<any>) => any;
48
- } | {
49
- display: boolean;
50
- align?: undefined;
51
- formatter?: undefined;
52
- };
53
- annotation: {
54
- annotations: import("../../common/helpers/get-chart-annotation").IAnnotationData | undefined;
55
- };
56
- zoom: {
57
- pan: {
58
- enabled: boolean;
59
- mode: PanZoomMode;
60
- onPanComplete(): void;
61
- };
62
- zoom: {
63
- mode: PanZoomMode;
64
- drag: {
65
- enabled: boolean;
66
- threshold: number;
67
- backgroundColor: string;
68
- borderColor: string;
69
- borderWidth: number;
70
- };
71
- onZoomComplete(): void;
72
- };
73
- };
74
- tooltip: {
75
- enabled: boolean;
76
- mode: ChartHoverMode;
77
- intersect: boolean;
78
- padding: number;
79
- usePointStyle: boolean;
80
- boxWidth: number;
81
- boxHeight: number;
82
- boxPadding: number;
83
- callbacks: {
84
- title: (tooltipItem: any, _data: any) => string;
85
- label: (tooltipItem: any) => string;
86
- afterLabel: (tooltipItem: Record<string, any>) => string;
87
- };
88
- };
89
- legend: {
90
- display: boolean;
91
- position: import("../../common/helpers/enums").Position;
92
- align: string | undefined;
93
- labels: {
94
- boxHeight: number;
95
- boxWidth: number | undefined;
96
- usePointStyle: boolean | undefined;
97
- };
98
- onClick: (_e: any, legendItem: any) => void;
99
- };
100
- customLegendPlugin: {
101
- htmlLegend: {
102
- containerID: string;
103
- } | null | undefined;
104
- };
105
- chartAreaBorder: {
106
- borderColor: string;
107
- };
108
- chartAreaText: {
109
- showLabel: boolean | undefined;
110
- text: string | string[] | undefined;
111
- position: string | undefined;
112
- fontSize: number | undefined;
113
- xOffset: number | undefined;
114
- yOffset: number | undefined;
115
- maxWidth: number | undefined;
116
- lineHeight: number | undefined;
117
- };
118
- } | {
119
- dragData: {
120
- dragX: boolean | undefined;
121
- dragY: boolean | undefined;
122
- round: boolean | undefined;
123
- showTooltip: boolean | undefined;
124
- onDragStart: () => void;
125
- onDrag: () => void;
126
- onDragEnd: () => void;
127
- };
128
- datalabels: {
129
- display: string;
130
- align: (context: any) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
131
- formatter: (_value: any, context: import("chart.js").TooltipItem<any>) => any;
132
- } | {
133
- display: boolean;
134
- align?: undefined;
135
- formatter?: undefined;
136
- };
137
- annotation: {
138
- annotations: import("../../common/helpers/get-chart-annotation").IAnnotationData | undefined;
139
- };
140
- zoom: {
141
- pan: {
142
- enabled: boolean;
143
- mode: PanZoomMode;
144
- onPanComplete(): void;
145
- };
146
- zoom: {
147
- mode: PanZoomMode;
148
- drag: {
149
- enabled: boolean;
150
- threshold: number;
151
- backgroundColor: string;
152
- borderColor: string;
153
- borderWidth: number;
154
- };
155
- onZoomComplete(): void;
156
- };
157
- };
158
- tooltip: {
159
- enabled: boolean;
160
- mode: ChartHoverMode;
161
- intersect: boolean;
162
- padding: number;
163
- usePointStyle: boolean;
164
- boxWidth: number;
165
- boxHeight: number;
166
- boxPadding: number;
167
- callbacks: {
168
- title: (tooltipItem: any, _data: any) => string;
169
- label: (tooltipItem: any) => string;
170
- afterLabel: (tooltipItem: Record<string, any>) => string;
171
- };
172
- };
173
- legend: {
174
- display: boolean;
175
- position: import("../../common/helpers/enums").Position;
176
- align: string | undefined;
177
- labels: {
178
- boxHeight: number;
179
- boxWidth: number | undefined;
180
- usePointStyle: boolean | undefined;
181
- };
182
- onClick: (_e: any, legendItem: any) => void;
183
- };
184
- customLegendPlugin: {
185
- htmlLegend: {
186
- containerID: string;
187
- } | null | undefined;
188
- };
189
- chartAreaBorder: {
190
- borderColor: string;
191
- };
192
- chartAreaText: {
193
- showLabel: boolean | undefined;
194
- text: string | string[] | undefined;
195
- position: string | undefined;
196
- fontSize: number | undefined;
197
- xOffset: number | undefined;
198
- yOffset: number | undefined;
199
- maxWidth: number | undefined;
200
- lineHeight: number | undefined;
201
- };
202
- } | {
203
- dragData?: undefined;
204
- datalabels: {
205
- display: string;
206
- align: (context: any) => import("../../common/helpers/enums").AlignOptions.End | import("../../common/helpers/enums").AlignOptions.Start | import("../../common/helpers/enums").AlignOptions.Right | import("../../common/helpers/enums").AlignOptions.Left;
207
- formatter: (_value: any, context: import("chart.js").TooltipItem<any>) => any;
208
- } | {
209
- display: boolean;
210
- align?: undefined;
211
- formatter?: undefined;
212
- };
213
- annotation: {
214
- annotations: import("../../common/helpers/get-chart-annotation").IAnnotationData | undefined;
215
- };
216
- zoom: {
217
- pan: {
218
- enabled: boolean;
219
- mode: PanZoomMode;
220
- onPanComplete(): void;
221
- };
222
- zoom: {
223
- mode: PanZoomMode;
224
- drag: {
225
- enabled: boolean;
226
- threshold: number;
227
- backgroundColor: string;
228
- borderColor: string;
229
- borderWidth: number;
230
- };
231
- onZoomComplete(): void;
232
- };
233
- };
234
- tooltip: {
235
- enabled: boolean;
236
- mode: ChartHoverMode;
237
- intersect: boolean;
238
- padding: number;
239
- usePointStyle: boolean;
240
- boxWidth: number;
241
- boxHeight: number;
242
- boxPadding: number;
243
- callbacks: {
244
- title: (tooltipItem: any, _data: any) => string;
245
- label: (tooltipItem: any) => string;
246
- afterLabel: (tooltipItem: Record<string, any>) => string;
247
- };
248
- };
249
- legend: {
250
- display: boolean;
251
- position: import("../../common/helpers/enums").Position;
252
- align: string | undefined;
253
- labels: {
254
- boxHeight: number;
255
- boxWidth: number | undefined;
256
- usePointStyle: boolean | undefined;
257
- };
258
- onClick: (_e: any, legendItem: any) => void;
259
- };
260
- customLegendPlugin: {
261
- htmlLegend: {
262
- containerID: string;
263
- } | null | undefined;
264
- };
265
- chartAreaBorder: {
266
- borderColor: string;
267
- };
268
- chartAreaText: {
269
- showLabel: boolean | undefined;
270
- text: string | string[] | undefined;
271
- position: string | undefined;
272
- fontSize: number | undefined;
273
- xOffset: number | undefined;
274
- yOffset: number | undefined;
275
- maxWidth: number | undefined;
276
- lineHeight: number | undefined;
277
- };
278
- };
279
- events: Events[];
280
- };
281
- export {};
package/index.js DELETED
@@ -1,14 +0,0 @@
1
- /*
2
- Components
3
- */
4
-
5
- import ScatterChart from './src/components/scatter-chart/scatter-chart';
6
-
7
- export { LineChart } from './src/components/line-chart/line-chart';
8
- export { initializeLineChart } from './src/components/line-chart/initialize/initialize-line-chart';
9
-
10
- export { PieChart } from './src/components/pie-chart/pie-chart';
11
-
12
- export { BarChart } from './src/components/bar-chart/bar-chart';
13
-
14
- export { ScatterChart };