@kubit-ui-web/react-charts 0.1.0 → 1.0.0
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 +29 -36
- package/dist/types/charts/barChart/barChart.d.ts +5 -5
- package/dist/types/charts/barChart/barChart.type.d.ts +1 -1
- package/dist/types/charts/barChart/context/barChartContext.d.ts +1 -1
- package/dist/types/charts/barChart/fragments/barChartSeparator.d.ts +1 -1
- package/dist/types/charts/barChart/fragments/barChartXAxis.d.ts +1 -1
- package/dist/types/charts/barChart/fragments/barChartYAxis.d.ts +1 -1
- package/dist/types/charts/lineChart/context/lineChartContext.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartPath.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartProjection.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartSeparator.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartXAxis.d.ts +1 -1
- package/dist/types/charts/lineChart/lineChart.d.ts +5 -5
- package/dist/types/charts/lineChart/lineChart.type.d.ts +1 -1
- package/dist/types/charts/lineChart/lineChartStructure.d.ts +1 -1
- package/dist/types/charts/pieChart/context/pieChartContext.d.ts +1 -1
- package/dist/types/charts/pieChart/fragments/pieChartForeign.d.ts +1 -1
- package/dist/types/charts/pieChart/fragments/pieChartPath.d.ts +1 -1
- package/dist/types/charts/pieChart/pieChart.d.ts +3 -3
- package/dist/types/charts/pieChart/pieChart.type.d.ts +1 -1
- package/dist/types/charts/pieChart/pieChartStructure.d.ts +1 -1
- package/dist/types/components/axisChart/xAxis/xAxis.d.ts +1 -1
- package/dist/types/components/axisChart/yAxis/yAxis.d.ts +1 -1
- package/dist/types/components/bar/bar.d.ts +1 -1
- package/dist/types/components/bar/fragments/barChartSegment.d.ts +1 -1
- package/dist/types/components/chartText/chartText.d.ts +1 -1
- package/dist/types/components/foreignObject/foreignObject.d.ts +1 -1
- package/dist/types/components/foreignObject/foreignObject.types.d.ts +1 -1
- package/dist/types/components/line/line.d.ts +1 -1
- package/dist/types/components/node/components/circle/circle.d.ts +1 -1
- package/dist/types/components/node/components/hexagon/hexagon.d.ts +1 -1
- package/dist/types/components/node/components/pentagon/pentagon.d.ts +1 -1
- package/dist/types/components/node/components/square/square.d.ts +1 -1
- package/dist/types/components/node/components/star/star.d.ts +1 -1
- package/dist/types/components/node/components/straight/straight.d.ts +1 -1
- package/dist/types/components/node/components/triangle/triangle.d.ts +1 -1
- package/dist/types/components/node/node.d.ts +1 -1
- package/dist/types/components/path/components/nodePath/nodePath.d.ts +2 -2
- package/dist/types/components/path/path.d.ts +1 -1
- package/dist/types/components/path/path.types.d.ts +1 -1
- package/dist/types/components/plot/components/circle/circle.d.ts +1 -1
- package/dist/types/components/plot/components/square/square.d.ts +1 -1
- package/dist/types/components/plot/components/triangle/triangle.d.ts +1 -1
- package/dist/types/components/plot/plot.d.ts +1 -1
- package/dist/types/components/svgContainer/svgContainer.d.ts +1 -1
- package/dist/types/components/tick/tick.d.ts +1 -1
- package/dist/types/components/zoomArea/components/HandlerIcon.d.ts +1 -1
- package/dist/types/components/zoomArea/components/LineRenderer.d.ts +1 -1
- package/dist/types/components/zoomArea/components/SelectionArea.d.ts +1 -1
- package/dist/types/components/zoomArea/components/ZoomHandler.d.ts +1 -1
- package/dist/types/hooks/useFocus/useFocus.types.d.ts +1 -1
- package/dist/types/hooks/useHover/useHover.types.d.ts +1 -1
- package/dist/types/utils/getChildrenAttr/getChildrenAttr.d.ts +1 -1
- package/package.json +14 -15
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# Kubit React Charts
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<
|
|
4
|
+
<a href="https://kubit-ui.com">
|
|
5
|
+
<picture>
|
|
6
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/kubit-ui/kubit-react-charts/raw/cms/assets/readme_logo.png">
|
|
7
|
+
<img src="hhttps://github.com/kubit-ui/kubit-react-charts/raw/cms/assets/readme_logo.png" width="70%">
|
|
8
|
+
</picture>
|
|
9
|
+
</a>
|
|
5
10
|
</p>
|
|
6
11
|
|
|
7
12
|
<p align="center">
|
|
@@ -10,9 +15,10 @@
|
|
|
10
15
|
</p>
|
|
11
16
|
|
|
12
17
|
<p align="center">
|
|
18
|
+
<img src="https://img.shields.io/npm/v/@kubit-ui-web/react-charts" alt="Version" />
|
|
13
19
|
<img src="https://img.shields.io/badge/React-18.3.1-blue?logo=react" alt="React version" />
|
|
14
20
|
<img src="https://img.shields.io/badge/TypeScript-5.9.2-blue?logo=typescript" alt="TypeScript version" />
|
|
15
|
-
<img src="https://img.shields.io/badge/license-
|
|
21
|
+
<img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License" />
|
|
16
22
|
</p>
|
|
17
23
|
|
|
18
24
|
---
|
|
@@ -84,26 +90,24 @@ yarn add react react-dom
|
|
|
84
90
|
|
|
85
91
|
```typescript
|
|
86
92
|
// Import complete charts
|
|
87
|
-
import { BarChart, LineChart, PieChart } from
|
|
88
|
-
|
|
93
|
+
import { BarChart, LineChart, PieChart } from '@kubit-ui-web/react-charts';
|
|
89
94
|
// Import specific components
|
|
90
|
-
import {
|
|
91
|
-
|
|
95
|
+
import { Node, Path, Plot } from '@kubit-ui-web/react-charts/components';
|
|
92
96
|
// Import types
|
|
93
|
-
import type {
|
|
97
|
+
import type { BarOrientation, ChartData } from '@kubit-ui-web/react-charts/types';
|
|
94
98
|
```
|
|
95
99
|
|
|
96
100
|
### LineChart Example
|
|
97
101
|
|
|
98
102
|
```tsx
|
|
99
|
-
import
|
|
100
|
-
import
|
|
103
|
+
import { LineChart } from '@kubit-ui-web/react-charts';
|
|
104
|
+
import React from 'react';
|
|
101
105
|
|
|
102
106
|
const data = [
|
|
103
|
-
{ year:
|
|
104
|
-
{ year:
|
|
105
|
-
{ year:
|
|
106
|
-
{ year:
|
|
107
|
+
{ year: '2020', sales: 100, profit: 20 },
|
|
108
|
+
{ year: '2021', sales: 150, profit: 35 },
|
|
109
|
+
{ year: '2022', sales: 180, profit: 45 },
|
|
110
|
+
{ year: '2023', sales: 200, profit: 60 },
|
|
107
111
|
];
|
|
108
112
|
|
|
109
113
|
function MyLineChart() {
|
|
@@ -112,7 +116,7 @@ function MyLineChart() {
|
|
|
112
116
|
<LineChart.Path dataKey="sales" stroke="#0078D4" strokeWidth={2} />
|
|
113
117
|
<LineChart.Path dataKey="profit" stroke="#FF6B35" strokeWidth={2} />
|
|
114
118
|
<LineChart.XAxis position="BOTTOM" showTickLines />
|
|
115
|
-
<LineChart.YAxis position="LEFT" valueFormatter={
|
|
119
|
+
<LineChart.YAxis position="LEFT" valueFormatter={val => `$${val}k`} />
|
|
116
120
|
</LineChart>
|
|
117
121
|
);
|
|
118
122
|
}
|
|
@@ -121,14 +125,14 @@ function MyLineChart() {
|
|
|
121
125
|
### BarChart Example
|
|
122
126
|
|
|
123
127
|
```tsx
|
|
124
|
-
import
|
|
125
|
-
import
|
|
128
|
+
import { BarChart, BarOrientation } from '@kubit-ui-web/react-charts';
|
|
129
|
+
import React from 'react';
|
|
126
130
|
|
|
127
131
|
const data = [
|
|
128
|
-
{ category:
|
|
129
|
-
{ category:
|
|
130
|
-
{ category:
|
|
131
|
-
{ category:
|
|
132
|
+
{ category: 'A', value: 30 },
|
|
133
|
+
{ category: 'B', value: 45 },
|
|
134
|
+
{ category: 'C', value: 25 },
|
|
135
|
+
{ category: 'D', value: 60 },
|
|
132
136
|
];
|
|
133
137
|
|
|
134
138
|
function MyBarChart() {
|
|
@@ -146,7 +150,7 @@ function MyBarChart() {
|
|
|
146
150
|
dataIdx={0}
|
|
147
151
|
barConfig={{
|
|
148
152
|
barWidth: 40,
|
|
149
|
-
singleConfig: [{ color:
|
|
153
|
+
singleConfig: [{ color: '#0078D4', coverage: 100 }],
|
|
150
154
|
}}
|
|
151
155
|
/>
|
|
152
156
|
<BarChart.XAxis position="BOTTOM" />
|
|
@@ -322,7 +326,7 @@ yarn test-storybook
|
|
|
322
326
|
yarn eslint --fix
|
|
323
327
|
```
|
|
324
328
|
|
|
325
|
-
## Contributing
|
|
329
|
+
## Contributing
|
|
326
330
|
|
|
327
331
|
### Code Standards
|
|
328
332
|
|
|
@@ -333,18 +337,7 @@ yarn eslint --fix
|
|
|
333
337
|
|
|
334
338
|
### Contribution Workflow
|
|
335
339
|
|
|
336
|
-
|
|
337
|
-
2. Develop following project conventions
|
|
338
|
-
3. Write tests for new features
|
|
339
|
-
4. Run `yarn test` to verify
|
|
340
|
-
5. Create Pull Request
|
|
341
|
-
|
|
342
|
-
### Conventions
|
|
343
|
-
|
|
344
|
-
- **Commits**: Use conventional commits
|
|
345
|
-
- **Components**: Follow existing composition pattern
|
|
346
|
-
- **Tests**: One test file per component
|
|
347
|
-
- **Stories**: Document all use cases
|
|
340
|
+
See our [CONTRIBUTING](./CONTRIBUTING.md) for coding conventions, commit message guidelines, and pull request processes.
|
|
348
341
|
|
|
349
342
|
### Component Development Guidelines
|
|
350
343
|
|
|
@@ -359,10 +352,10 @@ Please refer to our [development instructions](./.github/copilot-instructions.md
|
|
|
359
352
|
|
|
360
353
|
## License
|
|
361
354
|
|
|
362
|
-
This project is licensed under the
|
|
355
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE](./LICENSE) file for details.
|
|
363
356
|
|
|
364
357
|
---
|
|
365
358
|
|
|
366
359
|
<p align="center">
|
|
367
|
-
Made with ❤️ by the <strong>Kubit</strong> team <img src="
|
|
360
|
+
Made with ❤️ by the <strong>Kubit</strong> team <img src="https://github.com/kubit-ui/kubit-react-charts/raw/cms/assets/kubito.png" alt="Kubito" width="15" height="15" />
|
|
368
361
|
</p>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const BarChart: import('
|
|
2
|
-
Path: import('
|
|
3
|
-
Separator: import('
|
|
4
|
-
XAxis: import('
|
|
5
|
-
YAxis: import('
|
|
1
|
+
declare const BarChart: import('react').FC<import('./barChart.type').BarChartProps> & {
|
|
2
|
+
Path: import('react').FC<import('./barChart.type').BarChartPathProps>;
|
|
3
|
+
Separator: import('react').FC<import('./barChart.type').BarChartSeparatorProps>;
|
|
4
|
+
XAxis: import('react').FC<import('./barChart.type').BarChartXAxisProps>;
|
|
5
|
+
YAxis: import('react').FC<import('./barChart.type').BarChartYAxisProps>;
|
|
6
6
|
};
|
|
7
7
|
export { BarChart };
|
|
8
8
|
export * from './barChart.type';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from '
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { XAxisProps } from '../../components/axisChart/xAxis/xAxis.types';
|
|
3
3
|
import { YAxisProps } from '../../components/axisChart/yAxis/yAxis.types';
|
|
4
4
|
import { BarChartStyles, BarOrientation } from '../../components/bar/bar.type';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BarChartContextType } from '../barChart.type';
|
|
2
|
-
export declare const BarChartContext: import('
|
|
2
|
+
export declare const BarChartContext: import('react').Context<BarChartContextType>;
|
|
3
3
|
//# sourceMappingURL=barChartContext.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LineChartContextType } from '../lineChart.type';
|
|
2
|
-
export declare const LineChartContext: import('
|
|
2
|
+
export declare const LineChartContext: import('react').Context<LineChartContextType>;
|
|
3
3
|
//# sourceMappingURL=lineChartContext.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { LineChartProjectionProps } from '../lineChart.type';
|
|
3
3
|
export declare const LineChartProjection: FC<LineChartProjectionProps>;
|
|
4
4
|
//# sourceMappingURL=lineChartProjection.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const LineChart: import('
|
|
2
|
-
Path: import('
|
|
3
|
-
Separator: import('
|
|
4
|
-
XAxis: import('
|
|
5
|
-
YAxis: import('
|
|
1
|
+
declare const LineChart: import('react').FC<import('./lineChart.type').LineChartProps> & {
|
|
2
|
+
Path: import('react').FC<import('./lineChart.type').LineChartPathProps>;
|
|
3
|
+
Separator: import('react').FC<import('./lineChart.type').LineChartSeparatorProps>;
|
|
4
|
+
XAxis: import('react').FC<import('./lineChart.type').LineChartXAxisProps>;
|
|
5
|
+
YAxis: import('react').FC<import('./lineChart.type').LineChartYAxisProps>;
|
|
6
6
|
};
|
|
7
7
|
export { LineChart };
|
|
8
8
|
export * from './lineChart.type';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from '
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { XAxisProps } from '../../components/axisChart/xAxis/xAxis.types';
|
|
3
3
|
import { YAxisProps } from '../../components/axisChart/yAxis/yAxis.types';
|
|
4
4
|
import { LineProps } from '../../components/line/line.types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PieChartContextType } from '../pieChart.type';
|
|
2
|
-
export declare const PieChartContext: import('
|
|
2
|
+
export declare const PieChartContext: import('react').Context<PieChartContextType>;
|
|
3
3
|
//# sourceMappingURL=pieChartContext.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { ForeignObjectProps } from '../../../components/foreignObject/foreignObject.types';
|
|
3
3
|
export declare const PieChartForeign: FC<ForeignObjectProps>;
|
|
4
4
|
//# sourceMappingURL=pieChartForeign.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const PieChart: import('
|
|
2
|
-
Foreign: import('
|
|
3
|
-
Path: import('
|
|
1
|
+
declare const PieChart: import('react').FC<import('./pieChart.type').PieChartProps> & {
|
|
2
|
+
Foreign: import('react').FC<import('../..').ForeignObjectProps>;
|
|
3
|
+
Path: import('react').FC<import('../..').PathProps>;
|
|
4
4
|
};
|
|
5
5
|
export { PieChart };
|
|
6
6
|
export * from './pieChart.type';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NodePathProps } from '../../path.types';
|
|
2
|
-
export declare const NodePath: import('
|
|
2
|
+
export declare const NodePath: import('react').ForwardRefExoticComponent<{
|
|
3
3
|
nodeConfig?: NodePathProps;
|
|
4
4
|
data?: {
|
|
5
5
|
index?: number;
|
|
@@ -10,5 +10,5 @@ export declare const NodePath: import('../../../../../node_modules/react').Forwa
|
|
|
10
10
|
x: number;
|
|
11
11
|
y: number;
|
|
12
12
|
tabIndex?: number;
|
|
13
|
-
} & import('
|
|
13
|
+
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
14
14
|
//# sourceMappingURL=nodePath.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PathProps } from './path.types';
|
|
2
|
-
export declare const Path: import('
|
|
2
|
+
export declare const Path: import('react').ForwardRefExoticComponent<PathProps & import('react').RefAttributes<unknown>>;
|
|
3
3
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, KeyboardEvent, MouseEvent, TouchEvent } from '
|
|
1
|
+
import { FC, KeyboardEvent, MouseEvent, TouchEvent } from 'react';
|
|
2
2
|
import { FocusConfig } from '../../../types/focusConfig.type';
|
|
3
3
|
import { ZoomAreaSelectionConfig, ZoomRange } from '../zoomArea.type';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyboardEvent, MouseEvent, TouchEvent } from '
|
|
1
|
+
import { KeyboardEvent, MouseEvent, TouchEvent } from 'react';
|
|
2
2
|
import { FocusConfig } from '../../../types/focusConfig.type';
|
|
3
3
|
import { ZoomAreaElements, ZoomAreaHandlerConfig } from '../zoomArea.type';
|
|
4
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubit-ui-web/react-charts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/kubit-ui-web-react-charts.cjs.js",
|
|
6
6
|
"module": "dist/kubit-ui-web-react-charts.es.js",
|
|
7
7
|
"unpkg": "dist/kubit-ui-web-react-charts.umd.js",
|
|
8
8
|
"jsdelivr": "dist/kubit-ui-web-react-charts.umd.js",
|
|
9
9
|
"types": "dist/types/index.d.ts",
|
|
10
|
-
"description": "
|
|
10
|
+
"description": "Modern React chart library with TypeScript support - Create beautiful, interactive, and accessible data visualizations with ease. Features bar charts, line charts, pie charts, and more!",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"react",
|
|
13
13
|
"charts",
|
|
14
14
|
"graphs",
|
|
15
|
-
"data-visualization",
|
|
16
15
|
"typescript",
|
|
17
16
|
"kubit",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
17
|
+
"components",
|
|
18
|
+
"visualization",
|
|
20
19
|
"accessible",
|
|
21
20
|
"customizable",
|
|
22
|
-
"responsive"
|
|
23
|
-
"storybook"
|
|
21
|
+
"responsive"
|
|
24
22
|
],
|
|
25
23
|
"exports": {
|
|
26
24
|
".": {
|
|
@@ -88,7 +86,6 @@
|
|
|
88
86
|
"!dist/**/**/stories"
|
|
89
87
|
],
|
|
90
88
|
"scripts": {
|
|
91
|
-
"jest": "jest",
|
|
92
89
|
"test:ci": "yarn test",
|
|
93
90
|
"eslint": "eslint src",
|
|
94
91
|
"custom-start": "echo -e '\n▐█µ ╓▓█▀ ▐█ j█▌ ╓▄ \n▐█▌,▄██─ ▓▌ ▓▌ ▐█▄▄▓▓█▓▄ ▓▌ @▓██▓▓▓\n▐██▀└╙██ █▌ █▌ ▐█─ └█▌ █▌ ██ \n▐█▌ ▀█▌ ██▄▄▄▄▀█▌ ▐██▄╓,▄██` █▌ ╙█▄▄▄'",
|
|
@@ -108,7 +105,7 @@
|
|
|
108
105
|
"storybook:axe": "yarn build && axe-storybook --build-dir bundle",
|
|
109
106
|
"createAssetsFiles": "node ./scripts/createAssetsFiles.js",
|
|
110
107
|
"prettier": "prettier 'src/**/*.ts' --write",
|
|
111
|
-
"test": "yarn run eslint --fix && yarn tsc && yarn vitest
|
|
108
|
+
"test": "yarn run eslint --fix && yarn tsc && yarn vitest --coverage.enabled=true --silent --run",
|
|
112
109
|
"test-storybook": "test-storybook",
|
|
113
110
|
"vitest": "vitest",
|
|
114
111
|
"vitest-report": "vitest --ui --coverage.enabled=true",
|
|
@@ -130,18 +127,20 @@
|
|
|
130
127
|
"url": "https://www.kubit-lab.com",
|
|
131
128
|
"email": "kubit.lab.dev@gmail.com"
|
|
132
129
|
},
|
|
130
|
+
"maintainers": [
|
|
131
|
+
{
|
|
132
|
+
"name": "Kubit Development Team",
|
|
133
|
+
"email": "kubit.lab.dev@gmail.com",
|
|
134
|
+
"url": "https://www.kubit-lab.com"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
133
137
|
"contributors": [
|
|
134
138
|
{
|
|
135
139
|
"name": "Kubit Development Team",
|
|
136
140
|
"url": "https://www.kubit-lab.com"
|
|
137
141
|
}
|
|
138
142
|
],
|
|
139
|
-
"license": "
|
|
140
|
-
"engines": {
|
|
141
|
-
"node": ">=16.0.0",
|
|
142
|
-
"npm": ">=7.0.0",
|
|
143
|
-
"yarn": ">=1.22.0"
|
|
144
|
-
},
|
|
143
|
+
"license": "Apache-2.0",
|
|
145
144
|
"publishConfig": {
|
|
146
145
|
"access": "public",
|
|
147
146
|
"registry": "https://registry.npmjs.org/"
|