@fluentui/react-charts 9.3.13 → 9.3.15
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 +23 -2
- package/dist/index.d.ts +17 -5
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +47 -7
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +12 -12
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js +19 -0
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +537 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +5 -10
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +5 -2
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/utilities/KeyCodes.js +4 -1
- package/lib/utilities/KeyCodes.js.map +1 -1
- package/lib/utilities/utilities.js +41 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +46 -6
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +11 -11
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js +19 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +533 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +5 -10
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +4 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.js +4 -1
- package/lib-commonjs/utilities/KeyCodes.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +33 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Legends/Legends.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../src/components/Legends/Legends.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n * Legends styles\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface LegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root?: string;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend?: string;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect?: string;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape?: string;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle?: string;\n\n /**\n * Style for the legend text\n */\n text?: string;\n\n /**\n * Style for the legend text\n */\n hoverChange?: string;\n\n /**\n * Style for the area that is resizable\n */\n resizableArea?: string;\n\n /*\n * Style for the container that holds the legend and any optional JSX annotation from client is used\n */\n legendContainer?: string;\n\n /**\n * Style for the annotation that is used in the legend\n */\n annotation?: string;\n}\n\n/**\n * ILegend interface\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface Legend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n /**\n * The annotation for the legend, function returning a React node\n */\n legendAnnotation?: () => React.ReactNode;\n}\n\n/**\n * Legend style properties\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface LegendStyleProps {\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * Legend properties\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface LegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: Legend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LegendsStyles;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * style for the overflow component\n */\n overflowStyles?: React.CSSProperties;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n\n /**\n * Callback to access the public methods and properties of the component.\n */\n legendRef?: React.Ref<LegendContainer>;\n}\n\n/**\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n *\n * @public\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n\n/**\n * {@docCategory Legends}\n */\nexport interface LegendContainer {\n toSVG: (\n svgWidth: number,\n isRTL?: boolean,\n ) => {\n node: SVGSVGElement | null;\n width: number;\n height: number;\n };\n}\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
|
|
@@ -451,7 +451,14 @@ const LineChart = /*#__PURE__*/ _react.forwardRef(({ isCalloutForStack = true, .
|
|
|
451
451
|
}, /*#__PURE__*/ _react.createElement("circle", {
|
|
452
452
|
id: circleId,
|
|
453
453
|
key: circleId,
|
|
454
|
-
r:
|
|
454
|
+
r: (0, _index1.calculateMarkerRadius)({
|
|
455
|
+
pointMarkerSize: currentMarkerSize,
|
|
456
|
+
minMarkerSize: 0,
|
|
457
|
+
maxMarkerSize,
|
|
458
|
+
extraMaxPixels,
|
|
459
|
+
isContinuousXY: true,
|
|
460
|
+
isActive: activePoint === circleId
|
|
461
|
+
}),
|
|
455
462
|
cx: xPoint,
|
|
456
463
|
cy: yPoint,
|
|
457
464
|
fill: activePoint === circleId ? _reacttheme.tokens.colorNeutralBackground1 : lineColor,
|
|
@@ -583,7 +590,14 @@ const LineChart = /*#__PURE__*/ _react.forwardRef(({ isCalloutForStack = true, .
|
|
|
583
590
|
var _points_i_data_k_text;
|
|
584
591
|
pointsForLine.push(/*#__PURE__*/ _react.createElement("circle", {
|
|
585
592
|
key: `${_circleId}_${i}_${k}_marker`,
|
|
586
|
-
r:
|
|
593
|
+
r: (0, _index1.calculateMarkerRadius)({
|
|
594
|
+
pointMarkerSize: markerSize,
|
|
595
|
+
minMarkerSize: 0,
|
|
596
|
+
maxMarkerSize,
|
|
597
|
+
extraMaxPixels,
|
|
598
|
+
isContinuousXY: true,
|
|
599
|
+
isActive: activePoint === _circleId
|
|
600
|
+
}),
|
|
587
601
|
cx: xPoint,
|
|
588
602
|
cy: yPoint,
|
|
589
603
|
fill: activePoint === _circleId ? _reacttheme.tokens.colorNeutralBackground1 : perPointColor || ((_points_i = _points[i]) === null || _points_i === void 0 ? void 0 : _points_i.color) || lineColor,
|
|
@@ -630,7 +644,14 @@ const LineChart = /*#__PURE__*/ _react.forwardRef(({ isCalloutForStack = true, .
|
|
|
630
644
|
pointsForLine.push(((_points_i_lineOptions15 = _points[i].lineOptions) === null || _points_i_lineOptions15 === void 0 ? void 0 : (_points_i_lineOptions_mode3 = _points_i_lineOptions15.mode) === null || _points_i_lineOptions_mode3 === void 0 ? void 0 : _points_i_lineOptions_mode3.includes('markers')) || supportsTextMode ? /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("circle", {
|
|
631
645
|
id: circleId,
|
|
632
646
|
key: circleId,
|
|
633
|
-
r:
|
|
647
|
+
r: (0, _index1.calculateMarkerRadius)({
|
|
648
|
+
pointMarkerSize: currentMarkerSize,
|
|
649
|
+
minMarkerSize: 0,
|
|
650
|
+
maxMarkerSize,
|
|
651
|
+
extraMaxPixels,
|
|
652
|
+
isContinuousXY: true,
|
|
653
|
+
isActive: activePoint === circleId
|
|
654
|
+
}),
|
|
634
655
|
cx: xPoint1,
|
|
635
656
|
cy: yPoint1,
|
|
636
657
|
tabIndex: isLegendSelected ? 0 : undefined,
|
|
@@ -649,7 +670,13 @@ const LineChart = /*#__PURE__*/ _react.forwardRef(({ isCalloutForStack = true, .
|
|
|
649
670
|
}), !_isScatterPolar && supportsTextMode && text && /*#__PURE__*/ _react.createElement("text", {
|
|
650
671
|
key: `${circleId}-label`,
|
|
651
672
|
x: xPoint1,
|
|
652
|
-
y: yPoint1 +
|
|
673
|
+
y: yPoint1 + (0, _index1.calculateMarkerRadius)({
|
|
674
|
+
pointMarkerSize: currentMarkerSize,
|
|
675
|
+
minMarkerSize: 0,
|
|
676
|
+
maxMarkerSize,
|
|
677
|
+
extraMaxPixels,
|
|
678
|
+
isContinuousXY: true
|
|
679
|
+
}) + 12,
|
|
653
680
|
className: classes.markerLabel,
|
|
654
681
|
opacity: isLegendSelected && !currentPointHidden ? 1 : 0.01
|
|
655
682
|
}, text)) : /*#__PURE__*/ _react.createElement("path", {
|
|
@@ -691,7 +718,14 @@ const LineChart = /*#__PURE__*/ _react.forwardRef(({ isCalloutForStack = true, .
|
|
|
691
718
|
}, ((_points_i_lineOptions17 = _points[i].lineOptions) === null || _points_i_lineOptions17 === void 0 ? void 0 : (_points_i_lineOptions_mode5 = _points_i_lineOptions17.mode) === null || _points_i_lineOptions_mode5 === void 0 ? void 0 : _points_i_lineOptions_mode5.includes('markers')) || lastSupportsTextMode ? /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("circle", {
|
|
692
719
|
id: lastCircleId,
|
|
693
720
|
key: lastCircleId,
|
|
694
|
-
r:
|
|
721
|
+
r: (0, _index1.calculateMarkerRadius)({
|
|
722
|
+
pointMarkerSize: currentMarkerSize,
|
|
723
|
+
minMarkerSize: 0,
|
|
724
|
+
maxMarkerSize,
|
|
725
|
+
extraMaxPixels,
|
|
726
|
+
isContinuousXY: true,
|
|
727
|
+
isActive: activePoint === lastCircleId
|
|
728
|
+
}),
|
|
695
729
|
cx: xPoint2,
|
|
696
730
|
cy: yPoint2,
|
|
697
731
|
tabIndex: isLegendSelected ? 0 : undefined,
|
|
@@ -710,7 +744,13 @@ const LineChart = /*#__PURE__*/ _react.forwardRef(({ isCalloutForStack = true, .
|
|
|
710
744
|
}), !_isScatterPolar && lastSupportsTextMode && lastText && /*#__PURE__*/ _react.createElement("text", {
|
|
711
745
|
key: `${lastCircleId}-label`,
|
|
712
746
|
x: xPoint2,
|
|
713
|
-
y: yPoint2 +
|
|
747
|
+
y: yPoint2 + (0, _index1.calculateMarkerRadius)({
|
|
748
|
+
pointMarkerSize: currentMarkerSize,
|
|
749
|
+
minMarkerSize: 0,
|
|
750
|
+
maxMarkerSize,
|
|
751
|
+
extraMaxPixels,
|
|
752
|
+
isContinuousXY: true
|
|
753
|
+
}) + 12,
|
|
714
754
|
className: classes.markerLabel
|
|
715
755
|
}, text)) : /*#__PURE__*/ _react.createElement("path", {
|
|
716
756
|
id: lastCircleId,
|