@fluentui/react-charting 5.24.39 → 5.25.1
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 +75 -1
- package/CHANGELOG.md +30 -2
- package/dist/react-charting.d.ts +127 -0
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/etc/react-charting.api.md +74 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +3 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +496 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +28 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +111 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +52 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +2 -0
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib/components/CommonComponents/CartesianChart.base.js +38 -46
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.styles.js +9 -1
- package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.d.ts +17 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/index.d.ts +2 -0
- package/lib/components/CommonComponents/index.js +2 -0
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +650 -76
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/IChartAnnotation.d.ts +99 -0
- package/lib/types/IChartAnnotation.js +2 -0
- package/lib/types/IChartAnnotation.js.map +1 -0
- package/lib/types/IDataPoint.d.ts +4 -0
- package/lib/types/IDataPoint.js.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/image-export-utils.js +55 -0
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/utilities.js +72 -20
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +3 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +497 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +28 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +119 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +52 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +5 -0
- package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +38 -47
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js +9 -1
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +17 -1
- package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-amd/components/CommonComponents/index.d.ts +2 -0
- package/lib-amd/components/CommonComponents/index.js +3 -1
- package/lib-amd/components/CommonComponents/index.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +650 -76
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/index.d.ts +1 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/types/IChartAnnotation.d.ts +99 -0
- package/lib-amd/types/IChartAnnotation.js +5 -0
- package/lib-amd/types/IChartAnnotation.js.map +1 -0
- package/lib-amd/types/IDataPoint.d.ts +4 -0
- package/lib-amd/types/IDataPoint.js.map +1 -1
- package/lib-amd/types/index.d.ts +1 -0
- package/lib-amd/types/index.js +2 -1
- package/lib-amd/types/index.js.map +1 -1
- package/lib-amd/utilities/image-export-utils.js +55 -0
- package/lib-amd/utilities/image-export-utils.js.map +1 -1
- package/lib-amd/utilities/utilities.js +72 -20
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +3 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +499 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +28 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +118 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +52 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +3 -0
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +38 -46
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +9 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +17 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.d.ts +2 -0
- package/lib-commonjs/components/CommonComponents/index.js +2 -0
- package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +650 -76
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/types/IChartAnnotation.d.ts +99 -0
- package/lib-commonjs/types/IChartAnnotation.js +3 -0
- package/lib-commonjs/types/IChartAnnotation.js.map +1 -0
- package/lib-commonjs/types/IDataPoint.d.ts +4 -0
- package/lib-commonjs/types/IDataPoint.js.map +1 -1
- package/lib-commonjs/types/index.d.ts +1 -0
- package/lib-commonjs/types/index.js +1 -0
- package/lib-commonjs/types/index.js.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.js +55 -0
- package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +72 -20
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +9 -9
- package/src/components/CommonComponents/Annotations/ChartAnnotationLayer.types.ts +58 -0
- package/src/components/CommonComponents/CartesianChart.types.ts +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-charting",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.25.1",
|
|
4
4
|
"description": "React web charting controls for Microsoft fluentui system.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"jest-canvas-mock": "2.4.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@fluentui/chart-utilities": "^1.1.
|
|
40
|
-
"@fluentui/react-focus": "^8.
|
|
41
|
-
"@fluentui/theme-samples": "^8.7.
|
|
39
|
+
"@fluentui/chart-utilities": "^1.1.35",
|
|
40
|
+
"@fluentui/react-focus": "^8.10.0",
|
|
41
|
+
"@fluentui/theme-samples": "^8.7.219",
|
|
42
42
|
"@microsoft/load-themed-styles": "^1.10.26",
|
|
43
43
|
"@types/d3-array": "^3.0.0",
|
|
44
44
|
"@types/d3-axis": "^3.0.0",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"tslib": "^2.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@fluentui/react": "^8.
|
|
70
|
-
"@types/react": ">=16.8.0 <
|
|
71
|
-
"@types/react-dom": ">=16.8.0 <
|
|
72
|
-
"react": ">=16.8.0 <
|
|
73
|
-
"react-dom": ">=16.8.0 <
|
|
69
|
+
"@fluentui/react": "^8.125.0",
|
|
70
|
+
"@types/react": ">=16.8.0 <20.0.0",
|
|
71
|
+
"@types/react-dom": ">=16.8.0 <20.0.0",
|
|
72
|
+
"react": ">=16.8.0 <20.0.0",
|
|
73
|
+
"react-dom": ">=16.8.0 <20.0.0"
|
|
74
74
|
},
|
|
75
75
|
"exports": {
|
|
76
76
|
".": {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ITheme } from '@fluentui/react/lib/Styling';
|
|
2
|
+
import { IChartAnnotation, ChartAnnotationArrowHead } from '../../../types/IChartAnnotation';
|
|
3
|
+
|
|
4
|
+
export interface IAnnotationPoint {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IAnnotationPlotRect {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IChartAnnotationContext {
|
|
17
|
+
/** Rectangle describing the drawable area of the chart (without margins) */
|
|
18
|
+
plotRect: IAnnotationPlotRect;
|
|
19
|
+
/** Size of the owning SVG element */
|
|
20
|
+
svgRect: { width: number; height: number };
|
|
21
|
+
/** Indicates if layout should be mirrored */
|
|
22
|
+
isRtl?: boolean;
|
|
23
|
+
/** Primary x scale mapping data domain to pixels */
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
xScale?: (value: any) => number;
|
|
26
|
+
/** Primary y scale mapping data domain to pixels */
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
yScalePrimary?: (value: any) => number;
|
|
29
|
+
/** Secondary y scale when present */
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
yScaleSecondary?: (value: any) => number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IChartAnnotationLayerProps {
|
|
35
|
+
annotations?: IChartAnnotation[];
|
|
36
|
+
context: IChartAnnotationContext;
|
|
37
|
+
theme: ITheme;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IResolvedAnnotationPosition {
|
|
42
|
+
/** Final absolute position after applying layout and offsets */
|
|
43
|
+
point: IAnnotationPoint;
|
|
44
|
+
/** Raw anchor position before offsets (used for connectors) */
|
|
45
|
+
anchor: IAnnotationPoint;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ConnectorRenderData = {
|
|
49
|
+
key: string;
|
|
50
|
+
start: IAnnotationPoint;
|
|
51
|
+
end: IAnnotationPoint;
|
|
52
|
+
strokeColor: string;
|
|
53
|
+
strokeWidth: number;
|
|
54
|
+
dashArray?: string;
|
|
55
|
+
arrow: ChartAnnotationArrowHead;
|
|
56
|
+
markerSize: number;
|
|
57
|
+
markerStrokeWidth: number;
|
|
58
|
+
};
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
AxisScaleType,
|
|
12
12
|
IAccessibilityProps,
|
|
13
13
|
IChart,
|
|
14
|
+
IChartAnnotation,
|
|
14
15
|
IDataPoint,
|
|
15
16
|
IGanttChartDataPoint,
|
|
16
17
|
IGroupedVerticalBarChartData,
|
|
@@ -194,11 +195,21 @@ export interface ICartesianChartStyles {
|
|
|
194
195
|
*/
|
|
195
196
|
chartWrapper?: IStyle;
|
|
196
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Styles for the element wrapping the svg and overlays for annotation
|
|
200
|
+
*/
|
|
201
|
+
plotContainer?: IStyle;
|
|
202
|
+
|
|
197
203
|
/**
|
|
198
204
|
* Styles for the svg tooltip
|
|
199
205
|
*/
|
|
200
206
|
svgTooltip?: IStyle;
|
|
201
207
|
|
|
208
|
+
/**
|
|
209
|
+
* Styles applied to the annotation layer root element
|
|
210
|
+
*/
|
|
211
|
+
annotationLayer?: IStyle;
|
|
212
|
+
|
|
202
213
|
/**
|
|
203
214
|
* Styles for the chart svg element
|
|
204
215
|
*/
|
|
@@ -336,6 +347,11 @@ export interface ICartesianChartProps {
|
|
|
336
347
|
*/
|
|
337
348
|
xAxistickSize?: number;
|
|
338
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Text annotations rendered on top of the chart area
|
|
352
|
+
*/
|
|
353
|
+
annotations?: IChartAnnotation[];
|
|
354
|
+
|
|
339
355
|
/**
|
|
340
356
|
* defines the space between the tick line and the data label
|
|
341
357
|
* @default 10
|
|
@@ -709,6 +725,11 @@ export interface IModifiedCartesianChartProps extends ICartesianChartProps {
|
|
|
709
725
|
*/
|
|
710
726
|
svgFocusZoneProps?: IFocusZoneProps;
|
|
711
727
|
|
|
728
|
+
/**
|
|
729
|
+
* Annotations to render on top of the chart area.
|
|
730
|
+
*/
|
|
731
|
+
annotations?: IChartAnnotation[];
|
|
732
|
+
|
|
712
733
|
/**
|
|
713
734
|
* The prop used to define the culture to localize the numbers and date
|
|
714
735
|
*/
|