@fluentui/react-charting 5.16.29 → 5.16.31
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.json +37 -1
- package/CHANGELOG.md +21 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/HorizontalBarChartWithAxis.d.ts +1 -0
- package/lib/HorizontalBarChartWithAxis.js +2 -0
- package/lib/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.base.d.ts +2 -0
- package/lib/components/CommonComponents/CartesianChart.base.js +72 -12
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +13 -0
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +57 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +487 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.d.ts +3 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +6 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.d.ts +2 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +12 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +100 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +2 -0
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib/components/HorizontalBarChartWithAxis/index.d.ts +2 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js +3 -0
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types/IDataPoint.d.ts +38 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/utilities/utilities.d.ts +53 -8
- package/lib/utilities/utilities.js +170 -7
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/lib-amd/HorizontalBarChartWithAxis.d.ts +1 -0
- package/lib-amd/HorizontalBarChartWithAxis.js +6 -0
- package/lib-amd/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +2 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +71 -11
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +13 -0
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +57 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +482 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.d.ts +3 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +8 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.d.ts +2 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +17 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +100 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +5 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/index.d.ts +2 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/index.js +7 -0
- package/lib-amd/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib-amd/index.d.ts +1 -0
- package/lib-amd/index.js +2 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IDataPoint.d.ts +38 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +53 -8
- package/lib-amd/utilities/utilities.js +181 -10
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-amd/version.js +1 -1
- package/lib-amd/version.js.map +1 -1
- package/lib-commonjs/HorizontalBarChartWithAxis.d.ts +1 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js +5 -0
- package/lib-commonjs/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +2 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +71 -11
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +13 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +57 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +490 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.d.ts +3 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +9 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.d.ts +2 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js +16 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +100 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js +3 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.d.ts +2 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js +6 -0
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -0
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IDataPoint.d.ts +38 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +53 -8
- package/lib-commonjs/utilities/utilities.js +181 -10
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/version.js +1 -1
- package/lib-commonjs/version.js.map +1 -1
- package/package.json +6 -5
- package/src/components/CommonComponents/CartesianChart.types.ts +16 -0
- package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +125 -0
package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalBarChartWithAxis.styles.js","sourceRoot":"../src/","sources":["components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.styles.ts"],"names":[],"mappings":";;;;AAEO,IAAM,SAAS,GAAG,UAAC,KAA4C;IAC5D,IAAA,eAAe,GAAY,KAAK,gBAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;IACzC,OAAO;QACL,oBAAoB,EAAE;YACpB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;SACtC;QAED,UAAU,EAAE,EAAE;QAEd,OAAO,wCACF,KAAK,CAAC,KAAK,CAAC,MAAM,KACrB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,QAAQ,EACvB,OAAO,EAAE,KAAK,EACd,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,QAAQ,EACnB,GAAG,EAAE,KAAK,EACV,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,EAC/C,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE,MAAM,GACtB;KACF,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,SAAS,aAsBpB","sourcesContent":["import { IHorizontalBarChartWithAxisStyleProps, IHorizontalBarChartWithAxisStyles } from '../../index';\n\nexport const getStyles = (props: IHorizontalBarChartWithAxisStyleProps): IHorizontalBarChartWithAxisStyles => {\n const { shouldHighlight, theme } = props;\n return {\n opacityChangeOnHover: {\n opacity: shouldHighlight ? '' : '0.1',\n },\n\n xAxisTicks: [],\n\n tooltip: {\n ...theme.fonts.medium,\n display: 'flex',\n flexDirection: 'column',\n padding: '8px',\n position: 'absolute',\n textAlign: 'center',\n top: '0px',\n background: theme.semanticColors.bodyBackground,\n borderRadius: '2px',\n pointerEvents: 'none',\n },\n };\n};\n"]}
|
package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { IStyle } from '@fluentui/react/lib/Styling';
|
|
2
|
+
import { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
|
|
3
|
+
import { ICartesianChartProps, ICartesianChartStyleProps, ICartesianChartStyles, IHorizontalBarChartWithAxisDataPoint } from '../../index';
|
|
4
|
+
export interface IHorizontalBarChartWithAxisProps extends ICartesianChartProps {
|
|
5
|
+
/**
|
|
6
|
+
* Data to render in the chart.
|
|
7
|
+
*/
|
|
8
|
+
data?: IHorizontalBarChartWithAxisDataPoint[];
|
|
9
|
+
/**
|
|
10
|
+
* Define a custom callout renderer for a data point.
|
|
11
|
+
*/
|
|
12
|
+
onRenderCalloutPerDataPoint?: IRenderFunction<IHorizontalBarChartWithAxisDataPoint>;
|
|
13
|
+
/**
|
|
14
|
+
* Width of each bar in the chart.
|
|
15
|
+
*/
|
|
16
|
+
barHeight?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Colors from which to select the color of each bar.
|
|
19
|
+
*/
|
|
20
|
+
colors?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* chart title for the chart
|
|
23
|
+
*/
|
|
24
|
+
chartTitle?: string;
|
|
25
|
+
/**
|
|
26
|
+
* This prop makes sure that all the bars are of same color.
|
|
27
|
+
* it will take the first color from the array of colors in
|
|
28
|
+
* prop `colors` or if `colors` prop is not given then default color is palette.blueLight
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
useSingleColor?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Call to provide customized styling that will layer on top of the variant rules.
|
|
34
|
+
*/
|
|
35
|
+
styles?: IStyleFunctionOrObject<IHorizontalBarChartWithAxisStyleProps, IHorizontalBarChartWithAxisStyles>;
|
|
36
|
+
/**
|
|
37
|
+
* The prop used to define the culture to localized the numbers
|
|
38
|
+
*/
|
|
39
|
+
culture?: string;
|
|
40
|
+
/**
|
|
41
|
+
* it's padding between bar's or lines in the graph
|
|
42
|
+
*/
|
|
43
|
+
yAxisPadding?: number;
|
|
44
|
+
/**
|
|
45
|
+
*@default false
|
|
46
|
+
*Used for to elipse y axis labes and show tooltip on x axis labels
|
|
47
|
+
*/
|
|
48
|
+
showYAxisLablesTooltip?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
*@default false
|
|
51
|
+
*Used for showing complete y axis lables */
|
|
52
|
+
showYAxisLables?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface IHorizontalBarChartWithAxisStyleProps extends ICartesianChartStyleProps {
|
|
55
|
+
/**
|
|
56
|
+
* color of the datapoint legend
|
|
57
|
+
*/
|
|
58
|
+
legendColor?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface IHorizontalBarChartWithAxisStyles extends ICartesianChartStyles {
|
|
61
|
+
/**
|
|
62
|
+
* Style for the chart label.
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
chartLabel?: IStyle;
|
|
66
|
+
/**
|
|
67
|
+
* Style for the line representing the domain of the x-axis.
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
xAxisDomain?: IStyle;
|
|
71
|
+
/**
|
|
72
|
+
* Style for the lines representing the ticks along the x-axis.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
xAxisTicks?: IStyle;
|
|
76
|
+
/**
|
|
77
|
+
* Style for the text labeling each tick along the x-axis.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
xAxisText?: IStyle;
|
|
81
|
+
/**
|
|
82
|
+
* Style for the line representing the domain of the y-axis.
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
yAxisDomain?: IStyle;
|
|
86
|
+
/**
|
|
87
|
+
* Style for the lines representing the ticks along the y-axis.
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
yAxisTicks?: IStyle;
|
|
91
|
+
/**
|
|
92
|
+
* Style for the text labeling each tick along the y-axis.
|
|
93
|
+
*
|
|
94
|
+
*/
|
|
95
|
+
yAxisText?: IStyle;
|
|
96
|
+
/**
|
|
97
|
+
* Style to change the opacity of bars in dataviz when we hover on a single bar or legends
|
|
98
|
+
*/
|
|
99
|
+
opacityChangeOnHover: IStyle;
|
|
100
|
+
}
|
package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalBarChartWithAxis.types.js","sourceRoot":"../src/","sources":["components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyle } from '@fluentui/react/lib/Styling';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport {\n ICartesianChartProps,\n ICartesianChartStyleProps,\n ICartesianChartStyles,\n IHorizontalBarChartWithAxisDataPoint,\n} from '../../index';\n\nexport interface IHorizontalBarChartWithAxisProps extends ICartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IHorizontalBarChartWithAxisDataPoint[];\n\n /**\n * Define a custom callout renderer for a data point.\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IHorizontalBarChartWithAxisDataPoint>;\n\n /**\n * Width of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Colors from which to select the color of each bar.\n */\n colors?: string[];\n\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * This prop makes sure that all the bars are of same color.\n * it will take the first color from the array of colors in\n * prop `colors` or if `colors` prop is not given then default color is palette.blueLight\n * @default false\n */\n useSingleColor?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IHorizontalBarChartWithAxisStyleProps, IHorizontalBarChartWithAxisStyles>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * it's padding between bar's or lines in the graph\n */\n yAxisPadding?: number;\n\n /**\n *@default false\n *Used for to elipse y axis labes and show tooltip on x axis labels\n */\n showYAxisLablesTooltip?: boolean;\n\n /**\n *@default false\n *Used for showing complete y axis lables */\n showYAxisLables?: boolean;\n}\n\nexport interface IHorizontalBarChartWithAxisStyleProps extends ICartesianChartStyleProps {\n /**\n * color of the datapoint legend\n */\n legendColor?: string;\n}\n\nexport interface IHorizontalBarChartWithAxisStyles extends ICartesianChartStyles {\n /**\n * Style for the chart label.\n *\n */\n chartLabel?: IStyle;\n\n /**\n * Style for the line representing the domain of the x-axis.\n *\n */\n xAxisDomain?: IStyle;\n\n /**\n * Style for the lines representing the ticks along the x-axis.\n *\n */\n xAxisTicks?: IStyle;\n\n /**\n * Style for the text labeling each tick along the x-axis.\n *\n */\n xAxisText?: IStyle;\n\n /**\n * Style for the line representing the domain of the y-axis.\n *\n */\n yAxisDomain?: IStyle;\n\n /**\n * Style for the lines representing the ticks along the y-axis.\n *\n */\n yAxisTicks?: IStyle;\n\n /**\n * Style for the text labeling each tick along the y-axis.\n *\n */\n yAxisText?: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./HorizontalBarChartWithAxis"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./HorizontalBarChartWithAxis.types"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/HorizontalBarChartWithAxis/index.ts"],"names":[],"mappings":";;;AAAA,uEAA6C;AAC7C,6EAAmD","sourcesContent":["export * from './HorizontalBarChartWithAxis';\nexport * from './HorizontalBarChartWithAxis.types';\n"]}
|
package/lib-commonjs/index.d.ts
CHANGED
package/lib-commonjs/index.js
CHANGED
|
@@ -18,6 +18,7 @@ tslib_1.__exportStar(require("./HeatMapChart"), exports);
|
|
|
18
18
|
tslib_1.__exportStar(require("./SankeyChart"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./TreeChart"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./Sparkline"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./HorizontalBarChartWithAxis"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./utilities/colors"), exports);
|
|
22
23
|
require("./version");
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,uDAA6B;AAC7B,oDAA0B;AAC1B,sDAA4B;AAC5B,sDAA4B;AAC5B,qDAA2B;AAC3B,4DAAkC;AAClC,6DAAmC;AACnC,oEAA0C;AAC1C,oEAA0C;AAC1C,2DAAiC;AACjC,wDAA8B;AAC9B,2EAAiD;AACjD,yDAA+B;AAC/B,wDAA8B;AAC9B,sDAA4B;AAC5B,sDAA4B;AAC5B,6DAAmC;AAEnC,qBAAmB","sourcesContent":["export * from './HorizontalBarChart';\nexport * from './DonutChart';\nexport * from './Legends';\nexport * from './LineChart';\nexport * from './AreaChart';\nexport * from './PieChart';\nexport * from './StackedBarChart';\nexport * from './VerticalBarChart';\nexport * from './VerticalStackedBarChart';\nexport * from './GroupedVerticalBarChart';\nexport * from './CartesianChart';\nexport * from './types/index';\nexport * from './utilities/ChartHoverCard/index';\nexport * from './HeatMapChart';\nexport * from './SankeyChart';\nexport * from './TreeChart';\nexport * from './Sparkline';\nexport * from './utilities/colors';\n\nimport './version';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,uDAA6B;AAC7B,oDAA0B;AAC1B,sDAA4B;AAC5B,sDAA4B;AAC5B,qDAA2B;AAC3B,4DAAkC;AAClC,6DAAmC;AACnC,oEAA0C;AAC1C,oEAA0C;AAC1C,2DAAiC;AACjC,wDAA8B;AAC9B,2EAAiD;AACjD,yDAA+B;AAC/B,wDAA8B;AAC9B,sDAA4B;AAC5B,sDAA4B;AAC5B,uEAA6C;AAC7C,6DAAmC;AAEnC,qBAAmB","sourcesContent":["export * from './HorizontalBarChart';\nexport * from './DonutChart';\nexport * from './Legends';\nexport * from './LineChart';\nexport * from './AreaChart';\nexport * from './PieChart';\nexport * from './StackedBarChart';\nexport * from './VerticalBarChart';\nexport * from './VerticalStackedBarChart';\nexport * from './GroupedVerticalBarChart';\nexport * from './CartesianChart';\nexport * from './types/index';\nexport * from './utilities/ChartHoverCard/index';\nexport * from './HeatMapChart';\nexport * from './SankeyChart';\nexport * from './TreeChart';\nexport * from './Sparkline';\nexport * from './HorizontalBarChartWithAxis';\nexport * from './utilities/colors';\n\nimport './version';\n"]}
|
|
@@ -158,6 +158,44 @@ export interface IVerticalBarChartDataPoint {
|
|
|
158
158
|
*/
|
|
159
159
|
callOutAccessibilityData?: IAccessibilityProps;
|
|
160
160
|
}
|
|
161
|
+
export interface IHorizontalBarChartWithAxisDataPoint {
|
|
162
|
+
/**
|
|
163
|
+
* Dependent value of the data point, rendered along the x-axis.
|
|
164
|
+
*/
|
|
165
|
+
x: number;
|
|
166
|
+
/**
|
|
167
|
+
* Independent value of the data point, rendered along the y-axis.
|
|
168
|
+
* If y is a number, then each y-coordinate is plotted at its y-coordinate.
|
|
169
|
+
* If y is a string, then the data is evenly spaced along the y-axis.
|
|
170
|
+
*/
|
|
171
|
+
y: number | string;
|
|
172
|
+
/**
|
|
173
|
+
* Legend text for the datapoint in the chart
|
|
174
|
+
*/
|
|
175
|
+
legend?: string;
|
|
176
|
+
/**
|
|
177
|
+
* color for the legend in the chart
|
|
178
|
+
*/
|
|
179
|
+
color?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Callout data for x axis
|
|
182
|
+
* This is an optional prop, If haven;t given legend will take
|
|
183
|
+
*/
|
|
184
|
+
xAxisCalloutData?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Callout data for y axis
|
|
187
|
+
* This is an optional prop, If haven't given data will take
|
|
188
|
+
*/
|
|
189
|
+
yAxisCalloutData?: string;
|
|
190
|
+
/**
|
|
191
|
+
* onClick action for each datapoint in the chart
|
|
192
|
+
*/
|
|
193
|
+
onClick?: VoidFunction;
|
|
194
|
+
/**
|
|
195
|
+
* Accessibility data for callout
|
|
196
|
+
*/
|
|
197
|
+
callOutAccessibilityData?: IAccessibilityProps;
|
|
198
|
+
}
|
|
161
199
|
export interface ILineDataInVerticalBarChart {
|
|
162
200
|
y: IVerticalBarChartDataPoint['y'];
|
|
163
201
|
yAxisCalloutData?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import { SVGProps } from 'react';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport * as d3Sankey from 'd3-sankey';\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface ILineChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\nexport interface ILineChartLineOptions extends SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n}\n\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n}\n\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: SVGProps<SVGLineElement>;\n}\n\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n nodeId: number | string;\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n source: number;\n target: number;\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = d3Sankey.SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = d3Sankey.SankeyLink<ISNodeExtra, ISLinkExtra>;\n\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalStackedBarChart {\n y: number;\n color: string;\n legend: string;\n /**\n * Data to show in callout\n */\n data?: number;\n yAxisCalloutData?: string;\n}\n\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IDataPoint.js","sourceRoot":"../src/","sources":["types/IDataPoint.ts"],"names":[],"mappings":"","sourcesContent":["import { SVGProps } from 'react';\nimport { LegendShape } from '../components/Legends/Legends.types';\nimport * as d3Sankey from 'd3-sankey';\nexport interface IBasestate {\n _width?: number;\n _height?: number;\n activeLegend?: string;\n color?: string;\n dataForHoverCard?: number;\n isCalloutVisible: boolean;\n isLegendSelected?: boolean;\n isLegendHovered?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n refSelected?: any;\n YValueHover?: { legend?: string; y?: number; color?: string }[];\n hoverYValue?: string | number | null;\n hoverXValue?: string | number | null;\n xCalloutValue?: string;\n yCalloutValue?: string;\n lineColor?: string;\n hoveredLineColor?: string;\n selectedLegend?: string;\n containerWidth?: number;\n containerHeight?: number;\n}\n\nexport interface IRefArrayData {\n index?: string;\n refElement?: SVGGElement;\n}\n\nexport interface IMargins {\n /**\n * left margin for the chart.\n */\n left?: number;\n /**\n * Right margin for the chart.\n */\n right?: number;\n /**\n * Top margin for the chart.\n */\n top?: number;\n /**\n * Bottom margin for the chart.\n */\n bottom?: number;\n}\n\nexport interface IDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n // NOTE: VerticalStackedBarChart, PieChart\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface IHorizontalDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n}\n\nexport interface IChartDataPoint {\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * data the datapoint in the chart\n */\n data?: number;\n\n /**\n * data the datapoint in the chart\n */\n horizontalBarChartdata?: IHorizontalDataPoint;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Color for the legend in the chart. If not provided, it will fallback on the default color palette.\n */\n color?: string;\n\n /**\n * placeholder data point\n */\n placeHolder?: boolean;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalBarChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If x is a string, then the data is evenly spaced along the x-axis.\n */\n x: number | string;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * data to render the line along with bars\n */\n lineData?: ILineDataInVerticalBarChart;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IHorizontalBarChartWithAxisDataPoint {\n /**\n * Dependent value of the data point, rendered along the x-axis.\n */\n x: number;\n\n /**\n * Independent value of the data point, rendered along the y-axis.\n * If y is a number, then each y-coordinate is plotted at its y-coordinate.\n * If y is a string, then the data is evenly spaced along the y-axis.\n */\n y: number | string;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend?: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalBarChart {\n y: IVerticalBarChartDataPoint['y'];\n yAxisCalloutData?: string | undefined;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n}\n\nexport interface ILineChartDataPoint {\n /**\n * Independent value of the data point, rendered along the x-axis.\n * If x is a number, then each y-coordinate is plotted at its x-coordinate.\n * If data type on x is Date, then the data is spaced evenly by d3-scale\n */\n x: number | Date;\n\n /**\n * Dependent value of the data point, rendered along the y-axis.\n */\n y: number;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onDataPointClick?: () => void;\n\n /**\n * Callout data for x axis\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n */\n yAxisCalloutData?: string | { [id: string]: number };\n\n /**\n * Whether to hide callout data for the point.\n */\n hideCallout?: boolean;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n\n /**\n * X axis Accessibility data for callout\n */\n xAxisCalloutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineChartGap {\n /**\n * Starting index of the gap.\n */\n startIndex: number;\n\n /**\n * Ending index of the gap.\n */\n endIndex: number;\n}\n\nexport interface ILineChartLineOptions extends SVGProps<SVGPathElement> {\n /**\n * Width of the line/stroke.\n * Overrides the strokeWidth set on ICartesianChartProps level.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width\n */\n strokeWidth?: number | string;\n\n /**\n * Pattern of dashes and gaps.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray\n */\n strokeDasharray?: string | number;\n\n /**\n * Offset on rendering of stroke dash array.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset\n */\n strokeDashoffset?: string | number;\n\n /**\n * Shape at the end of a subpath.\n * Default round.\n * @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap\n */\n strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';\n\n /**\n * Width of border around the line. Default no border.\n */\n lineBorderWidth?: string | number;\n\n /**\n * Color of border around the line. Default white.\n */\n lineBorderColor?: string;\n}\n\nexport interface ILineChartPoints {\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * The shape for the legend\n * default: show the rect legend\n */\n legendShape?: LegendShape;\n\n /**\n * dataPoints for the line chart\n */\n data: ILineChartDataPoint[];\n\n /**\n * gaps in the line chart where a line is not drawn\n */\n gaps?: ILineChartGap[];\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * opacity for chart fill color\n */\n opacity?: number;\n\n /**\n * options for the line drawn\n */\n lineOptions?: ILineChartLineOptions;\n\n /**\n * hide dots for points that are not active\n */\n hideNonActiveDots?: boolean;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n onLegendClick?: (selectedLegend: string | null | string[]) => void;\n\n /**\n * Defines the function that is executed on clicking line\n */\n onLineClick?: () => void;\n}\n\nexport interface IChartProps {\n /**\n * chart title for the chart\n */\n chartTitle?: string;\n\n /**\n * Accessibility data for chart title\n */\n chartTitleAccessibilityData?: IAccessibilityProps;\n /**\n * data for the points in the chart\n */\n chartData?: IChartDataPoint[];\n\n /**\n * Accessibility data for chart data\n */\n chartDataAccessibilityData?: IAccessibilityProps;\n\n /**\n * data for the points in the line chart\n */\n lineChartData?: ILineChartPoints[];\n\n /**\n * data for the points in the line chart\n */\n SankeyChartData?: ISankeyChartData;\n\n /**\n * data for the points in the line chart\n */\n pointOptions?: SVGProps<SVGCircleElement>;\n\n /**\n * data for the dotted line on hovering the point\n */\n pointLineOptions?: SVGProps<SVGLineElement>;\n}\n\nexport interface ISankeyChartData {\n nodes: SNode[];\n links: SLink[];\n}\n\ninterface ISNodeExtra {\n nodeId: number | string;\n name: string;\n color?: string;\n borderColor?: string;\n actualValue?: number;\n layer?: number;\n}\n\ninterface ISLinkExtra {\n source: number;\n target: number;\n value: number;\n unnormalizedValue?: number;\n}\n\nexport type SNode = d3Sankey.SankeyNode<ISNodeExtra, ISLinkExtra>;\nexport type SLink = d3Sankey.SankeyLink<ISNodeExtra, ISLinkExtra>;\n\nexport interface IAccessibilityProps {\n /**\n * Accessibility aria-label\n */\n ariaLabel?: string;\n\n /**\n * Accessibility aria-labelledBy\n */\n ariaLabelledBy?: string;\n\n /**\n * Accessibility aria-describedBy\n */\n ariaDescribedBy?: string;\n}\n\nexport interface IVSChartDataPoint {\n /**\n * data the datapoint in the chart\n */\n data: number;\n\n /**\n * Legend text for the datapoint in the chart\n */\n legend: string;\n\n /**\n * color for the legend in the chart\n */\n color?: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IVerticalStackedChartProps {\n /**\n * data for the points in the chart\n */\n chartData: IVSChartDataPoint[];\n\n /**\n * Data for x axis label for multistacked Vertical bar chart\n */\n xAxisPoint: number | string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven't given, legend will take\n */\n xAxisCalloutData?: string;\n /**\n * line data to render lines on stacked bar chart\n */\n lineData?: ILineDataInVerticalStackedBarChart[];\n /**\n * Accessibility data for Whole stack callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface ILineDataInVerticalStackedBarChart {\n y: number;\n color: string;\n legend: string;\n /**\n * Data to show in callout\n */\n data?: number;\n yAxisCalloutData?: string;\n}\n\nexport interface IGVBarChartSeriesPoint {\n /**\n * Text for // need to check use of this\n */\n key: string;\n\n /**\n * Data for bar height of Grouped vertical bar chart\n */\n data: number;\n\n /**\n * Color for the legend in the chart\n */\n color: string;\n\n /**\n * Legend text in the chart\n */\n legend: string;\n\n /**\n * Callout data for x axis\n * This is an optional prop, If haven;t given legend will take\n */\n xAxisCalloutData?: string;\n\n /**\n * Callout data for y axis\n * This is an optional prop, If haven't given data will take\n */\n yAxisCalloutData?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGroupedVerticalBarChartData {\n /**\n * Data for X axis label\n */\n name: string;\n\n /**\n * Data points for Grouped vertical bar chart\n */\n series: IGVBarChartSeriesPoint[];\n\n /**\n * Accessibility data for Group Bars Stack Callout\n */\n stackCallOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IGVDataPoint {\n /**\n * This interface used for - While forming datapoints from given prop \"data\" in code\n * datapoints are used for to draw graph\n */\n [key: string]: number | string;\n}\n\nexport interface IGVSingleDataPoint {\n /**\n * While forming datapoints from given prop \"data\" in code.\n * These datapoints are used for to draw graph easily.\n */\n [key: string]: IGVDataPoint;\n}\n\nexport interface IGVForBarChart {\n /**\n * While forming datapoints from given prop \"data\"\n * These datapoints are used for to draw graph.\n */\n [key: string]: IGVBarChartSeriesPoint;\n}\n\nexport interface IHeatMapChartDataPoint {\n x: string | Date | number;\n y: string | Date | number;\n value: number;\n /**\n * The value/ text to be rendered in the rectange\n */\n rectText?: string | number;\n /**\n * denomination to show in the callout\n */\n ratio?: [number, number];\n /**\n * description message to the callout\n */\n descriptionMessage?: string;\n\n /**\n * onClick action for each datapoint in the chart\n */\n onClick?: VoidFunction;\n /**\n * Accessibility data for callout\n */\n callOutAccessibilityData?: IAccessibilityProps;\n}\n\nexport interface IHeatMapChartData {\n /**\n * name of the legend\n */\n legend: string;\n data: IHeatMapChartDataPoint[];\n /**\n * This number will be used to get the color for the legend\n */\n value: number;\n}\n\nexport interface ICustomizedCalloutDataPoint {\n legend: string;\n y: number;\n color: string;\n xAxisCalloutData?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n}\n\n/**\n * Used for custom callout data interface. As Area chart callout data will be prepared from given props.data,\n * Those required data passing to onRenderCalloutPerDataPoint and onRenderCalloutPerStack.\n */\nexport interface ICustomizedCalloutData {\n x: number | string | Date;\n values: ICustomizedCalloutDataPoint[];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Axis as D3Axis } from 'd3-axis';
|
|
2
2
|
import * as d3TimeFormat from 'd3-time-format';
|
|
3
|
-
import { IAccessibilityProps, IEventsAnnotationProps, ILineChartPoints, IDataPoint, IVerticalBarChartDataPoint } from '../index';
|
|
3
|
+
import { IAccessibilityProps, IEventsAnnotationProps, ILineChartPoints, IDataPoint, IVerticalBarChartDataPoint, IHorizontalBarChartWithAxisDataPoint } from '../index';
|
|
4
4
|
export declare type NumericAxis = D3Axis<number | {
|
|
5
5
|
valueOf(): number;
|
|
6
6
|
}>;
|
|
@@ -11,7 +11,8 @@ export declare enum ChartTypes {
|
|
|
11
11
|
VerticalBarChart = 2,
|
|
12
12
|
VerticalStackedBarChart = 3,
|
|
13
13
|
GroupedVerticalBarChart = 4,
|
|
14
|
-
HeatMapChart = 5
|
|
14
|
+
HeatMapChart = 5,
|
|
15
|
+
HorizontalBarChartWithAxis = 6
|
|
15
16
|
}
|
|
16
17
|
export declare enum XAxisTypes {
|
|
17
18
|
NumericAxis = 0,
|
|
@@ -74,6 +75,8 @@ export interface IXAxisParams {
|
|
|
74
75
|
xAxisPadding?: number;
|
|
75
76
|
xAxisInnerPadding?: number;
|
|
76
77
|
xAxisOuterPadding?: number;
|
|
78
|
+
margins: IMargins;
|
|
79
|
+
containerHeight: number;
|
|
77
80
|
}
|
|
78
81
|
export interface ITickParams {
|
|
79
82
|
tickValues?: Date[] | number[];
|
|
@@ -103,7 +106,7 @@ export interface IYAxisParams {
|
|
|
103
106
|
* @export
|
|
104
107
|
* @param {IXAxisParams} xAxisParams
|
|
105
108
|
*/
|
|
106
|
-
export declare function createNumericXAxis(xAxisParams: IXAxisParams, culture?: string): import("d3-scale").ScaleLinear<number, number, never>;
|
|
109
|
+
export declare function createNumericXAxis(xAxisParams: IXAxisParams, chartType: ChartTypes, culture?: string): import("d3-scale").ScaleLinear<number, number, never>;
|
|
107
110
|
/**
|
|
108
111
|
* Creating Date x axis of the Chart
|
|
109
112
|
* @export
|
|
@@ -136,14 +139,24 @@ export declare function prepareDatapoints(maxVal: number, minVal: number, splitI
|
|
|
136
139
|
* @param {IYAxisParams} yAxisParams
|
|
137
140
|
* @param {boolean} isRtl
|
|
138
141
|
*/
|
|
139
|
-
export declare function createYAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData): import("d3-scale").ScaleLinear<number, number, never>;
|
|
142
|
+
export declare function createYAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, chartType: ChartTypes, barWidth: number): import("d3-scale").ScaleLinear<number, number, never>;
|
|
143
|
+
export declare function createYAxisForHorizontalBarChartWithAxis(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData, barWidth: number): import("d3-scale").ScaleLinear<number, number, never>;
|
|
144
|
+
export declare function createYAxisForOtherCharts(yAxisParams: IYAxisParams, isRtl: boolean, axisData: IAxisData): import("d3-scale").ScaleLinear<number, number, never>;
|
|
145
|
+
export declare const createStringYAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, chartType: ChartTypes, barWidth: number | undefined, culture?: string | undefined) => import("d3-scale").ScaleBand<string>;
|
|
146
|
+
/**
|
|
147
|
+
* Creating String Y axis of the chart for Horizontal Bar Chart With Axis
|
|
148
|
+
* @param yAxisParams
|
|
149
|
+
* @param dataPoints
|
|
150
|
+
* @param isRtl
|
|
151
|
+
*/
|
|
152
|
+
export declare const createStringYAxisForHorizontalBarChartWithAxis: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean, barWidth: number, culture?: string | undefined) => import("d3-scale").ScaleBand<string>;
|
|
140
153
|
/**
|
|
141
|
-
* Creating String Y axis of the chart
|
|
154
|
+
* Creating String Y axis of the chart for other chart except Horizontal Bar Chart With Axis
|
|
142
155
|
* @param yAxisParams
|
|
143
156
|
* @param dataPoints
|
|
144
157
|
* @param isRtl
|
|
145
158
|
*/
|
|
146
|
-
export declare const
|
|
159
|
+
export declare const createStringYAxisForOtherCharts: (yAxisParams: IYAxisParams, dataPoints: string[], isRtl: boolean) => import("d3-scale").ScaleBand<string>;
|
|
147
160
|
export declare function calloutData(values: (ILineChartPoints & {
|
|
148
161
|
index?: number;
|
|
149
162
|
})[]): {
|
|
@@ -189,6 +202,17 @@ export declare function silceOrAppendToArray(array: string[], value: string): st
|
|
|
189
202
|
* @returns
|
|
190
203
|
*/
|
|
191
204
|
export declare function createWrapOfXLabels(wrapLabelProps: IWrapLabelProps): number | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* This method used for wrapping of y axis labels (tick values).
|
|
207
|
+
*/
|
|
208
|
+
export declare function createYAxisLabels(node: SVGElement | null, yAxis: any, noOfCharsToTruncate: number, truncateLabel: boolean, xValue: number, isRtl: boolean): void;
|
|
209
|
+
/**
|
|
210
|
+
* This function is calculating the length of longest Y axis label in px ,so that we are able to
|
|
211
|
+
* create the cartesian chart by shifting that many points to the right/left.
|
|
212
|
+
* @param points
|
|
213
|
+
* @returns
|
|
214
|
+
*/
|
|
215
|
+
export declare function calculateLongestYAxisLabel(points: IHorizontalBarChartWithAxisDataPoint[], yAxisElement: SVGElement): number;
|
|
192
216
|
/**
|
|
193
217
|
* This method displays a tooltip to the x axis lables(tick values)
|
|
194
218
|
* when prop 'showXAxisLablesTooltip' enables to the respected chart.
|
|
@@ -223,6 +247,17 @@ export declare function domainRangeOfDateForAreaChart(points: ILineChartPoints[]
|
|
|
223
247
|
* @returns {IDomainNRange}
|
|
224
248
|
*/
|
|
225
249
|
export declare function domainRangeOfNumericForAreaChart(points: ILineChartPoints[], margins: IMargins, width: number, isRTL: boolean): IDomainNRange;
|
|
250
|
+
/**
|
|
251
|
+
* Calculates Domain and range values for Numeric X axis.
|
|
252
|
+
* This method calculates Horizontal Chart with Axis
|
|
253
|
+
* @export
|
|
254
|
+
* @param {ILineChartPoints[]} points
|
|
255
|
+
* @param {IMargins} margins
|
|
256
|
+
* @param {number} width
|
|
257
|
+
* @param {boolean} isRTL
|
|
258
|
+
* @returns {IDomainNRange}
|
|
259
|
+
*/
|
|
260
|
+
export declare function domainRangeOfNumericForHorizontalBarChartWithAxis(points: IHorizontalBarChartWithAxisDataPoint[], margins: IMargins, containerWidth: number, isRTL: boolean, shiftX: number): IDomainNRange;
|
|
226
261
|
/**
|
|
227
262
|
* Calculates Range values of x Axis string axis
|
|
228
263
|
* For String axis, we need to give domain values (Not start and end array values)
|
|
@@ -271,7 +306,7 @@ export declare function domainRageOfVerticalNumeric(points: IDataPoint[], margin
|
|
|
271
306
|
* @param {number} [barWidth]
|
|
272
307
|
* @returns {IDomainNRange}
|
|
273
308
|
*/
|
|
274
|
-
export declare function getDomainNRangeValues(points: any, margins: IMargins, width: number, chartType: ChartTypes, isRTL: boolean, xAxisType: XAxisTypes, barWidth: number, tickValues: Date[] | number[] | undefined): IDomainNRange;
|
|
309
|
+
export declare function getDomainNRangeValues(points: any, margins: IMargins, width: number, chartType: ChartTypes, isRTL: boolean, xAxisType: XAxisTypes, barWidth: number, tickValues: Date[] | number[] | undefined, shiftX: number): IDomainNRange;
|
|
275
310
|
/**
|
|
276
311
|
* Calculating start and ending values of the Area chart and LineChart
|
|
277
312
|
* @export
|
|
@@ -302,6 +337,16 @@ export declare function findVerticalNumericMinMaxOfY(points: IVerticalBarChartDa
|
|
|
302
337
|
startValue: number;
|
|
303
338
|
endValue: number;
|
|
304
339
|
};
|
|
340
|
+
/**
|
|
341
|
+
* Fins the min and max values of the vertical bar chart y axis data point.
|
|
342
|
+
* @export
|
|
343
|
+
* @param {IVerticalBarChartDataPoint[]} points
|
|
344
|
+
* @returns {{ startValue: number; endValue: number }}
|
|
345
|
+
*/
|
|
346
|
+
export declare function findHBCWANumericMinMaxOfY(points: IHorizontalBarChartWithAxisDataPoint[], yAxisType: YAxisType | undefined): {
|
|
347
|
+
startValue: number;
|
|
348
|
+
endValue: number;
|
|
349
|
+
};
|
|
305
350
|
/**
|
|
306
351
|
* For creating Y axis, need to calculate y axis domain values from given points. This may vary based on chart type.
|
|
307
352
|
* So, this method will define which method need to call based on chart type to find out min and max values(For Domain).
|
|
@@ -311,7 +356,7 @@ export declare function findVerticalNumericMinMaxOfY(points: IVerticalBarChartDa
|
|
|
311
356
|
* @param {ChartTypes} chartType
|
|
312
357
|
* @returns {{ startValue: number; endValue: number }}
|
|
313
358
|
*/
|
|
314
|
-
export declare function getMinMaxOfYAxis(points: any, chartType: ChartTypes): {
|
|
359
|
+
export declare function getMinMaxOfYAxis(points: any, chartType: ChartTypes, yAxisType?: YAxisType | undefined): {
|
|
315
360
|
startValue: number;
|
|
316
361
|
endValue: number;
|
|
317
362
|
};
|