@semcore/d3-chart 1.8.0 → 1.9.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/CHANGELOG.md +6 -0
- package/lib/cjs/Axis.js +3 -5
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +3 -3
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +3 -24
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/ClipPath.js +2 -1
- package/lib/cjs/ClipPath.js.map +1 -1
- package/lib/cjs/Donut.js +1 -1
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +1 -1
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +8 -8
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +3 -3
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Plot.js +15 -1
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/RadialTree.js +691 -0
- package/lib/cjs/RadialTree.js.map +1 -0
- package/lib/cjs/ResponsiveContainer.js +1 -1
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/StackBar.js +8 -8
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +8 -8
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +3 -7
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +2 -2
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/createElement.js +3 -2
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/plot.shadow.css +6 -0
- package/lib/cjs/style/radial-tree.shadow.css +23 -0
- package/lib/cjs/types/Area.d.ts +47 -0
- package/lib/cjs/types/Axis.d.ts +64 -0
- package/lib/cjs/types/Bar.d.ts +48 -0
- package/lib/cjs/types/Bubble.d.ts +27 -0
- package/lib/cjs/types/ClipPath.d.ts +26 -0
- package/lib/cjs/types/Donut.d.ts +42 -0
- package/lib/cjs/types/GroupBar.d.ts +20 -0
- package/lib/cjs/types/HorizontalBar.d.ts +29 -0
- package/lib/cjs/types/Hover.d.ts +15 -0
- package/lib/cjs/types/Line.d.ts +50 -0
- package/lib/cjs/types/Plot.d.ts +16 -0
- package/lib/cjs/types/ResponsiveContainer.d.ts +20 -0
- package/lib/cjs/types/ScatterPlot.d.ts +27 -0
- package/lib/cjs/types/StackBar.d.ts +26 -0
- package/lib/cjs/types/StackedArea.d.ts +26 -0
- package/lib/cjs/types/Tooltip.d.ts +31 -0
- package/lib/cjs/types/Venn.d.ts +45 -0
- package/lib/cjs/types/context.d.ts +6 -0
- package/lib/cjs/types/index.d.ts +53 -0
- package/lib/cjs/utils.js +120 -55
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Axis.js +3 -5
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +3 -3
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +3 -24
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/ClipPath.js +2 -1
- package/lib/es6/ClipPath.js.map +1 -1
- package/lib/es6/Donut.js +1 -1
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +1 -1
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +8 -8
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +3 -3
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Plot.js +17 -1
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/RadialTree.js +679 -0
- package/lib/es6/RadialTree.js.map +1 -0
- package/lib/es6/ResponsiveContainer.js +1 -1
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/StackBar.js +8 -8
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +8 -8
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +3 -7
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +2 -2
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/createElement.js +3 -2
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/plot.shadow.css +6 -0
- package/lib/es6/style/radial-tree.shadow.css +23 -0
- package/lib/es6/types/Area.d.ts +47 -0
- package/lib/es6/types/Axis.d.ts +64 -0
- package/lib/es6/types/Bar.d.ts +48 -0
- package/lib/es6/types/Bubble.d.ts +27 -0
- package/lib/es6/types/ClipPath.d.ts +26 -0
- package/lib/es6/types/Donut.d.ts +42 -0
- package/lib/es6/types/GroupBar.d.ts +20 -0
- package/lib/es6/types/HorizontalBar.d.ts +29 -0
- package/lib/es6/types/Hover.d.ts +15 -0
- package/lib/es6/types/Line.d.ts +50 -0
- package/lib/es6/types/Plot.d.ts +16 -0
- package/lib/es6/types/ResponsiveContainer.d.ts +20 -0
- package/lib/es6/types/ScatterPlot.d.ts +27 -0
- package/lib/es6/types/StackBar.d.ts +26 -0
- package/lib/es6/types/StackedArea.d.ts +26 -0
- package/lib/es6/types/Tooltip.d.ts +31 -0
- package/lib/es6/types/Venn.d.ts +45 -0
- package/lib/es6/types/context.d.ts +6 -0
- package/lib/es6/types/index.d.ts +53 -0
- package/lib/es6/utils.js +95 -44
- package/lib/es6/utils.js.map +1 -1
- package/lib/types/RadialTree.d.ts +202 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/utils.d.ts +27 -0
- package/package.json +17 -10
- package/src/Bubble.jsx +1 -21
- package/src/ClipPath.jsx +1 -0
- package/src/Donut.jsx +7 -9
- package/src/Plot.jsx +2 -0
- package/src/RadialTree.tsx +768 -0
- package/src/createElement.jsx +3 -1
- package/src/index.js +1 -0
- package/src/style/plot.shadow.css +6 -0
- package/src/style/radial-tree.shadow.css +23 -0
- package/src/types/index.d.ts +6 -0
- package/src/utils.ts +227 -0
- package/src/utils.js +0 -147
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IXAxisProps extends IContext {
|
|
5
|
+
/** The position of the axis relative chart
|
|
6
|
+
* @default 'button' */
|
|
7
|
+
position?: 'top' | 'right' | 'bottom' | 'left' | number;
|
|
8
|
+
/** Element hide property
|
|
9
|
+
* @default false */
|
|
10
|
+
hide?: boolean;
|
|
11
|
+
/** Values for axis ticks */
|
|
12
|
+
ticks?: any[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IYAxisProps extends IContext {
|
|
16
|
+
/** The position of the axis relative chart
|
|
17
|
+
* @default 'left' */
|
|
18
|
+
position?: 'top' | 'right' | 'bottom' | 'left' | number;
|
|
19
|
+
/** Element hide property
|
|
20
|
+
* @default true */
|
|
21
|
+
hide?: boolean;
|
|
22
|
+
/** Values for axis ticks */
|
|
23
|
+
ticks?: any[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IAxisTicksProps extends IContext {
|
|
27
|
+
/** The position of the axis relative chart */
|
|
28
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
29
|
+
/** Element hide property */
|
|
30
|
+
hide?: boolean;
|
|
31
|
+
/** Values for axis ticks */
|
|
32
|
+
ticks?: any[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IAxisGridProps extends IContext {
|
|
36
|
+
/** Values for axis ticks */
|
|
37
|
+
ticks?: any[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IAxisTitleProps extends IContext {
|
|
41
|
+
/** The position of the axis relative chart */
|
|
42
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface IAxisTicksContext {
|
|
46
|
+
/** Value element of data */
|
|
47
|
+
value: any;
|
|
48
|
+
/** Index element of data */
|
|
49
|
+
index: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare const XAxis: (<T>(props: CProps<IXAxisProps & T>) => ReturnEl) & {
|
|
53
|
+
Ticks: <T>(props: CProps<IAxisTicksProps & T, IAxisTicksContext>) => ReturnEl;
|
|
54
|
+
Grid: <T>(props: CProps<IAxisGridProps & T>) => ReturnEl;
|
|
55
|
+
Title: <T>(props: CProps<IAxisTitleProps & T>) => ReturnEl;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare const YAxis: (<T>(props: CProps<IYAxisProps & T>) => ReturnEl) & {
|
|
59
|
+
Ticks: <T>(props: CProps<IAxisTicksProps & T, IAxisTicksContext>) => ReturnEl;
|
|
60
|
+
Grid: <T>(props: CProps<IAxisGridProps & T>) => ReturnEl;
|
|
61
|
+
Title: <T>(props: CProps<IAxisTitleProps & T>) => ReturnEl;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { XAxis, YAxis };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IBarProps extends IContext {
|
|
5
|
+
/** Field from data for XAxis */
|
|
6
|
+
x?: string;
|
|
7
|
+
/** Field from data for YAxis */
|
|
8
|
+
y?: string;
|
|
9
|
+
/** Line color
|
|
10
|
+
* @default '#50aef4'*/
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Element hide property */
|
|
13
|
+
hide?: boolean;
|
|
14
|
+
/** Animation duration in ms
|
|
15
|
+
* @default 500
|
|
16
|
+
*/
|
|
17
|
+
duration?: number;
|
|
18
|
+
/** Radius of curvature
|
|
19
|
+
* @default 2
|
|
20
|
+
*/
|
|
21
|
+
r?: number | number[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IBarContext {
|
|
25
|
+
/** Value element of data */
|
|
26
|
+
value: any;
|
|
27
|
+
/** Index element of data */
|
|
28
|
+
index: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface IBackgroundProps extends IContext {
|
|
32
|
+
/** Coordinate x */
|
|
33
|
+
x?: number | string;
|
|
34
|
+
/** Coordinate y */
|
|
35
|
+
y?: number | string;
|
|
36
|
+
/** Value element of data */
|
|
37
|
+
value?: any;
|
|
38
|
+
/** Width rect */
|
|
39
|
+
width?: number | string;
|
|
40
|
+
/** Height rect */
|
|
41
|
+
height?: number | string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const Bar: (<T>(props: CProps<IBarProps & T, IBarContext>) => ReturnEl) & {
|
|
45
|
+
Background: <T>(props: CProps<IBackgroundProps & T>) => ReturnEl;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default Bar;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IBubbleProps extends IContext {
|
|
5
|
+
/** Field from data for XAxis */
|
|
6
|
+
x: string;
|
|
7
|
+
/** Field from data for YAxis */
|
|
8
|
+
y: string;
|
|
9
|
+
/** Field from data for circle radius */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Field from data for circle label */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Circle color */
|
|
14
|
+
color?: string;
|
|
15
|
+
/** Cross in the center of the bubble
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
markedCross?: boolean;
|
|
19
|
+
/** Animation duration in ms
|
|
20
|
+
* @default 500
|
|
21
|
+
*/
|
|
22
|
+
duration?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const Bubble: <T>(props: CProps<IBubbleProps & T>) => ReturnEl;
|
|
26
|
+
|
|
27
|
+
export default Bubble;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
|
|
4
|
+
export interface IClipPath {
|
|
5
|
+
/**
|
|
6
|
+
* HTML tag name for the displayed item
|
|
7
|
+
* @default rect
|
|
8
|
+
*/
|
|
9
|
+
tag?: string;
|
|
10
|
+
/**
|
|
11
|
+
* HTML selector
|
|
12
|
+
*/
|
|
13
|
+
id?: string;
|
|
14
|
+
/**
|
|
15
|
+
* CSS property
|
|
16
|
+
*/
|
|
17
|
+
transition?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Function which run after mounted clipPath
|
|
20
|
+
*/
|
|
21
|
+
setAttributeTag?: (rect: React.ReactNode) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const ClipPath: <T>(props: CProps<IClipPath & T>) => ReturnEl;
|
|
25
|
+
|
|
26
|
+
export default ClipPath;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IDonutProps extends IContext {
|
|
5
|
+
/** Inner radius
|
|
6
|
+
* @default 0
|
|
7
|
+
* */
|
|
8
|
+
innerRadius?: number;
|
|
9
|
+
/** Outer radius
|
|
10
|
+
* @default calculated by the formula from width, height
|
|
11
|
+
* */
|
|
12
|
+
outerRadius?: number;
|
|
13
|
+
/** Semi donut */
|
|
14
|
+
halfsize?: boolean;
|
|
15
|
+
/** Animation duration in ms
|
|
16
|
+
* @default 500
|
|
17
|
+
*/
|
|
18
|
+
duration?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface IPieProps extends IContext {
|
|
22
|
+
/**
|
|
23
|
+
* Name of the field in the data
|
|
24
|
+
* */
|
|
25
|
+
dataKey: string;
|
|
26
|
+
/** Color pie
|
|
27
|
+
@default #50aef4
|
|
28
|
+
**/
|
|
29
|
+
color?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface IEmptyDataProps extends IContext {}
|
|
33
|
+
|
|
34
|
+
export interface ILabelProps extends IContext {}
|
|
35
|
+
|
|
36
|
+
declare const Donut: (<T>(props: CProps<IDonutProps & T>) => ReturnEl) & {
|
|
37
|
+
Pie: <T>(props: CProps<IPieProps & T>) => ReturnEl;
|
|
38
|
+
EmptyData: <T>(props: CProps<IEmptyDataProps & T>) => ReturnEl;
|
|
39
|
+
Label: <T>(props: CProps<ILabelProps & T>) => ReturnEl;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Donut;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import { IBarContext, IBarProps } from './Bar';
|
|
3
|
+
import { IHorizontalBarProps } from './HorizontalBar';
|
|
4
|
+
import IContext from './context';
|
|
5
|
+
|
|
6
|
+
export interface IGroupBarProps extends IContext {
|
|
7
|
+
/** Field from data for XAxis */
|
|
8
|
+
x?: string;
|
|
9
|
+
/** Field from data for YAxis */
|
|
10
|
+
y?: string;
|
|
11
|
+
/** Scale for group bars */
|
|
12
|
+
scaleGroup?: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare const GroupBar: (<T>(props: CProps<IGroupBarProps & T>) => ReturnEl) & {
|
|
16
|
+
Bar: <T>(props: CProps<IBarProps & T, IBarContext>) => ReturnEl;
|
|
17
|
+
HorizontalBar: <T>(props: CProps<IHorizontalBarProps & T, IBarContext>) => ReturnEl;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default GroupBar;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
import { IBarContext, IBackgroundProps } from './Bar';
|
|
4
|
+
|
|
5
|
+
export interface IHorizontalBarProps extends IContext {
|
|
6
|
+
/** Field from data for XAxis */
|
|
7
|
+
x?: string;
|
|
8
|
+
/** Field from data for YAxis */
|
|
9
|
+
y?: string;
|
|
10
|
+
/** Line color
|
|
11
|
+
* @default '#50aef4'*/
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Animation duration in ms
|
|
14
|
+
* @default 500
|
|
15
|
+
*/
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** Radius of curvature
|
|
18
|
+
* @default 2
|
|
19
|
+
*/
|
|
20
|
+
r?: number | number[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare const HorizontalBar: (<T>(
|
|
24
|
+
props: CProps<IHorizontalBarProps & T, IBarContext>,
|
|
25
|
+
) => ReturnEl) & {
|
|
26
|
+
Background: <T>(props: CProps<IBackgroundProps & T>) => ReturnEl;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default HorizontalBar;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IHoverProps extends IContext {
|
|
5
|
+
/** Field from data for XAxis */
|
|
6
|
+
x?: string;
|
|
7
|
+
/** Field from data for YAxis */
|
|
8
|
+
y?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const HoverLine: <T>(props: CProps<IHoverProps & T>) => ReturnEl;
|
|
12
|
+
|
|
13
|
+
declare const HoverRect: <T>(props: CProps<IHoverProps & T>) => ReturnEl;
|
|
14
|
+
|
|
15
|
+
export { HoverLine, HoverRect };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
import { CurveFactory } from 'd3-shape';
|
|
4
|
+
import { IFadeInOutProps } from '@semcore/animation';
|
|
5
|
+
|
|
6
|
+
export interface ILineProps extends IContext {
|
|
7
|
+
/** Field from data for XAxis */
|
|
8
|
+
x?: string;
|
|
9
|
+
/** Field from data for YAxis */
|
|
10
|
+
y?: string;
|
|
11
|
+
/** Line color
|
|
12
|
+
* @default '#50aef4'*/
|
|
13
|
+
color?: string;
|
|
14
|
+
/** Element hide property */
|
|
15
|
+
hide?: boolean;
|
|
16
|
+
/** Curve method */
|
|
17
|
+
curve?: CurveFactory;
|
|
18
|
+
/** Animation duration in ms
|
|
19
|
+
* @default 500
|
|
20
|
+
*/
|
|
21
|
+
duration?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ILineDotsProps extends IContext, IFadeInOutProps {
|
|
25
|
+
/** Show all Dot */
|
|
26
|
+
display?: boolean;
|
|
27
|
+
/** Hide property */
|
|
28
|
+
hide?: boolean;
|
|
29
|
+
/** Index active of element */
|
|
30
|
+
activeIndex?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ILineDotsContext {
|
|
34
|
+
/** Value element of data */
|
|
35
|
+
value?: any;
|
|
36
|
+
/** Index element of data */
|
|
37
|
+
index?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ILineNullProps extends IContext {
|
|
41
|
+
/** Hide property */
|
|
42
|
+
hide?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const Line: (<T>(props: CProps<ILineProps & T>) => ReturnEl) & {
|
|
46
|
+
Dots: <T>(props: CProps<ILineDotsProps & T, ILineDotsContext>) => ReturnEl;
|
|
47
|
+
Null: <T>(props: CProps<ILineNullProps & T>) => ReturnEl;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default Line;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
import IContext from './context';
|
|
4
|
+
|
|
5
|
+
export interface IPlotProps extends IContext, IBoxProps {
|
|
6
|
+
/** Width of the svg element
|
|
7
|
+
* @default 0*/
|
|
8
|
+
width?: number;
|
|
9
|
+
/** Height of the svg element
|
|
10
|
+
* @default 0*/
|
|
11
|
+
height?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const Plot: <T>(props: CProps<IPlotProps & T>) => ReturnEl;
|
|
15
|
+
|
|
16
|
+
export default Plot;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
|
|
4
|
+
export interface IResponsiveContainerProps extends IBoxProps {
|
|
5
|
+
/** Relation between height and width dimensions block */
|
|
6
|
+
aspect?: number;
|
|
7
|
+
/** Callback which will be called after changing the block size */
|
|
8
|
+
onResize?: (size: [number, number], entries: ResizeObserverEntry[]) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IResponsiveContainerContext {
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare const ResponsiveContainer: <T>(
|
|
17
|
+
props: CProps<IResponsiveContainerProps & T, IResponsiveContainerContext>,
|
|
18
|
+
) => ReturnEl;
|
|
19
|
+
|
|
20
|
+
export default ResponsiveContainer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IScatterPlotProps extends IContext {
|
|
5
|
+
/** Field from data for XAxis */
|
|
6
|
+
x: string;
|
|
7
|
+
/** Field from data for YAxis */
|
|
8
|
+
y: string;
|
|
9
|
+
/** Field from data for circle value */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Circle color */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Circle value color */
|
|
14
|
+
valueColor?: string;
|
|
15
|
+
/** Animation duration in ms
|
|
16
|
+
* @default 500
|
|
17
|
+
*/
|
|
18
|
+
duration?: number;
|
|
19
|
+
/** Radius of circles
|
|
20
|
+
* @default 5.5 or 12 with value
|
|
21
|
+
*/
|
|
22
|
+
r?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const ScatterPlot: <T>(props: CProps<IScatterPlotProps & T>) => ReturnEl;
|
|
26
|
+
|
|
27
|
+
export default ScatterPlot;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
import { IBarContext, IBarProps } from './Bar';
|
|
4
|
+
import { IHorizontalBarProps } from './HorizontalBar';
|
|
5
|
+
|
|
6
|
+
export interface IStackBarProps extends IContext {
|
|
7
|
+
/** Field from data for XAxis */
|
|
8
|
+
x?: string;
|
|
9
|
+
/** Field from data for YAxis */
|
|
10
|
+
y?: string;
|
|
11
|
+
/** Stack generators
|
|
12
|
+
* @default d3.stack() */
|
|
13
|
+
stack?: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IStackBarContext {
|
|
17
|
+
/** Series is an array of points, where each point corresponds to the element in the input data. */
|
|
18
|
+
series: any[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare const StackBar: (<T>(props: CProps<IStackBarProps & T, IStackBarContext>) => ReturnEl) & {
|
|
22
|
+
Bar: <T>(props: CProps<IBarProps & T, IBarContext>) => ReturnEl;
|
|
23
|
+
HorizontalBar: <T>(props: CProps<IHorizontalBarProps & T, IBarContext>) => ReturnEl;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default StackBar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
import Area from './Area';
|
|
4
|
+
|
|
5
|
+
export interface IStackedAreaProps extends IContext {
|
|
6
|
+
/** Field from data for XAxis */
|
|
7
|
+
x?: string;
|
|
8
|
+
/** Field from data for YAxis */
|
|
9
|
+
y?: string;
|
|
10
|
+
/** Stack generators
|
|
11
|
+
* @default d3.stack() */
|
|
12
|
+
stack?: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IStackedAreaContext {
|
|
16
|
+
/** Series is an array of points, where each point corresponds to the element in the input data. */
|
|
17
|
+
series: any[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare const StackedArea: (<T>(
|
|
21
|
+
props: CProps<IStackedAreaProps & T, IStackedAreaContext>,
|
|
22
|
+
) => ReturnEl) & {
|
|
23
|
+
Area: typeof Area;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default StackedArea;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import Popper, { IPopperProps, IPopperTriggerProps } from '@semcore/popper';
|
|
3
|
+
import { CProps, PropGetterFn, ReturnEl } from '@semcore/core';
|
|
4
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
5
|
+
import IContext from './context';
|
|
6
|
+
|
|
7
|
+
export interface ITooltipProps extends IPopperProps, IPopperTriggerProps, IContext {
|
|
8
|
+
/** Field from data for XAxis */
|
|
9
|
+
x?: string;
|
|
10
|
+
/** Field from data for YAxis */
|
|
11
|
+
y?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ITooltipContext {
|
|
15
|
+
getTriggerProps: PropGetterFn;
|
|
16
|
+
getPopperProps: PropGetterFn;
|
|
17
|
+
/** Index active value for Axis x */
|
|
18
|
+
xIndex: number | null;
|
|
19
|
+
/** Index active value for Axis y */
|
|
20
|
+
yIndex: number | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare const Tooltip: (<T>(props: CProps<ITooltipProps & T, ITooltipContext>) => ReturnEl) & {
|
|
24
|
+
Trigger: <T>(props: CProps<ComponentProps<typeof Popper.Trigger> & T>) => ReturnEl;
|
|
25
|
+
Popper: <T>(props: CProps<ComponentProps<typeof Popper.Popper> & T>) => ReturnEl;
|
|
26
|
+
Title: <T>(props: CProps<IBoxProps & T>) => ReturnEl;
|
|
27
|
+
Dot: <T>(props: CProps<IBoxProps & { color?: string } & T>) => ReturnEl;
|
|
28
|
+
Footer: <T>(props: CProps<T>) => null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default Tooltip;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
import { IFadeInOutProps } from '@semcore/animation';
|
|
4
|
+
|
|
5
|
+
export interface IVennProps extends IContext, IFadeInOutProps {
|
|
6
|
+
/**
|
|
7
|
+
* Rotate sets in the chart
|
|
8
|
+
* @default Math.PI / 2
|
|
9
|
+
*/
|
|
10
|
+
orientation?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The function for sorting sets inside the chart
|
|
13
|
+
* @default (circle1, circle2) => circle2.radius - circle1.radius
|
|
14
|
+
*/
|
|
15
|
+
orientationOrder?: (c1: number, c2: number) => number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ICircleProps extends IContext {
|
|
19
|
+
/**
|
|
20
|
+
* Name of the field in the data
|
|
21
|
+
* */
|
|
22
|
+
dataKey: string;
|
|
23
|
+
/** Color circle
|
|
24
|
+
@default #3AB011
|
|
25
|
+
**/
|
|
26
|
+
color?: string;
|
|
27
|
+
/** Animation duration in ms
|
|
28
|
+
* @default 500
|
|
29
|
+
*/
|
|
30
|
+
duration?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IIntersectionProps extends IContext, IFadeInOutProps {
|
|
34
|
+
/**
|
|
35
|
+
* Name of the field in the data
|
|
36
|
+
* */
|
|
37
|
+
dataKey: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare const Venn: (<T>(props: CProps<IVennProps & T>) => ReturnEl) & {
|
|
41
|
+
Circle: <T>(props: CProps<ICircleProps & T>) => ReturnEl;
|
|
42
|
+
Intersection: <T>(props: CProps<IIntersectionProps & T>) => ReturnEl;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default Venn;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Utils
|
|
2
|
+
export declare function minMax(data: any, key: string | number): any;
|
|
3
|
+
|
|
4
|
+
// Color
|
|
5
|
+
export declare const colors: { [key: string]: string };
|
|
6
|
+
|
|
7
|
+
export { default as Plot } from './Plot';
|
|
8
|
+
export * from './Plot';
|
|
9
|
+
|
|
10
|
+
export * from './Axis';
|
|
11
|
+
export * from './Hover';
|
|
12
|
+
|
|
13
|
+
export { default as ResponsiveContainer } from './ResponsiveContainer';
|
|
14
|
+
export * from './ResponsiveContainer';
|
|
15
|
+
|
|
16
|
+
export { default as Line } from './Line';
|
|
17
|
+
export * from './Line';
|
|
18
|
+
|
|
19
|
+
export { default as Bar } from './Bar';
|
|
20
|
+
export * from './Bar';
|
|
21
|
+
|
|
22
|
+
export { default as HorizontalBar } from './HorizontalBar';
|
|
23
|
+
export * from './HorizontalBar';
|
|
24
|
+
|
|
25
|
+
export { default as GroupBar } from './GroupBar';
|
|
26
|
+
export * from './GroupBar';
|
|
27
|
+
|
|
28
|
+
export { default as StackBar } from './StackBar';
|
|
29
|
+
export * from './StackBar';
|
|
30
|
+
|
|
31
|
+
export { default as Area } from './Area';
|
|
32
|
+
export * from './Area';
|
|
33
|
+
|
|
34
|
+
export { default as StackedArea } from './StackedArea';
|
|
35
|
+
export * from './StackedArea';
|
|
36
|
+
|
|
37
|
+
/** It becomes resolvable after building and moving file to lib dir */
|
|
38
|
+
// eslint-disable-next-line import/no-unresolved
|
|
39
|
+
export { default as RadialTree } from './RadialTree';
|
|
40
|
+
// eslint-disable-next-line import/no-unresolved
|
|
41
|
+
export * from './RadialTree';
|
|
42
|
+
|
|
43
|
+
export { default as Donut } from './Donut';
|
|
44
|
+
export * from './Donut';
|
|
45
|
+
|
|
46
|
+
export { default as Tooltip } from './Tooltip';
|
|
47
|
+
export * from './Tooltip';
|
|
48
|
+
|
|
49
|
+
export { default as ScatterPlot } from './ScatterPlot';
|
|
50
|
+
export * from './ScatterPlot';
|
|
51
|
+
|
|
52
|
+
export { default as Bubble } from './Bubble';
|
|
53
|
+
export * from './Bubble';
|