@fluentui/react-charts 0.0.0-nightly-20250826-2140.1 → 0.0.0-nightly-20250827-0407.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.md +48 -15
- package/dist/index.d.ts +15 -1
- package/lib/components/AreaChart/AreaChart.js +4 -1
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -15
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js +87 -6
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +24 -24
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +17 -14
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +6 -33
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +42 -16
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +20 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +493 -259
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +6 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +21 -4
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +23 -4
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +4 -17
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +4 -21
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +175 -114
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +26 -6
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +137 -82
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +23 -10
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +4 -21
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +12 -25
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +95 -59
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +27 -7
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +8 -14
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +27 -4
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +8 -6
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +5 -19
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +61 -44
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +7 -6
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +4 -19
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/utilities/Common.styles.js +47 -0
- package/lib/utilities/Common.styles.js.map +1 -0
- package/lib/utilities/Common.styles.raw.js +47 -0
- package/lib/utilities/Common.styles.raw.js.map +1 -0
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.js +63 -0
- package/lib/utilities/scatterpolar-utils.js.map +1 -0
- package/lib/utilities/utilities.js +32 -37
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +4 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +2 -14
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.js +87 -6
- package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +24 -24
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +15 -13
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +4 -32
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +41 -15
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +23 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +500 -257
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +6 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +32 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +8 -4
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +22 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -19
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -20
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +174 -113
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +25 -5
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +136 -81
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +30 -9
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +2 -20
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +23 -33
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +1 -12
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +94 -58
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +37 -5
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +7 -13
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +26 -3
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +5 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -17
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +60 -43
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +5 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -18
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.js +71 -0
- package/lib-commonjs/utilities/Common.styles.js.map +1 -0
- package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
- package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.js +78 -0
- package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
- package/lib-commonjs/utilities/utilities.js +28 -40
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/LineChart/LineChart.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { RenderFunction } from '../../utilities/index';\nimport {\n ChartProps,\n LineChartPoints,\n Margins,\n Basestate,\n RefArrayData,\n CustomizedCalloutData,\n} from '../../types/index';\nimport { EventAnnotation } from '../../types/EventAnnotation';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n ChildProps,\n} from '../CommonComponents/index';\n\nexport type { ChildProps, LineChartPoints, Margins, Basestate, RefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface LineChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: ChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LineChartStyles;\n\n /**\n * Show event annotation\n */\n eventAnnotationProps?: EventsAnnotationProps;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: CustomizedCalloutData) => string | undefined;\n\n /*\n * Color fill bars for the chart,\n */\n colorFillBars?: ColorFillBarsProps[];\n\n /**\n * if this is set to true, then for each line there will be a unique shape assigned to the point,\n * there are total 8 shapes which are as follow circle, square, triangele, diamond, pyramid,\n * hexagon, pentagon and octagon, which will get assigned as respectively, if there are more\n * than 8 lines in the line chart then it will again start from cicle to octagon.\n * setting this flag to true will also change the behavior of the points, like for a\n * line, last point shape and first point shape will be visible all the times, and all\n * other points will get enlarge only when hovered over them\n * if set to false default shape will be circle, with the existing behavior\n * @default false\n */\n allowMultipleShapesForPoints?: boolean;\n\n /*\n * Optimize line chart rendering for large data set. If this prop is enabled, line chart\n * can easily render over 10K datapoints with multiple lines smoothly.\n * This rendering mechanism does not support gaps in lines.\n */\n optimizeLargeData?: boolean;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * @default false\n * The prop used to enable the perf optimization\n */\n enablePerfOptimization?: boolean;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface EventsAnnotationProps {\n events: EventAnnotation[];\n strokeColor?: string;\n labelColor?: string;\n labelHeight?: number;\n labelWidth?: number;\n mergedLabel: (count: number) => string;\n}\n\n/**\n * Line Chart styles\n * {@docCategory LineChart}\n */\nexport interface LineChartStyles extends CartesianChartStyles {\n /**\n * styles for line border\n */\n lineBorder?: string;\n\n /**\n * styles for marker label\n */\n markerLabel?: string;\n}\n\n/**\n * Line Chart style properties\n * {@docCategory LineChart}\n */\nexport interface LineChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarsProps {\n legend: string;\n color: string;\n data: ColorFillBarData[];\n applyPattern?: boolean;\n onLegendClick?: (selectedLegend: string | string[] | null) => void | undefined;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarData {\n startX: number | Date;\n endX: number | Date;\n}\n"],"names":[],"mappings":"AAAA,uDAAuD,
|
|
1
|
+
{"version":3,"sources":["../src/components/LineChart/LineChart.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { RenderFunction } from '../../utilities/index';\nimport {\n ChartProps,\n LineChartPoints,\n Margins,\n Basestate,\n RefArrayData,\n CustomizedCalloutData,\n} from '../../types/index';\nimport { EventAnnotation } from '../../types/EventAnnotation';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n ChildProps,\n} from '../CommonComponents/index';\n\nexport type { ChildProps, LineChartPoints, Margins, Basestate, RefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface LineChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: ChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LineChartStyles;\n\n /**\n * Show event annotation\n */\n eventAnnotationProps?: EventsAnnotationProps;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: CustomizedCalloutData) => string | undefined;\n\n /*\n * Color fill bars for the chart,\n */\n colorFillBars?: ColorFillBarsProps[];\n\n /**\n * if this is set to true, then for each line there will be a unique shape assigned to the point,\n * there are total 8 shapes which are as follow circle, square, triangele, diamond, pyramid,\n * hexagon, pentagon and octagon, which will get assigned as respectively, if there are more\n * than 8 lines in the line chart then it will again start from cicle to octagon.\n * setting this flag to true will also change the behavior of the points, like for a\n * line, last point shape and first point shape will be visible all the times, and all\n * other points will get enlarge only when hovered over them\n * if set to false default shape will be circle, with the existing behavior\n * @default false\n */\n allowMultipleShapesForPoints?: boolean;\n\n /*\n * Optimize line chart rendering for large data set. If this prop is enabled, line chart\n * can easily render over 10K datapoints with multiple lines smoothly.\n * This rendering mechanism does not support gaps in lines.\n */\n optimizeLargeData?: boolean;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * @default false\n * The prop used to enable the perf optimization\n */\n enablePerfOptimization?: boolean;\n\n /**\n * To enable callout for individual line or complete stack.\n * @default true\n * @type \\{boolean \\}\n */\n isCalloutForStack?: boolean;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface EventsAnnotationProps {\n events: EventAnnotation[];\n strokeColor?: string;\n labelColor?: string;\n labelHeight?: number;\n labelWidth?: number;\n mergedLabel: (count: number) => string;\n}\n\n/**\n * Line Chart styles\n * {@docCategory LineChart}\n */\nexport interface LineChartStyles extends CartesianChartStyles {\n /**\n * styles for line border\n */\n lineBorder?: string;\n\n /**\n * styles for marker label\n */\n markerLabel?: string;\n}\n\n/**\n * Line Chart style properties\n * {@docCategory LineChart}\n */\nexport interface LineChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarsProps {\n legend: string;\n color: string;\n data: ColorFillBarData[];\n applyPattern?: boolean;\n onLegendClick?: (selectedLegend: string | string[] | null) => void | undefined;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarData {\n startX: number | Date;\n endX: number | Date;\n}\n"],"names":[],"mappings":"AAAA,uDAAuD,GAgJvD;;CAEC,GACD,WAGC"}
|
|
@@ -40,6 +40,10 @@ const linechartClassNames = {
|
|
|
40
40
|
* Base Styles
|
|
41
41
|
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
42
42
|
tooltip: {
|
|
43
|
+
Bahqtrf: "fk6fouc",
|
|
44
|
+
Be2twd7: "fkhj508",
|
|
45
|
+
Bhrd7zp: "figsok6",
|
|
46
|
+
Bg96gwp: "f1i3iumi",
|
|
43
47
|
mc9l5x: "f22iagw",
|
|
44
48
|
Beiy3e4: "f1vx9l62",
|
|
45
49
|
z8tnut: "f17mpqex",
|
|
@@ -55,24 +59,34 @@ const linechartClassNames = {
|
|
|
55
59
|
qhf8xq: "f1euv43f",
|
|
56
60
|
fsow6f: "f17mccla",
|
|
57
61
|
Bhzewxz: "fr6rvge",
|
|
58
|
-
|
|
62
|
+
De3pzq: "fxugw4r",
|
|
59
63
|
Beyfa6y: 0,
|
|
60
64
|
Bbmb7ep: 0,
|
|
61
65
|
Btl43ni: 0,
|
|
62
66
|
B7oj6ja: 0,
|
|
63
67
|
Dimara: "fq9zq91",
|
|
64
|
-
Bkecrkj: "f1aehjj5"
|
|
68
|
+
Bkecrkj: "f1aehjj5",
|
|
69
|
+
sj55zd: "f19n0e5"
|
|
70
|
+
},
|
|
71
|
+
markerLabel: {
|
|
72
|
+
Bahqtrf: "fk6fouc",
|
|
73
|
+
Be2twd7: "fkhj508",
|
|
74
|
+
Bhrd7zp: "figsok6",
|
|
75
|
+
Bg96gwp: "f1i3iumi",
|
|
76
|
+
Bkfmm31: "fhuob2q",
|
|
77
|
+
jzqdnp: "fdxigdc",
|
|
78
|
+
a6j6cd: "folz2wl"
|
|
65
79
|
},
|
|
66
80
|
lineBorder: {
|
|
67
81
|
ojy3ng: "f1yuyku4",
|
|
68
82
|
Bpvj6i6: "fdvt8h6"
|
|
69
|
-
},
|
|
70
|
-
markerLabel: {
|
|
71
|
-
Bkfmm31: "fhuob2q",
|
|
72
|
-
jzqdnp: "fdxigdc"
|
|
73
83
|
}
|
|
74
84
|
}, {
|
|
75
85
|
d: [
|
|
86
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
87
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
88
|
+
".figsok6{font-weight:var(--fontWeightRegular);}",
|
|
89
|
+
".f1i3iumi{line-height:var(--lineHeightBase300);}",
|
|
76
90
|
".f22iagw{display:flex;}",
|
|
77
91
|
".f1vx9l62{flex-direction:column;}",
|
|
78
92
|
".f17mpqex{padding-top:var(--spacingHorizontalS);}",
|
|
@@ -82,7 +96,7 @@ const linechartClassNames = {
|
|
|
82
96
|
".f1euv43f{position:absolute;}",
|
|
83
97
|
".f17mccla{text-align:center;}",
|
|
84
98
|
".fr6rvge{top:var(--spacingVerticalNone);}",
|
|
85
|
-
".
|
|
99
|
+
".fxugw4r{background-color:var(--colorNeutralBackground1);}",
|
|
86
100
|
[
|
|
87
101
|
".fq9zq91{border-radius:var(--borderRadiusSmall);}",
|
|
88
102
|
{
|
|
@@ -90,11 +104,18 @@ const linechartClassNames = {
|
|
|
90
104
|
}
|
|
91
105
|
],
|
|
92
106
|
".f1aehjj5{pointer-events:none;}",
|
|
93
|
-
".
|
|
107
|
+
".f19n0e5{color:var(--colorNeutralForeground1);}",
|
|
94
108
|
".fhuob2q{fill:var(--colorNeutralForeground1);}",
|
|
95
|
-
".fdxigdc{text-anchor:middle;}"
|
|
109
|
+
".fdxigdc{text-anchor:middle;}",
|
|
110
|
+
".f1yuyku4{stroke:var(--colorNeutralBackground1);}"
|
|
96
111
|
],
|
|
97
112
|
m: [
|
|
113
|
+
[
|
|
114
|
+
"@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.folz2wl{fill:CanvasText;}}",
|
|
115
|
+
{
|
|
116
|
+
m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
98
119
|
[
|
|
99
120
|
"@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.fdvt8h6{stroke:Canvas;}}",
|
|
100
121
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLineChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses
|
|
1
|
+
{"version":3,"sources":["useLineChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getMarkerLabelStyle, getTooltipStyle } from '../../utilities/index';\n/**\n * @internal\n */ export const linechartClassNames = {\n tooltip: 'fui-line__tooltip',\n lineBorder: 'fui-line_lineBorder',\n markerLabel: 'fui-line__markerLabel',\n root: 'fui-line__root',\n xAxis: 'fui-line__xAxis',\n yAxis: 'fui-line__yAxis',\n legendContainer: 'fui-line__legendContainer',\n hover: 'fui-line__hover',\n descriptionMessage: 'fui-line__descriptionMessage',\n axisTitle: 'fui-line__axisTitle',\n chartTitle: 'fui-line__chartTitle',\n opacityChangeOnHover: 'fui-line__opacityChangeOnHover',\n shapeStyles: 'fui-line__shapeStyles',\n chartWrapper: 'fui-line__chartWrapper',\n svgTooltip: '',\n chart: '',\n axisAnnotation: ''\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n tooltip: getTooltipStyle(),\n markerLabel: getMarkerLabelStyle(),\n lineBorder: {\n stroke: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n stroke: 'Canvas'\n }\n }\n});\n/**\n * Apply styling to the Carousel slots based on the state\n */ export const useLineChartStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(linechartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n lineBorder: mergeClasses(linechartClassNames.lineBorder, baseStyles.lineBorder /*props.styles?.lineBorder*/ ),\n markerLabel: mergeClasses(linechartClassNames.markerLabel, baseStyles.markerLabel /*props.styles?.markerLabel*/ )\n };\n};\n"],"names":["__styles","mergeClasses","tokens","HighContrastSelector","getMarkerLabelStyle","getTooltipStyle","linechartClassNames","tooltip","lineBorder","markerLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","axisAnnotation","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","Bkfmm31","jzqdnp","a6j6cd","ojy3ng","Bpvj6i6","d","p","m","useLineChartStyles","props","baseStyles"],"mappings":";;;;;;;;;;;IAMiBM,mBAAmB;;;IAiCnBgD,kBAAkB;;;;uBAvCM,gBAAgB;AAM9C,4BAA4B;IACnC/C,OAAO,EAAE,mBAAmB;IAC5BC,UAAU,EAAE,qBAAqB;IACjCC,WAAW,EAAE,uBAAuB;IACpCC,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,iBAAiB;IACxBC,KAAK,EAAE,iBAAiB;IACxBC,eAAe,EAAE,2BAA2B;IAC5CC,KAAK,EAAE,iBAAiB;IACxBC,kBAAkB,EAAE,8BAA8B;IAClDC,SAAS,EAAE,qBAAqB;IAChCC,UAAU,EAAE,sBAAsB;IAClCC,oBAAoB,EAAE,gCAAgC;IACtDC,WAAW,EAAE,uBAAuB;IACpCC,YAAY,EAAE,wBAAwB;IACtCC,UAAU,EAAE,EAAE;IACdC,KAAK,EAAE,EAAE;IACTC,cAAc,EAAE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,mBAAY,EAACK,mBAAmB,CAACC,OAAO,EAAEiD,UAAU,CAACjD,OAAO,CAAC,uBAAA,EAA0B,CAAC;QACjGC,UAAU,MAAEP,mBAAY,EAACK,mBAAmB,CAACE,UAAU,EAAEgD,UAAU,CAAChD,UAAU,CAAC,0BAAA,EAA6B,CAAC;QAC7GC,WAAW,MAAER,mBAAY,EAACK,mBAAmB,CAACG,WAAW,EAAE+C,UAAU,CAAC/C,WAAW,CAAC,2BAAA,EAA8B;IACpH,CAAC;AACL,CAAC"}
|
|
@@ -41,31 +41,13 @@ const linechartClassNames = {
|
|
|
41
41
|
/**
|
|
42
42
|
* Base Styles
|
|
43
43
|
*/ const useStyles = (0, _react.makeStyles)({
|
|
44
|
-
tooltip:
|
|
45
|
-
|
|
46
|
-
flexDirection: 'column',
|
|
47
|
-
..._react.shorthands.padding(_reacttheme.tokens.spacingHorizontalS),
|
|
48
|
-
position: 'absolute',
|
|
49
|
-
textAlign: 'center',
|
|
50
|
-
top: _reacttheme.tokens.spacingVerticalNone,
|
|
51
|
-
fill: _reacttheme.tokens.colorNeutralBackground1,
|
|
52
|
-
borderRadius: _reacttheme.tokens.borderRadiusSmall,
|
|
53
|
-
pointerEvents: 'none'
|
|
54
|
-
},
|
|
44
|
+
tooltip: (0, _index.getTooltipStyle)(),
|
|
45
|
+
markerLabel: (0, _index.getMarkerLabelStyle)(),
|
|
55
46
|
lineBorder: {
|
|
56
47
|
stroke: _reacttheme.tokens.colorNeutralBackground1,
|
|
57
48
|
[_index.HighContrastSelector]: {
|
|
58
49
|
stroke: 'Canvas'
|
|
59
50
|
}
|
|
60
|
-
},
|
|
61
|
-
markerLabel: {
|
|
62
|
-
fill: _reacttheme.tokens.colorNeutralForeground1,
|
|
63
|
-
textAnchor: 'middle',
|
|
64
|
-
selectors: {
|
|
65
|
-
[_index.HighContrastSelector]: {
|
|
66
|
-
fill: 'CanvasText'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
51
|
}
|
|
70
52
|
});
|
|
71
53
|
const useLineChartStyles = (props)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/LineChart/useLineChartStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses
|
|
1
|
+
{"version":3,"sources":["../src/components/LineChart/useLineChartStyles.styles.ts"],"sourcesContent":["import { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { LineChartProps, LineChartStyles } from './LineChart.types';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getMarkerLabelStyle, getTooltipStyle } from '../../utilities/index';\n\n/**\n * @internal\n */\nexport const linechartClassNames: SlotClassNames<LineChartStyles> = {\n tooltip: 'fui-line__tooltip',\n lineBorder: 'fui-line_lineBorder',\n markerLabel: 'fui-line__markerLabel',\n root: 'fui-line__root',\n xAxis: 'fui-line__xAxis',\n yAxis: 'fui-line__yAxis',\n legendContainer: 'fui-line__legendContainer',\n hover: 'fui-line__hover',\n descriptionMessage: 'fui-line__descriptionMessage',\n axisTitle: 'fui-line__axisTitle',\n chartTitle: 'fui-line__chartTitle',\n opacityChangeOnHover: 'fui-line__opacityChangeOnHover',\n shapeStyles: 'fui-line__shapeStyles',\n chartWrapper: 'fui-line__chartWrapper',\n svgTooltip: '',\n chart: '',\n axisAnnotation: '',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n tooltip: getTooltipStyle() as GriffelStyle,\n markerLabel: getMarkerLabelStyle() as GriffelStyle,\n lineBorder: {\n stroke: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n stroke: 'Canvas',\n },\n },\n});\n\n/**\n * Apply styling to the Carousel slots based on the state\n */\nexport const useLineChartStyles = (props: LineChartProps): LineChartStyles => {\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(linechartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/),\n lineBorder: mergeClasses(linechartClassNames.lineBorder, baseStyles.lineBorder /*props.styles?.lineBorder*/),\n markerLabel: mergeClasses(linechartClassNames.markerLabel, baseStyles.markerLabel /*props.styles?.markerLabel*/),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","HighContrastSelector","getMarkerLabelStyle","getTooltipStyle","linechartClassNames","tooltip","lineBorder","markerLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","axisAnnotation","useStyles","stroke","colorNeutralBackground1","useLineChartStyles","props","baseStyles"],"mappings":";;;;;;;;;;;IAUaM,mBAAAA;;;sBAqCAqB;eAAAA;;;uBA/C0C,iBAAiB;4BACjD,wBAAwB;uBAGV,wBAAwB;AAMtD,4BAA6D;IAClEpB,SAAS;IACTC,YAAY;IACZC,aAAa;IACbC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,iBAAiB;IACjBC,OAAO;IACPC,oBAAoB;IACpBC,WAAW;IACXC,YAAY;IACZC,sBAAsB;IACtBC,aAAa;IACbC,cAAc;IACdC,YAAY;IACZC,OAAO;IACPC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYxB,iBAAAA,EAAW;IAC3BO,aAASF,sBAAAA;IACTI,iBAAaL,0BAAAA;IACbI,YAAY;QACViB,QAAQvB,kBAAAA,CAAOwB,uBAAuB;QACtC,CAACvB,2BAAAA,CAAqB,EAAE;YACtBsB,QAAQ;QACV;IACF;AACF;AAKO,2BAA2B,CAACG;IACjC,MAAMC,aAAaL;IACnB,OAAO;QACLjB,aAASN,mBAAAA,EAAaK,oBAAoBC,OAAO,EAAEsB,WAAWtB,OAAO,CAAC,uBAAuB;QAC7FC,gBAAYP,mBAAAA,EAAaK,oBAAoBE,UAAU,EAAEqB,WAAWrB,UAAU,CAAC,0BAA0B;QACzGC,iBAAaR,mBAAAA,EAAaK,oBAAoBG,WAAW,EAAEoB,WAAWpB,WAAW,CAAC,2BAA2B;IAC/G;AACF,EAAE"}
|
|
@@ -56,31 +56,27 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
56
56
|
Bg96gwp: "f1i3iumi",
|
|
57
57
|
mc9l5x: "f22iagw",
|
|
58
58
|
Beiy3e4: "f1vx9l62",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
z8tnut: "f17mpqex",
|
|
60
|
+
z189sj: [
|
|
61
|
+
"f1vdfbxk",
|
|
62
|
+
"f1f5gg8d"
|
|
63
|
+
],
|
|
64
|
+
Byoj8tv: "fdvome7",
|
|
65
|
+
uwmqm3: [
|
|
66
|
+
"f1f5gg8d",
|
|
67
|
+
"f1vdfbxk"
|
|
68
|
+
],
|
|
64
69
|
qhf8xq: "f1euv43f",
|
|
65
70
|
fsow6f: "f17mccla",
|
|
66
|
-
Bhzewxz: "
|
|
67
|
-
|
|
68
|
-
B2eet1l: 0,
|
|
69
|
-
De3pzq: 0,
|
|
70
|
-
Bcmaq0h: 0,
|
|
71
|
-
gk0gix: 0,
|
|
72
|
-
B20660r: 0,
|
|
73
|
-
B8a6bjv: 0,
|
|
74
|
-
Bpptf2m: 0,
|
|
75
|
-
e5kdtc: 0,
|
|
76
|
-
Bkjc3bi: 0,
|
|
77
|
-
ayd6f0: "fcm7iae",
|
|
71
|
+
Bhzewxz: "fr6rvge",
|
|
72
|
+
De3pzq: "fxugw4r",
|
|
78
73
|
Beyfa6y: 0,
|
|
79
74
|
Bbmb7ep: 0,
|
|
80
75
|
Btl43ni: 0,
|
|
81
76
|
B7oj6ja: 0,
|
|
82
|
-
Dimara: "
|
|
83
|
-
Bkecrkj: "f1aehjj5"
|
|
77
|
+
Dimara: "fq9zq91",
|
|
78
|
+
Bkecrkj: "f1aehjj5",
|
|
79
|
+
sj55zd: "f19n0e5"
|
|
84
80
|
},
|
|
85
81
|
nodeTextContainer: {
|
|
86
82
|
B3gqxw3: "fk6oafs",
|
|
@@ -122,28 +118,22 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
122
118
|
".f5q6cfr{fill:var(--colorNeutralBackground1);}",
|
|
123
119
|
".fu2q8de{stroke-width:3px;}",
|
|
124
120
|
".f1yc5x8p{fill:#F5F5F5;}",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
],
|
|
121
|
+
".f17mpqex{padding-top:var(--spacingHorizontalS);}",
|
|
122
|
+
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
|
|
123
|
+
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
|
|
124
|
+
".fdvome7{padding-bottom:var(--spacingHorizontalS);}",
|
|
131
125
|
".f1euv43f{position:absolute;}",
|
|
132
126
|
".f17mccla{text-align:center;}",
|
|
133
|
-
".
|
|
134
|
-
|
|
135
|
-
".fcm7iae{background:var(--colorNeutralBackground1);}",
|
|
136
|
-
{
|
|
137
|
-
p: -2
|
|
138
|
-
}
|
|
139
|
-
],
|
|
127
|
+
".fr6rvge{top:var(--spacingVerticalNone);}",
|
|
128
|
+
".fxugw4r{background-color:var(--colorNeutralBackground1);}",
|
|
140
129
|
[
|
|
141
|
-
".
|
|
130
|
+
".fq9zq91{border-radius:var(--borderRadiusSmall);}",
|
|
142
131
|
{
|
|
143
132
|
p: -1
|
|
144
133
|
}
|
|
145
134
|
],
|
|
146
135
|
".f1aehjj5{pointer-events:none;}",
|
|
136
|
+
".f19n0e5{color:var(--colorNeutralForeground1);}",
|
|
147
137
|
".fvjh0tl{margin-top:4px;}",
|
|
148
138
|
".ff9s3yw{margin-left:8px;}",
|
|
149
139
|
".f1phki43{margin-right:8px;}",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSankeyChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\nexport const sankeyChartClassNames = {\n root: 'fui-sc__root',\n nodes: 'fui-sc__nodes',\n links: 'fui-sc__links',\n nodeTextContainer: 'fui-sc__nodeTextContainer',\n toolTip: 'fui-sc__toolTip',\n chartWrapper: 'fui-sc__chartWrapper',\n chart: 'fui-sc__chart'\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden'\n },\n links: {\n fill: tokens.colorNeutralBackground1,\n strokeWidth: '3px',\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n nodes: {\n fill: '#F5F5F5',\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n toolTip:
|
|
1
|
+
{"version":3,"sources":["useSankeyChartStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getTooltipStyle } from '../../utilities/index';\nexport const sankeyChartClassNames = {\n root: 'fui-sc__root',\n nodes: 'fui-sc__nodes',\n links: 'fui-sc__links',\n nodeTextContainer: 'fui-sc__nodeTextContainer',\n toolTip: 'fui-sc__toolTip',\n chartWrapper: 'fui-sc__chartWrapper',\n chart: 'fui-sc__chart'\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden'\n },\n links: {\n fill: tokens.colorNeutralBackground1,\n strokeWidth: '3px',\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n nodes: {\n fill: '#F5F5F5',\n [HighContrastSelector]: {\n fill: 'Canvas'\n }\n },\n toolTip: getTooltipStyle(),\n nodeTextContainer: {\n '& text': {\n [HighContrastSelector]: {\n fill: 'CanvasText'\n }\n },\n marginTop: '4px',\n marginLeft: '8px',\n marginBottom: '4px',\n marginRight: '8px'\n },\n chartWrapper: {\n overflow: 'auto'\n },\n chart: {\n display: 'block'\n }\n});\nexport const useSankeyChartStyles = (props)=>{\n var _props_styles, _props_reflowProps, _props_styles1, _props_styles2;\n const baseStyles = useStyles();\n return {\n root: mergeClasses(sankeyChartClassNames.root, baseStyles.root, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n nodes: mergeClasses(sankeyChartClassNames.nodes, baseStyles.nodes /*, props.styles?.nodes*/ ),\n links: mergeClasses(sankeyChartClassNames.links, baseStyles.links /*, props.styles?.links*/ ),\n nodeTextContainer: mergeClasses(sankeyChartClassNames.nodeTextContainer, baseStyles.nodeTextContainer /*, props.styles?.nodeTextContainer*/ ),\n toolTip: mergeClasses(sankeyChartClassNames.toolTip, baseStyles.toolTip /*, props.styles?.toolTip*/ ),\n chartWrapper: mergeClasses(sankeyChartClassNames.chartWrapper, ((_props_reflowProps = props.reflowProps) === null || _props_reflowProps === void 0 ? void 0 : _props_reflowProps.mode) === 'min-width' ? baseStyles.chartWrapper : '', (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.chartWrapper),\n chart: mergeClasses(sankeyChartClassNames.chart, baseStyles.chart, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.chart)\n };\n};\n"],"names":["__styles","mergeClasses","tokens","typographyStyles","HighContrastSelector","getTooltipStyle","sankeyChartClassNames","root","nodes","links","nodeTextContainer","toolTip","chartWrapper","chart","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","a9b677","Bqenvij","Beiy3e4","B68tc82","Bmxbyg5","Bpg54ce","Bkfmm31","Be5yapy","a6j6cd","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","B3gqxw3","B6of3ja","Frg6f3","jrapky","t21cq0","d","p","m","useSankeyChartStyles","props","_props_styles","_props_reflowProps","_props_styles1","_props_styles2","baseSty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'column',
|
|
57
|
-
padding: '8px',
|
|
58
|
-
position: 'absolute',
|
|
59
|
-
textAlign: 'center',
|
|
60
|
-
top: '0px',
|
|
61
|
-
background: _reacttheme.tokens.colorNeutralBackground1,
|
|
62
|
-
borderRadius: '2px',
|
|
63
|
-
pointerEvents: 'none'
|
|
64
|
-
},
|
|
53
|
+
toolTip: (0, _index.getTooltipStyle)(),
|
|
65
54
|
nodeTextContainer: {
|
|
66
55
|
'& text': {
|
|
67
56
|
[_index.HighContrastSelector]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SankeyChart/useSankeyChartStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SankeyChartProps, SankeyChartStyles } from './SankeyChart.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n\nexport const sankeyChartClassNames: SlotClassNames<SankeyChartStyles> = {\n root: 'fui-sc__root',\n nodes: 'fui-sc__nodes',\n links: 'fui-sc__links',\n nodeTextContainer: 'fui-sc__nodeTextContainer',\n toolTip: 'fui-sc__toolTip',\n chartWrapper: 'fui-sc__chartWrapper',\n chart: 'fui-sc__chart',\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n },\n links: {\n fill: tokens.colorNeutralBackground1,\n strokeWidth: '3px',\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n nodes: {\n fill: '#F5F5F5',\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n toolTip:
|
|
1
|
+
{"version":3,"sources":["../src/components/SankeyChart/useSankeyChartStyles.styles.ts"],"sourcesContent":["import { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SankeyChartProps, SankeyChartStyles } from './SankeyChart.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getTooltipStyle } from '../../utilities/index';\n\nexport const sankeyChartClassNames: SlotClassNames<SankeyChartStyles> = {\n root: 'fui-sc__root',\n nodes: 'fui-sc__nodes',\n links: 'fui-sc__links',\n nodeTextContainer: 'fui-sc__nodeTextContainer',\n toolTip: 'fui-sc__toolTip',\n chartWrapper: 'fui-sc__chartWrapper',\n chart: 'fui-sc__chart',\n};\nconst useStyles = makeStyles({\n root: {\n ...typographyStyles.body1,\n display: 'flex',\n width: '100%',\n height: '100%',\n flexDirection: 'column',\n overflow: 'hidden',\n },\n links: {\n fill: tokens.colorNeutralBackground1,\n strokeWidth: '3px',\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n nodes: {\n fill: '#F5F5F5',\n [HighContrastSelector]: {\n fill: 'Canvas',\n },\n },\n toolTip: getTooltipStyle() as GriffelStyle,\n nodeTextContainer: {\n '& text': {\n [HighContrastSelector]: {\n fill: 'CanvasText',\n },\n },\n\n marginTop: '4px',\n marginLeft: '8px',\n marginBottom: '4px',\n marginRight: '8px',\n },\n chartWrapper: {\n overflow: 'auto',\n },\n chart: {\n display: 'block',\n },\n});\n\nexport const useSankeyChartStyles = (props: SankeyChartProps): SankeyChartStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(sankeyChartClassNames.root, baseStyles.root, props.styles?.root),\n nodes: mergeClasses(sankeyChartClassNames.nodes, baseStyles.nodes /*, props.styles?.nodes*/),\n links: mergeClasses(sankeyChartClassNames.links, baseStyles.links /*, props.styles?.links*/),\n nodeTextContainer: mergeClasses(\n sankeyChartClassNames.nodeTextContainer,\n baseStyles.nodeTextContainer /*, props.styles?.nodeTextContainer*/,\n ),\n toolTip: mergeClasses(sankeyChartClassNames.toolTip, baseStyles.toolTip /*, props.styles?.toolTip*/),\n chartWrapper: mergeClasses(\n sankeyChartClassNames.chartWrapper,\n props.reflowProps?.mode === 'min-width' ? baseStyles.chartWrapper : '',\n props.styles?.chartWrapper,\n ),\n chart: mergeClasses(sankeyChartClassNames.chart, baseStyles.chart, props.styles?.chart),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","HighContrastSelector","getTooltipStyle","sankeyChartClassNames","root","nodes","links","nodeTextContainer","toolTip","chartWrapper","chart","useStyles","body1","display","width","height","flexDirection","overflow","fill","colorNeutralBackground1","strokeWidth","marginTop","marginLeft","marginBottom","marginRight","useSankeyChartStyles","props","baseStyles","styles","reflowProps","mode"],"mappings":";;;;;;;;;;;IAOaM,qBAAAA;;;wBAoDAsB;eAAAA;;;uBA3D0C,iBAAiB;4BAG/B,wBAAwB;uBAC5B,wBAAwB;AAGtD,8BAAiE;IACtErB,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,mBAAmB;IACnBC,SAAS;IACTC,cAAc;IACdC,OAAO;AACT,EAAE;AACF,MAAMC,YAAYd,qBAAAA,EAAW;IAC3BO,MAAM;QACJ,GAAGJ,4BAAAA,CAAiBY,KAAK;QACzBC,SAAS;QACTC,OAAO;QACPC,QAAQ;QACRC,eAAe;QACfC,UAAU;IACZ;IACAX,OAAO;QACLY,MAAMnB,kBAAAA,CAAOoB,uBAAuB;QACpCC,aAAa;QACb,CAACnB,2BAAAA,CAAqB,EAAE;YACtBiB,MAAM;QACR;IACF;IACAb,OAAO;QACLa,MAAM;QACN,CAACjB,2BAAAA,CAAqB,EAAE;YACtBiB,MAAM;QACR;IACF;IACAV,aAASN,sBAAAA;IACTK,mBAAmB;QACjB,UAAU;YACR,CAACN,2BAAAA,CAAqB,EAAE;gBACtBiB,MAAM;YACR;QACF;QAEAG,WAAW;QACXC,YAAY;QACZC,cAAc;QACdC,aAAa;IACf;IACAf,cAAc;QACZQ,UAAU;IACZ;IACAP,OAAO;QACLG,SAAS;IACX;AACF;AAEO,6BAA6B,CAACa;QAI+BA,eAU9DA,oBACAA,gBAEiEA;IAhBrE,MAAMC,aAAahB;IAEnB,OAAO;QACLP,UAAMN,mBAAAA,EAAaK,sBAAsBC,IAAI,EAAEuB,WAAWvB,IAAI,EAAA,CAAEsB,gBAAAA,MAAME,MAAAA,AAAM,MAAA,QAAZF,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAActB,IAAI;QAClFC,WAAOP,mBAAAA,EAAaK,sBAAsBE,KAAK,EAAEsB,WAAWtB,KAAK,CAAC,uBAAuB;QACzFC,WAAOR,mBAAAA,EAAaK,sBAAsBG,KAAK,EAAEqB,WAAWrB,KAAK,CAAC,uBAAuB;QACzFC,uBAAmBT,mBAAAA,EACjBK,sBAAsBI,iBAAiB,EACvCoB,WAAWpB,iBAAiB,CAAC,mCAAmC;QAElEC,aAASV,mBAAAA,EAAaK,sBAAsBK,OAAO,EAAEmB,WAAWnB,OAAO,CAAC,yBAAyB;QACjGC,kBAAcX,mBAAAA,EACZK,sBAAsBM,YAAY,EAClCiB,CAAAA,CAAAA,qBAAAA,MAAMG,WAAAA,AAAW,MAAA,QAAjBH,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAmBI,IAAAA,AAAI,MAAK,cAAcH,WAAWlB,YAAY,GAAG,IAAA,CACpEiB,iBAAAA,MAAME,MAAAA,AAAM,MAAA,QAAZF,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcjB,YAAY;QAE5BC,WAAOZ,mBAAAA,EAAaK,sBAAsBO,KAAK,EAAEiB,WAAWjB,KAAK,EAAA,CAAEgB,iBAAAA,MAAME,MAAAA,AAAM,MAAA,QAAZF,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAchB,KAAK;IACxF;AACF,EAAE"}
|
|
@@ -19,6 +19,7 @@ const _index1 = require("../../utilities/index");
|
|
|
19
19
|
const _index2 = require("../../index");
|
|
20
20
|
const _reacttheme = require("@fluentui/react-theme");
|
|
21
21
|
const _imageexportutils = require("../../utilities/image-export-utils");
|
|
22
|
+
const _scatterpolarutils = require("../../utilities/scatterpolar-utils");
|
|
22
23
|
const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
23
24
|
var _props_legendProps, _props_legendProps1;
|
|
24
25
|
const _circleId = (0, _reactutilities.useId)('circle');
|
|
@@ -60,6 +61,8 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
60
61
|
const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
|
|
61
62
|
const [selectedLegends, setSelectedLegends] = _react.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
|
|
62
63
|
const prevSelectedLegendsRef = _react.useRef(undefined);
|
|
64
|
+
const _isTextMode = _react.useRef(false);
|
|
65
|
+
const _isScatterPolarRef = _react.useRef(false);
|
|
63
66
|
_react.useEffect(()=>{
|
|
64
67
|
var _props_legendProps, _props_legendProps1;
|
|
65
68
|
if (prevSelectedLegendsRef.current && !(0, _index1.areArraysEqual)(prevSelectedLegendsRef.current, (_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends)) {
|
|
@@ -154,6 +157,8 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
154
157
|
function _initializeScatterChartData(xScale, yScale, containerHeight, containerWidth, xElement) {
|
|
155
158
|
_xAxisScale = xScale;
|
|
156
159
|
_yAxisScale = yScale;
|
|
160
|
+
_isTextMode.current = (0, _index1.isTextMode)(_points);
|
|
161
|
+
_isScatterPolarRef.current = (0, _index1.isScatterPolarSeries)(_points);
|
|
157
162
|
renderSeries = _createPlot(xElement, containerHeight);
|
|
158
163
|
}
|
|
159
164
|
function _onHoverCardHide() {
|
|
@@ -163,21 +168,30 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
163
168
|
function _createLegends(data) {
|
|
164
169
|
const { legendProps } = props;
|
|
165
170
|
const isLegendMultiSelectEnabled = !!(legendProps && !!legendProps.canSelectMultipleLegends);
|
|
166
|
-
const
|
|
167
|
-
|
|
171
|
+
const mapLegendToPoints = {};
|
|
172
|
+
data.forEach((point)=>{
|
|
173
|
+
if (point.legend) {
|
|
174
|
+
if (!mapLegendToPoints[point.legend]) {
|
|
175
|
+
mapLegendToPoints[point.legend] = [];
|
|
176
|
+
}
|
|
177
|
+
mapLegendToPoints[point.legend].push(point);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
const legendDataItems = Object.entries(mapLegendToPoints).map(([legendTitle, points])=>{
|
|
181
|
+
const representativePoint = points[0];
|
|
168
182
|
// mapping data to the format Legends component needs
|
|
169
183
|
const legend = {
|
|
170
|
-
title:
|
|
171
|
-
color,
|
|
184
|
+
title: legendTitle,
|
|
185
|
+
color: representativePoint.color,
|
|
172
186
|
onMouseOutAction: ()=>{
|
|
173
187
|
setActiveLegend('');
|
|
174
188
|
},
|
|
175
189
|
hoverAction: ()=>{
|
|
176
190
|
_handleChartMouseLeave();
|
|
177
|
-
setActiveLegend(
|
|
191
|
+
setActiveLegend(legendTitle);
|
|
178
192
|
},
|
|
179
|
-
...
|
|
180
|
-
shape:
|
|
193
|
+
...representativePoint.legendShape && {
|
|
194
|
+
shape: representativePoint.legendShape
|
|
181
195
|
}
|
|
182
196
|
};
|
|
183
197
|
return legend;
|
|
@@ -215,6 +229,12 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
215
229
|
return seriesColor;
|
|
216
230
|
}
|
|
217
231
|
}
|
|
232
|
+
function _getRangeForScatterMarkerSize(yScale, yPadding, xMin, xMax, xPadding) {
|
|
233
|
+
const extraXPixels = _isRTL ? _xAxisScale(xMax - xPadding) - _xAxisScale(xMax) : _xAxisScale(xMin + xPadding) - _xAxisScale(xMin);
|
|
234
|
+
const yMin = yScale.domain()[0];
|
|
235
|
+
const extraYPixels = yScale(yMin) - yScale(yMin + yPadding);
|
|
236
|
+
return Math.min(extraXPixels, extraYPixels);
|
|
237
|
+
}
|
|
218
238
|
function _createPlot(xElement, containerHeight) {
|
|
219
239
|
const series = [];
|
|
220
240
|
if (isSelectedLegend) {
|
|
@@ -229,36 +249,20 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
229
249
|
return (0, _d3array.min)(point.data, (item)=>item.y);
|
|
230
250
|
});
|
|
231
251
|
const yPadding = (yMax - yMin) * 0.1;
|
|
232
|
-
|
|
233
|
-
let
|
|
234
|
-
let
|
|
252
|
+
let xPadding = 0;
|
|
253
|
+
let xMin = 0;
|
|
254
|
+
let xMax = 0;
|
|
235
255
|
if (_xAxisType === _index1.XAxisTypes.StringAxis) {
|
|
236
256
|
_xBandwidth = _xAxisScale.bandwidth() / 2;
|
|
237
|
-
xPaddingRange = _xBandwidth;
|
|
238
|
-
} else if (_xAxisType === _index1.XAxisTypes.DateAxis) {
|
|
239
|
-
const xMin = (0, _d3array.min)(points, (point)=>{
|
|
240
|
-
return (0, _d3array.min)(point.data, (item)=>item.x);
|
|
241
|
-
});
|
|
242
|
-
const xMax = (0, _d3array.max)(points, (point)=>{
|
|
243
|
-
return (0, _d3array.max)(point.data, (item)=>{
|
|
244
|
-
return item.x;
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
const xPadding = (xMax.getTime() - xMin.getTime()) * 0.1;
|
|
248
|
-
xPaddingRange = Math.abs(_xAxisScale(new Date(xMin.getTime() + xPadding)) - _xAxisScale(xMin));
|
|
249
257
|
} else {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
});
|
|
258
|
-
const xPadding = (xMax - xMin) * 0.1;
|
|
259
|
-
xPaddingRange = Math.abs(_xAxisScale(xMin + xPadding) - _xAxisScale(xMin));
|
|
258
|
+
const isDate = _xAxisType === _index1.XAxisTypes.DateAxis;
|
|
259
|
+
const getX = (item)=>isDate ? item.x : item.x;
|
|
260
|
+
const minVal = (0, _d3array.min)(_points, (point)=>(0, _d3array.min)(point.data, getX));
|
|
261
|
+
const maxVal = (0, _d3array.max)(_points, (point)=>(0, _d3array.max)(point.data, getX));
|
|
262
|
+
xMin = isDate ? minVal.getTime() : minVal;
|
|
263
|
+
xMax = isDate ? maxVal.getTime() : maxVal;
|
|
264
|
+
xPadding = (xMax - xMin) * 0.1;
|
|
260
265
|
}
|
|
261
|
-
maxMarkerRange = Math.min(maxMarkerRange, Math.min(xPaddingRange, yPaddingRange));
|
|
262
266
|
const maxMarkerSize = (0, _d3array.max)(_points, (point)=>{
|
|
263
267
|
return (0, _d3array.max)(point.data, (item)=>{
|
|
264
268
|
return item.markerSize;
|
|
@@ -270,35 +274,62 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
270
274
|
const seriesColor = _points[i].color;
|
|
271
275
|
const verticaLineHeight = containerHeight - margins.bottom + 6;
|
|
272
276
|
for(let j = 0; j < _points[i].data.length; j++){
|
|
277
|
+
var _points_i_data_j;
|
|
273
278
|
const seriesId = `${_seriesId}_${i}_${j}`;
|
|
274
279
|
const circleId = `${_circleId}_${i}_${j}`;
|
|
275
280
|
const { x, y, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j];
|
|
276
|
-
let circleRadius = 3.5;
|
|
277
281
|
const pointMarkerSize = _points[i].data[j].markerSize;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
282
|
+
const extraMaxPixels = _xAxisType !== _index1.XAxisTypes.StringAxis ? _getRangeForScatterMarkerSize(_yAxisScale, yPadding, xMin, xMax, xPadding) : 0;
|
|
283
|
+
const minPixel = 4;
|
|
284
|
+
const maxPixel = 16;
|
|
285
|
+
const circleRadius = pointMarkerSize && maxMarkerSize !== 0 ? _xAxisType !== _index1.XAxisTypes.StringAxis ? pointMarkerSize * extraMaxPixels / maxMarkerSize : minPixel + (pointMarkerSize - minPixel) / (maxMarkerSize - minPixel) * (maxPixel - minPixel) : activePoint === circleId ? 6 : 4;
|
|
281
286
|
const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
282
287
|
const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
288
|
+
const text = _points === null || _points === void 0 ? void 0 : (_points_i_data_j = _points[i].data[j]) === null || _points_i_data_j === void 0 ? void 0 : _points_i_data_j.text;
|
|
289
|
+
if (!_isTextMode.current) {
|
|
290
|
+
pointsForSeries.push(/*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("circle", {
|
|
291
|
+
id: circleId,
|
|
292
|
+
key: circleId,
|
|
293
|
+
r: Math.max(circleRadius, 4),
|
|
294
|
+
cx: _xAxisScale(x) + _xBandwidth,
|
|
295
|
+
cy: _yAxisScale(y),
|
|
296
|
+
"data-is-focusable": isLegendSelected,
|
|
297
|
+
onMouseOver: (event)=>_handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
|
|
298
|
+
onMouseMove: (event)=>_handleHover(x, y, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event),
|
|
299
|
+
onMouseOut: _handleMouseOut,
|
|
300
|
+
onFocus: (event)=>_handleFocus(event, seriesId, x, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
|
|
301
|
+
onBlur: _handleMouseOut,
|
|
302
|
+
..._getClickHandler(_points[i].data[j].onDataPointClick),
|
|
303
|
+
opacity: isLegendSelected && !currentPointHidden ? 1 : 0.1,
|
|
304
|
+
fill: _getPointFill(seriesColor, circleId, j, false),
|
|
305
|
+
stroke: seriesColor,
|
|
306
|
+
role: "img",
|
|
307
|
+
"aria-label": _getAriaLabel(i, j),
|
|
308
|
+
tabIndex: isLegendSelected ? 0 : undefined
|
|
309
|
+
}), ",", text && /*#__PURE__*/ _react.createElement("text", {
|
|
310
|
+
key: `${circleId}-label`,
|
|
311
|
+
x: _xAxisScale(x) + _xBandwidth,
|
|
312
|
+
y: _yAxisScale(y) + Math.max(circleRadius + 12, 16),
|
|
313
|
+
className: classes.markerLabel
|
|
314
|
+
}, text)));
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (_isScatterPolarRef.current) {
|
|
318
|
+
var _points_i;
|
|
319
|
+
// Render category labels for all series at once to avoid overlap
|
|
320
|
+
const allSeriesData = _points.map((s)=>({
|
|
321
|
+
data: s.data.filter((pt)=>typeof pt.x === 'number' && typeof pt.y === 'number').map((pt)=>({
|
|
322
|
+
x: pt.x,
|
|
323
|
+
y: pt.y,
|
|
324
|
+
text: pt.text
|
|
325
|
+
}))
|
|
326
|
+
}));
|
|
327
|
+
pointsForSeries.push(...(0, _scatterpolarutils.renderScatterPolarCategoryLabels)({
|
|
328
|
+
allSeriesData,
|
|
329
|
+
xAxisScale: _xAxisScale.current,
|
|
330
|
+
yAxisScale: _yAxisScale.current,
|
|
331
|
+
className: classes.markerLabel || '',
|
|
332
|
+
lineOptions: _points === null || _points === void 0 ? void 0 : (_points_i = _points[i]) === null || _points_i === void 0 ? void 0 : _points_i.lineOptions
|
|
302
333
|
}));
|
|
303
334
|
}
|
|
304
335
|
series.push(/*#__PURE__*/ _react.createElement("g", {
|
|
@@ -426,6 +457,7 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
426
457
|
function _isChartEmpty() {
|
|
427
458
|
return !(props.data && props.data.scatterChartData && props.data.scatterChartData.length > 0 && props.data.scatterChartData.filter((item)=>item.data.length).length > 0);
|
|
428
459
|
}
|
|
460
|
+
const _getMinMaxofXAxis = _react.useCallback((points, yAxisType)=>_getNumericMinMaxOfY(points, yAxisType), []);
|
|
429
461
|
const { legendProps, tickValues, tickFormat } = props;
|
|
430
462
|
_points = _injectIndexPropertyInScatterChartData(props.data.scatterChartData);
|
|
431
463
|
let points = _points;
|
|
@@ -437,7 +469,7 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
437
469
|
// reduce computation cost by only creating legendBars
|
|
438
470
|
// if when hideLegend is false.
|
|
439
471
|
// NOTE: they are rendered only when hideLegend is false in CartesianChart.
|
|
440
|
-
if (!props.hideLegend) {
|
|
472
|
+
if (!props.hideLegend && !_isTextMode.current) {
|
|
441
473
|
legendBars = _createLegends(_points); // ToDo: Memoize legends to improve performance.
|
|
442
474
|
}
|
|
443
475
|
var _props_culture;
|
|
@@ -473,7 +505,7 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
473
505
|
getmargins: _getMargins,
|
|
474
506
|
getGraphData: _initializeScatterChartData,
|
|
475
507
|
xAxisType: _xAxisType,
|
|
476
|
-
getMinMaxOfYAxis:
|
|
508
|
+
getMinMaxOfYAxis: _getMinMaxofXAxis,
|
|
477
509
|
getDomainNRangeValues: _getDomainNRangeValues,
|
|
478
510
|
createYAxis: _index1.createNumericYAxis,
|
|
479
511
|
createStringYAxis: _index1.createStringYAxis,
|
|
@@ -481,6 +513,10 @@ const ScatterChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
|
|
|
481
513
|
enableFirstRenderOptimization: _firstRenderOptimization,
|
|
482
514
|
datasetForXAxisDomain: _xAxisLabels,
|
|
483
515
|
componentRef: cartesianChartRef,
|
|
516
|
+
..._isScatterPolarRef.current ? {
|
|
517
|
+
yMaxValue: 1,
|
|
518
|
+
yMinValue: -1
|
|
519
|
+
} : {},
|
|
484
520
|
/* eslint-disable react/jsx-no-bind */ // eslint-disable-next-line react/no-children-prop
|
|
485
521
|
children: (props)=>{
|
|
486
522
|
_xAxisScale = props.xScale;
|