@fluentui/react-charts 0.0.0-nightly-20251009-0406.1 → 0.0.0-nightly-20251010-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 +15 -15
- package/dist/index.d.ts +10 -0
- package/lib/components/CommonComponents/ChartPopover.js +2 -1
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +5 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js +8 -7
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +8 -28
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js +4 -4
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +23 -45
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +21 -46
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +110 -73
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +5 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.js +8 -7
- package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +8 -28
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -4
- package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.js +23 -45
- package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.js +21 -46
- package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +110 -73
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/types/DataPoint.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-charts
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 10 Oct 2025 04:22:54 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20251010-0407.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v0.0.0-nightly-20251010-0407.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.2..@fluentui/react-charts_v0.0.0-nightly-
|
|
9
|
+
Fri, 10 Oct 2025 04:22:54 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.2..@fluentui/react-charts_v0.0.0-nightly-20251010-0407.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/react-button to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
|
17
|
-
- Bump @fluentui/react-overflow to v0.0.0-nightly-
|
|
18
|
-
- Bump @fluentui/react-popover to v0.0.0-nightly-
|
|
19
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
20
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
21
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
22
|
-
- Bump @fluentui/react-tooltip to v0.0.0-nightly-
|
|
23
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
24
|
-
- Bump @fluentui/react-conformance to v0.0.0-nightly-
|
|
25
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/react-button to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
17
|
+
- Bump @fluentui/react-overflow to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
18
|
+
- Bump @fluentui/react-popover to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
19
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
20
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
21
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
22
|
+
- Bump @fluentui/react-tooltip to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
24
|
+
- Bump @fluentui/react-conformance to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
25
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20251010-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/3b3bdedbf7181413a70e6ae52d4f3117d54cd0c0) by beachball)
|
|
26
26
|
|
|
27
27
|
## [9.3.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.2)
|
|
28
28
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CurveFactory } from 'd3-shape';
|
|
2
2
|
import type { JSXElement } from '@fluentui/react-utilities';
|
|
3
|
+
import { PositioningShorthand } from '@fluentui/react-positioning';
|
|
3
4
|
import * as React_2 from 'react';
|
|
4
5
|
import { RefObject } from 'react';
|
|
5
6
|
import { SankeyGraph } from 'd3-sankey';
|
|
@@ -736,6 +737,7 @@ export declare interface ChartPopoverProps {
|
|
|
736
737
|
ratio?: [number, number];
|
|
737
738
|
isCartesian?: boolean;
|
|
738
739
|
styles?: Partial<PopoverComponentStyles>;
|
|
740
|
+
positioning?: PositioningShorthand;
|
|
739
741
|
}
|
|
740
742
|
|
|
741
743
|
/**
|
|
@@ -2716,6 +2718,10 @@ export declare interface LineChartDataPoint extends BaseDataPoint {
|
|
|
2716
2718
|
* text labels of marker points
|
|
2717
2719
|
*/
|
|
2718
2720
|
text?: string;
|
|
2721
|
+
/**
|
|
2722
|
+
* Per-point marker color (overrides series color when present)
|
|
2723
|
+
*/
|
|
2724
|
+
markerColor?: string;
|
|
2719
2725
|
}
|
|
2720
2726
|
|
|
2721
2727
|
/**
|
|
@@ -3440,6 +3446,10 @@ export declare interface ScatterChartDataPoint extends BaseDataPoint {
|
|
|
3440
3446
|
* text labels of marker points
|
|
3441
3447
|
*/
|
|
3442
3448
|
text?: string;
|
|
3449
|
+
/**
|
|
3450
|
+
* Per-point marker color (overrides series color when present)
|
|
3451
|
+
*/
|
|
3452
|
+
markerColor?: string;
|
|
3443
3453
|
}
|
|
3444
3454
|
|
|
3445
3455
|
/**
|
|
@@ -23,6 +23,7 @@ combining the logic for Callout and ChartHoverCard in v8 charts. */ export const
|
|
|
23
23
|
height: 0
|
|
24
24
|
})
|
|
25
25
|
};
|
|
26
|
+
const target = typeof props.positioning === 'object' && 'target' in props.positioning ? props.positioning.target !== null ? props.positioning.target : virtualElement : virtualElement;
|
|
26
27
|
props = {
|
|
27
28
|
...props,
|
|
28
29
|
...(_props_customCallout = props.customCallout) === null || _props_customCallout === void 0 ? void 0 : _props_customCallout.customCalloutProps
|
|
@@ -36,7 +37,7 @@ combining the logic for Callout and ChartHoverCard in v8 charts. */ export const
|
|
|
36
37
|
className: classes.calloutContainer
|
|
37
38
|
}, /*#__PURE__*/ React.createElement(Popover, {
|
|
38
39
|
positioning: {
|
|
39
|
-
target:
|
|
40
|
+
target: target,
|
|
40
41
|
autoSize: 'always',
|
|
41
42
|
offset: 20,
|
|
42
43
|
coverTarget: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CommonComponents/ChartPopover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { mergeClasses } from '@griffel/react';\nimport type { PositioningVirtualElement } from '@fluentui/react-positioning';\nimport { tokens } from '@fluentui/react-theme';\nimport { useId } from '@fluentui/react-utilities';\nimport { getAccessibleDataObject, Points, pointTypes } from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { Shape } from '../Legends/shape';\nimport { usePopoverStyles_unstable } from './useChartPopoverStyles.styles';\nimport { YValueHover } from './CartesianChart.types';\nimport { LegendShape } from '../Legends/Legends.types';\nimport { ChartPopoverProps } from './ChartPopover.types';\n\n/* This component is a wrapper over Popover component which implements the logic for rendering popovers for any chart\ncombining the logic for Callout and ChartHoverCard in v8 charts. */\nexport const ChartPopover: React.FunctionComponent<ChartPopoverProps> = React.forwardRef<\n HTMLDivElement,\n ChartPopoverProps\n>((props, forwardedRef) => {\n const virtualElement: PositioningVirtualElement = {\n getBoundingClientRect: () => ({\n top: props.clickPosition!.y,\n left: props.clickPosition!.x,\n right: props.clickPosition!.x,\n bottom: props.clickPosition!.y,\n x: props.clickPosition!.x,\n y: props.clickPosition!.y,\n width: 0,\n height: 0,\n }),\n };\n props = { ...props, ...props.customCallout?.customCalloutProps };\n const classes = usePopoverStyles_unstable(props);\n const legend = props.xCalloutValue ? props.xCalloutValue : props.legend;\n const YValue = props.yCalloutValue ? props.yCalloutValue : props.YValue;\n return (\n <div id={useId('callout')} ref={forwardedRef} className={classes.calloutContainer}>\n <Popover\n positioning={{ target: virtualElement, autoSize: 'always', offset: 20, coverTarget: false }}\n open={props.isPopoverOpen}\n inline\n >\n <PopoverSurface>\n {/** Given custom callout, then it will render */}\n {props.customCallout && props.customCallout.customizedCallout && props.customCallout.customizedCallout}\n {/** single x point its corresponding y points of all the bars/lines in chart will render in callout */}\n {(!props.customCallout || !props.customCallout.customizedCallout) &&\n props.isCalloutForStack &&\n _multiValueCallout()}\n {/** single x point its corresponding y point of single line/bar in the chart will render in callout */}\n {(!props.customCallout || !props.customCallout.customizedCallout) && !props.isCalloutForStack && (\n <div className={classes.calloutContentRoot}>\n <div className={classes.calloutDateTimeContainer}>\n <div className={classes.calloutContentX}>{props.XValue} </div>\n {/*TO DO if we add time for callout then will use this */}\n {/* <div className={classNames.calloutContentX}>07:00am</div> */}\n </div>\n <div\n className={classes.calloutInfoContainer}\n style={{\n ...(props.ratio && {\n display: 'flex',\n alignItems: 'flex-end',\n }),\n borderInlineStart: `4px solid ${props.color}`,\n marginTop: '11px',\n }}\n >\n <div className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}>\n {formatToLocaleString(legend, props.culture) as React.ReactNode}\n </div>\n <div\n className={classes.calloutContentY}\n style={{\n color: props.color ? props.color : tokens.colorNeutralForeground1,\n fontSize: tokens.fontSizeHero700,\n }}\n >\n {formatToLocaleString(YValue, props.culture) as React.ReactNode}\n </div>\n </div>\n {!!props.ratio && (\n <div className={classes.ratio}>\n <>\n <span className={classes.numerator}>\n {formatToLocaleString(props.ratio[0], props.culture) as React.ReactNode}\n </span>\n /\n <span className={classes.denominator}>\n {formatToLocaleString(props.ratio[1], props.culture) as React.ReactNode}\n </span>\n </>\n </div>\n )}\n </div>\n {!!props.descriptionMessage && (\n <div className={classes.descriptionMessage}>{props.descriptionMessage}</div>\n )}\n </div>\n )}\n </PopoverSurface>\n </Popover>\n </div>\n );\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _multiValueCallout() {\n const yValueHoverSubCountsExists: boolean = _yValueHoverSubCountsExists(props.YValueHover) ?? false;\n return (\n <div className={classes.calloutContentRoot}>\n <div\n className={classes.calloutDateTimeContainer}\n style={yValueHoverSubCountsExists ? { marginBottom: '11px' } : {}}\n >\n <div\n className={classes.calloutContentX}\n {...getAccessibleDataObject(props!.xAxisCalloutAccessibilityData, 'text', false)}\n >\n {formatToLocaleString(props!.hoverXValue, props.culture) as React.ReactNode}\n </div>\n </div>\n <div style={yValueHoverSubCountsExists ? { display: 'flex' } : {}}>\n {props!.YValueHover &&\n props!.YValueHover.map((yValue: YValueHover, index: number, yValues: YValueHover[]) => {\n const isLast: boolean = index + 1 === yValues.length;\n const shouldDrawBorderBottom = isLast ? false : yValue.shouldDrawBorderBottom ?? false;\n return (\n <div\n {...getAccessibleDataObject(yValue.callOutAccessibilityData, 'text', false)}\n key={`callout-content-${index}`}\n style={\n yValueHoverSubCountsExists\n ? {\n display: 'inline-block',\n ...(shouldDrawBorderBottom && {\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\n paddingBottom: '10px',\n }),\n }\n : {\n ...(shouldDrawBorderBottom && {\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\n paddingBottom: '10px',\n }),\n }\n }\n >\n {_getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}\n </div>\n );\n })}\n {!!props.descriptionMessage && <div className={classes.descriptionMessage}>{props.descriptionMessage}</div>}\n </div>\n </div>\n );\n }\n\n function _yValueHoverSubCountsExists(yValueHover?: YValueHover[]): boolean | undefined {\n return (\n yValueHover &&\n yValueHover.some(\n (yValue: {\n legend?: string;\n y?: number;\n color?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n }) => yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string',\n )\n );\n }\n\n function _getCalloutContent(\n xValue: YValueHover,\n index: number,\n yValueHoverSubCountsExists: boolean,\n isLast: boolean,\n ): React.ReactNode {\n const marginStyle: React.CSSProperties = isLast ? {} : { marginRight: '16px' };\n const toDrawShape = xValue.index !== undefined && xValue.index !== -1;\n const { culture } = props;\n const yValue = formatToLocaleString(xValue.y, culture) as React.ReactNode;\n if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {\n return (\n <div style={yValueHoverSubCountsExists ? marginStyle : {}}>\n {yValueHoverSubCountsExists && (\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n )}\n <div\n id={`${index}_${xValue.y}`}\n className={classes.calloutBlockContainer}\n style={{\n ...(!toDrawShape\n ? {\n borderInlineStart: `4px solid ${xValue.color}`,\n }\n : {}),\n }}\n >\n {toDrawShape && (\n <Shape\n svgProps={{\n className: classes.shapeStyles,\n }}\n pathProps={{ fill: xValue.color }}\n shape={Points[xValue.index! % Object.keys(pointTypes).length] as LegendShape}\n />\n )}\n <div\n className={mergeClasses(\n classes.calloutBlockContainer,\n toDrawShape\n ? classes.calloutBlockContainertoDrawShapetrue\n : classes.calloutBlockContainertoDrawShapefalse,\n )}\n style={{ marginTop: xValue ? '13px' : 'unset' }}\n >\n <div className={classes.calloutlegendText}> {xValue.legend}</div>\n <div className={classes.calloutContentY} style={{ direction: 'ltr', unicodeBidi: 'isolate' }}>\n {\n formatToLocaleString(\n xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y ?? xValue.data,\n culture,\n ) as React.ReactNode\n }\n </div>\n </div>\n </div>\n </div>\n );\n } else {\n const subcounts: { [id: string]: number } = xValue.yAxisCalloutData as { [id: string]: number };\n return (\n <div style={marginStyle}>\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n {Object.keys(subcounts).map((subcountName: string) => {\n return (\n <div key={subcountName} className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}>\n {' '}\n {formatToLocaleString(subcountName, culture) as React.ReactNode}\n </div>\n <div\n className={classes.calloutContentY}\n style={{ color: props.color ? props.color : tokens.colorNeutralForeground1 }}\n >\n {formatToLocaleString(subcounts[subcountName], culture) as React.ReactNode}\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n }\n});\nChartPopover.displayName = 'ChartPopover';\n"],"names":["React","Popover","PopoverSurface","mergeClasses","tokens","useId","getAccessibleDataObject","Points","pointTypes","formatToLocaleString","Shape","usePopoverStyles_unstable","ChartPopover","forwardRef","props","forwardedRef","virtualElement","getBoundingClientRect","top","clickPosition","y","left","x","right","bottom","width","height","customCallout","customCalloutProps","classes","legend","xCalloutValue","YValue","yCalloutValue","div","id","ref","className","calloutContainer","positioning","target","autoSize","offset","coverTarget","open","isPopoverOpen","inline","customizedCallout","isCalloutForStack","_multiValueCallout","calloutContentRoot","calloutDateTimeContainer","calloutContentX","XValue","calloutInfoContainer","style","ratio","display","alignItems","borderInlineStart","color","marginTop","calloutBlockContainer","calloutlegendText","culture","calloutContentY","colorNeutralForeground1","fontSize","fontSizeHero700","span","numerator","denominator","descriptionMessage","_yValueHoverSubCountsExists","yValueHoverSubCountsExists","YValueHover","marginBottom","xAxisCalloutAccessibilityData","hoverXValue","map","yValue","index","yValues","isLast","length","shouldDrawBorderBottom","callOutAccessibilityData","key","borderBottom","colorNeutralStroke2","paddingBottom","_getCalloutContent","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","svgProps","shapeStyles","pathProps","fill","shape","Object","keys","calloutBlockContainertoDrawShapetrue","calloutBlockContainertoDrawShapefalse","direction","unicodeBidi","data","subcounts","subcountName","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAO,EAAEC,cAAc,QAAQ,0BAA0B;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,KAAK,QAAQ,4BAA4B;AAClD,SAASC,uBAAuB,EAAEC,MAAM,EAAEC,UAAU,QAAQ,wBAAwB;AACpF,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,yBAAyB,QAAQ,iCAAiC;AAK3E;iEACiE,GACjE,OAAO,MAAMC,6BAA2DZ,MAAMa,UAAU,CAGtF,CAACC,OAAOC;QAaeD;IAZvB,MAAME,iBAA4C;QAChDC,uBAAuB,IAAO,CAAA;gBAC5BC,KAAKJ,MAAMK,aAAa,CAAEC,CAAC;gBAC3BC,MAAMP,MAAMK,aAAa,CAAEG,CAAC;gBAC5BC,OAAOT,MAAMK,aAAa,CAAEG,CAAC;gBAC7BE,QAAQV,MAAMK,aAAa,CAAEC,CAAC;gBAC9BE,GAAGR,MAAMK,aAAa,CAAEG,CAAC;gBACzBF,GAAGN,MAAMK,aAAa,C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OC,aAAa;gBAAU;eAEvFrG,qBACEsF,OAAOD,gBAAgB,GAAGC,OAAOD,gBAAgB,GAAGC,CAAAA,YAAAA,OAAO3E,CAAC,cAAR2E,uBAAAA,YAAYA,OAAOgB,IAAI,EAC3E/C;QAQhB,OAAO;YACL,MAAMgD,YAAsCjB,OAAOD,gBAAgB;YACnE,qBACE,oBAAC5D;gBAAIqB,OAAOyC;6BACV,oBAAC9D;gBAAIG,WAAU;gBAAyBkB,OAAO;oBAAEY,UAAU;gBAAO;eAC/D4B,OAAOjE,MAAM,EAAE,MAAGkD,QAAO,MAE3ByB,OAAOC,IAAI,CAACM,WAAWjC,GAAG,CAAC,CAACkC;gBAC3B,qBACE,oBAAC/E;oBAAIqD,KAAK0B;oBAAc5E,WAAWR,QAAQiC,qBAAqB;iCAC9D,oBAAC5B;oBAAIG,WAAWR,QAAQkC,iBAAiB;mBACtC,KACAtD,qBAAqBwG,cAAcjD,yBAEtC,oBAAC9B;oBACCG,WAAWR,QAAQoC,eAAe;oBAClCV,OAAO;wBAAEK,OAAO9C,MAAM8C,KAAK,GAAG9C,MAAM8C,KAAK,GAAGxD,OAAO8D,uBAAuB;oBAAC;mBAE1EzD,qBAAqBuG,SAAS,CAACC,aAAa,EAAEjD;YAIvD;QAGN;IACF;AACF,GAAG;AACHpD,aAAasG,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CommonComponents/ChartPopover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { mergeClasses } from '@griffel/react';\nimport type { PositioningVirtualElement } from '@fluentui/react-positioning';\nimport { tokens } from '@fluentui/react-theme';\nimport { useId } from '@fluentui/react-utilities';\nimport { getAccessibleDataObject, Points, pointTypes } from '../../utilities/index';\nimport { formatToLocaleString } from '@fluentui/chart-utilities';\nimport { Shape } from '../Legends/shape';\nimport { usePopoverStyles_unstable } from './useChartPopoverStyles.styles';\nimport { YValueHover } from './CartesianChart.types';\nimport { LegendShape } from '../Legends/Legends.types';\nimport { ChartPopoverProps } from './ChartPopover.types';\n\n/* This component is a wrapper over Popover component which implements the logic for rendering popovers for any chart\ncombining the logic for Callout and ChartHoverCard in v8 charts. */\nexport const ChartPopover: React.FunctionComponent<ChartPopoverProps> = React.forwardRef<\n HTMLDivElement,\n ChartPopoverProps\n>((props, forwardedRef) => {\n const virtualElement: PositioningVirtualElement = {\n getBoundingClientRect: () => ({\n top: props.clickPosition!.y,\n left: props.clickPosition!.x,\n right: props.clickPosition!.x,\n bottom: props.clickPosition!.y,\n x: props.clickPosition!.x,\n y: props.clickPosition!.y,\n width: 0,\n height: 0,\n }),\n };\n const target =\n typeof props.positioning === 'object' && 'target' in props.positioning\n ? props.positioning.target !== null\n ? props.positioning.target\n : virtualElement\n : virtualElement;\n props = { ...props, ...props.customCallout?.customCalloutProps };\n const classes = usePopoverStyles_unstable(props);\n const legend = props.xCalloutValue ? props.xCalloutValue : props.legend;\n const YValue = props.yCalloutValue ? props.yCalloutValue : props.YValue;\n return (\n <div id={useId('callout')} ref={forwardedRef} className={classes.calloutContainer}>\n <Popover\n positioning={{ target: target, autoSize: 'always', offset: 20, coverTarget: false }}\n open={props.isPopoverOpen}\n inline\n >\n <PopoverSurface>\n {/** Given custom callout, then it will render */}\n {props.customCallout && props.customCallout.customizedCallout && props.customCallout.customizedCallout}\n {/** single x point its corresponding y points of all the bars/lines in chart will render in callout */}\n {(!props.customCallout || !props.customCallout.customizedCallout) &&\n props.isCalloutForStack &&\n _multiValueCallout()}\n {/** single x point its corresponding y point of single line/bar in the chart will render in callout */}\n {(!props.customCallout || !props.customCallout.customizedCallout) && !props.isCalloutForStack && (\n <div className={classes.calloutContentRoot}>\n <div className={classes.calloutDateTimeContainer}>\n <div className={classes.calloutContentX}>{props.XValue} </div>\n {/*TO DO if we add time for callout then will use this */}\n {/* <div className={classNames.calloutContentX}>07:00am</div> */}\n </div>\n <div\n className={classes.calloutInfoContainer}\n style={{\n ...(props.ratio && {\n display: 'flex',\n alignItems: 'flex-end',\n }),\n borderInlineStart: `4px solid ${props.color}`,\n marginTop: '11px',\n }}\n >\n <div className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}>\n {formatToLocaleString(legend, props.culture) as React.ReactNode}\n </div>\n <div\n className={classes.calloutContentY}\n style={{\n color: props.color ? props.color : tokens.colorNeutralForeground1,\n fontSize: tokens.fontSizeHero700,\n }}\n >\n {formatToLocaleString(YValue, props.culture) as React.ReactNode}\n </div>\n </div>\n {!!props.ratio && (\n <div className={classes.ratio}>\n <>\n <span className={classes.numerator}>\n {formatToLocaleString(props.ratio[0], props.culture) as React.ReactNode}\n </span>\n /\n <span className={classes.denominator}>\n {formatToLocaleString(props.ratio[1], props.culture) as React.ReactNode}\n </span>\n </>\n </div>\n )}\n </div>\n {!!props.descriptionMessage && (\n <div className={classes.descriptionMessage}>{props.descriptionMessage}</div>\n )}\n </div>\n )}\n </PopoverSurface>\n </Popover>\n </div>\n );\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _multiValueCallout() {\n const yValueHoverSubCountsExists: boolean = _yValueHoverSubCountsExists(props.YValueHover) ?? false;\n return (\n <div className={classes.calloutContentRoot}>\n <div\n className={classes.calloutDateTimeContainer}\n style={yValueHoverSubCountsExists ? { marginBottom: '11px' } : {}}\n >\n <div\n className={classes.calloutContentX}\n {...getAccessibleDataObject(props!.xAxisCalloutAccessibilityData, 'text', false)}\n >\n {formatToLocaleString(props!.hoverXValue, props.culture) as React.ReactNode}\n </div>\n </div>\n <div style={yValueHoverSubCountsExists ? { display: 'flex' } : {}}>\n {props!.YValueHover &&\n props!.YValueHover.map((yValue: YValueHover, index: number, yValues: YValueHover[]) => {\n const isLast: boolean = index + 1 === yValues.length;\n const shouldDrawBorderBottom = isLast ? false : yValue.shouldDrawBorderBottom ?? false;\n return (\n <div\n {...getAccessibleDataObject(yValue.callOutAccessibilityData, 'text', false)}\n key={`callout-content-${index}`}\n style={\n yValueHoverSubCountsExists\n ? {\n display: 'inline-block',\n ...(shouldDrawBorderBottom && {\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\n paddingBottom: '10px',\n }),\n }\n : {\n ...(shouldDrawBorderBottom && {\n borderBottom: `1px solid ${tokens.colorNeutralStroke2}`,\n paddingBottom: '10px',\n }),\n }\n }\n >\n {_getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)}\n </div>\n );\n })}\n {!!props.descriptionMessage && <div className={classes.descriptionMessage}>{props.descriptionMessage}</div>}\n </div>\n </div>\n );\n }\n\n function _yValueHoverSubCountsExists(yValueHover?: YValueHover[]): boolean | undefined {\n return (\n yValueHover &&\n yValueHover.some(\n (yValue: {\n legend?: string;\n y?: number;\n color?: string;\n yAxisCalloutData?: string | { [id: string]: number };\n }) => yValue.yAxisCalloutData && typeof yValue.yAxisCalloutData !== 'string',\n )\n );\n }\n\n function _getCalloutContent(\n xValue: YValueHover,\n index: number,\n yValueHoverSubCountsExists: boolean,\n isLast: boolean,\n ): React.ReactNode {\n const marginStyle: React.CSSProperties = isLast ? {} : { marginRight: '16px' };\n const toDrawShape = xValue.index !== undefined && xValue.index !== -1;\n const { culture } = props;\n const yValue = formatToLocaleString(xValue.y, culture) as React.ReactNode;\n if (!xValue.yAxisCalloutData || typeof xValue.yAxisCalloutData === 'string') {\n return (\n <div style={yValueHoverSubCountsExists ? marginStyle : {}}>\n {yValueHoverSubCountsExists && (\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n )}\n <div\n id={`${index}_${xValue.y}`}\n className={classes.calloutBlockContainer}\n style={{\n ...(!toDrawShape\n ? {\n borderInlineStart: `4px solid ${xValue.color}`,\n }\n : {}),\n }}\n >\n {toDrawShape && (\n <Shape\n svgProps={{\n className: classes.shapeStyles,\n }}\n pathProps={{ fill: xValue.color }}\n shape={Points[xValue.index! % Object.keys(pointTypes).length] as LegendShape}\n />\n )}\n <div\n className={mergeClasses(\n classes.calloutBlockContainer,\n toDrawShape\n ? classes.calloutBlockContainertoDrawShapetrue\n : classes.calloutBlockContainertoDrawShapefalse,\n )}\n style={{ marginTop: xValue ? '13px' : 'unset' }}\n >\n <div className={classes.calloutlegendText}> {xValue.legend}</div>\n <div className={classes.calloutContentY} style={{ direction: 'ltr', unicodeBidi: 'isolate' }}>\n {\n formatToLocaleString(\n xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y ?? xValue.data,\n culture,\n ) as React.ReactNode\n }\n </div>\n </div>\n </div>\n </div>\n );\n } else {\n const subcounts: { [id: string]: number } = xValue.yAxisCalloutData as { [id: string]: number };\n return (\n <div style={marginStyle}>\n <div className=\"ms-fontWeight-semibold\" style={{ fontSize: '12pt' }}>\n {xValue.legend!} ({yValue})\n </div>\n {Object.keys(subcounts).map((subcountName: string) => {\n return (\n <div key={subcountName} className={classes.calloutBlockContainer}>\n <div className={classes.calloutlegendText}>\n {' '}\n {formatToLocaleString(subcountName, culture) as React.ReactNode}\n </div>\n <div\n className={classes.calloutContentY}\n style={{ color: props.color ? props.color : tokens.colorNeutralForeground1 }}\n >\n {formatToLocaleString(subcounts[subcountName], culture) as React.ReactNode}\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n }\n});\nChartPopover.displayName = 'ChartPopover';\n"],"names":["React","Popover","PopoverSurface","mergeClasses","tokens","useId","getAccessibleDataObject","Points","pointTypes","formatToLocaleString","Shape","usePopoverStyles_unstable","ChartPopover","forwardRef","props","forwardedRef","virtualElement","getBoundingClientRect","top","clickPosition","y","left","x","right","bottom","width","height","target","positioning","customCallout","customCalloutProps","classes","legend","xCalloutValue","YValue","yCalloutValue","div","id","ref","className","calloutContainer","autoSize","offset","coverTarget","open","isPopoverOpen","inline","customizedCallout","isCalloutForStack","_multiValueCallout","calloutContentRoot","calloutDateTimeContainer","calloutContentX","XValue","calloutInfoContainer","style","ratio","display","alignItems","borderInlineStart","color","marginTop","calloutBlockContainer","calloutlegendText","culture","calloutContentY","colorNeutralForeground1","fontSize","fontSizeHero700","span","numerator","denominator","descriptionMessage","_yValueHoverSubCountsExists","yValueHoverSubCountsExists","YValueHover","marginBottom","xAxisCalloutAccessibilityData","hoverXValue","map","yValue","index","yValues","isLast","length","shouldDrawBorderBottom","callOutAccessibilityData","key","borderBottom","colorNeutralStroke2","paddingBottom","_getCalloutContent","yValueHover","some","yAxisCalloutData","xValue","marginStyle","marginRight","toDrawShape","undefined","svgProps","shapeStyles","pathProps","fill","shape","Object","keys","calloutBlockContainertoDrawShapetrue","calloutBlockContainertoDrawShapefalse","direction","unicodeBidi","data","subcounts","subcountName","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,OAAO,EAAEC,cAAc,QAAQ,0BAA0B;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,KAAK,QAAQ,4BAA4B;AAClD,SAASC,uBAAuB,EAAEC,MAAM,EAAEC,UAAU,QAAQ,wBAAwB;AACpF,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,yBAAyB,QAAQ,iCAAiC;AAK3E;iEACiE,GACjE,OAAO,MAAMC,6BAA2DZ,MAAMa,UAAU,CAGtF,CAACC,OAAOC;QAmBeD;IAlBvB,MAAME,iBAA4C;QAChDC,uBAAuB,IAAO,CAAA;gBAC5BC,KAAKJ,MAAMK,aAAa,CAAEC,CAAC;gBAC3BC,MAAMP,MAAMK,aAAa,CAAEG,CAAC;gBAC5BC,OAAOT,MAAMK,aAAa,CAAEG,CAAC;gBAC7BE,QAAQV,MAAMK,aAAa,CAAEC,CAAC;gBAC9BE,GAAGR,MAAMK,aAAa,CAAEG,CAAC;gBACzBF,GAAGN,MAAMK,aAAa,CAAEC,CAAC;gBACzBK,OAAO;gBACPC,QAAQ;YACV,CAAA;IACF;IACA,MAAMC,SACJ,OAAOb,MAAMc,WAAW,KAAK,YAA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Ae;gBAAEV,OAAO;oBAAEsD,WAAW;oBAAOC,aAAa;gBAAU;eAEvFrG,qBACEsF,OAAOD,gBAAgB,GAAGC,OAAOD,gBAAgB,GAAGC,CAAAA,YAAAA,OAAO3E,CAAC,cAAR2E,uBAAAA,YAAYA,OAAOgB,IAAI,EAC3E/C;QAQhB,OAAO;YACL,MAAMgD,YAAsCjB,OAAOD,gBAAgB;YACnE,qBACE,oBAAC1D;gBAAImB,OAAOyC;6BACV,oBAAC5D;gBAAIG,WAAU;gBAAyBgB,OAAO;oBAAEY,UAAU;gBAAO;eAC/D4B,OAAO/D,MAAM,EAAE,MAAGgD,QAAO,MAE3ByB,OAAOC,IAAI,CAACM,WAAWjC,GAAG,CAAC,CAACkC;gBAC3B,qBACE,oBAAC7E;oBAAImD,KAAK0B;oBAAc1E,WAAWR,QAAQ+B,qBAAqB;iCAC9D,oBAAC1B;oBAAIG,WAAWR,QAAQgC,iBAAiB;mBACtC,KACAtD,qBAAqBwG,cAAcjD,yBAEtC,oBAAC5B;oBACCG,WAAWR,QAAQkC,eAAe;oBAClCV,OAAO;wBAAEK,OAAO9C,MAAM8C,KAAK,GAAG9C,MAAM8C,KAAK,GAAGxD,OAAO8D,uBAAuB;oBAAC;mBAE1EzD,qBAAqBuG,SAAS,CAACC,aAAa,EAAEjD;YAIvD;QAGN;IACF;AACF,GAAG;AACHpD,aAAasG,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CommonComponents/ChartPopover.types.ts"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport { YValueHover } from '../../index';\n\nexport interface ChartPopoverProps {\n clickPosition?: { x: number; y: number };\n isPopoverOpen?: boolean;\n xCalloutValue?: string;\n legend?: string | number | Date;\n yCalloutValue?: string;\n YValue?: string | number | Date;\n XValue?: string;\n color?: string;\n culture?: string;\n customCallout?: {\n customizedCallout?: JSXElement;\n customCalloutProps?: ChartPopoverProps;\n };\n isCalloutForStack?: boolean;\n xAxisCalloutAccessibilityData?: { ariaLabel?: string; data?: string };\n hoverXValue?: string | number;\n YValueHover?: YValueHover[];\n descriptionMessage?: string;\n ratio?: [number, number];\n isCartesian?: boolean;\n styles?: Partial<PopoverComponentStyles>;\n}\n\nexport interface PopoverComponentStyles {\n calloutContentRoot: string;\n calloutDateTimeContainer: string;\n calloutContentX: string;\n calloutBlockContainer: string;\n calloutBlockContainertoDrawShapefalse: string;\n calloutBlockContainertoDrawShapetrue: string;\n shapeStyles: string;\n calloutlegendText: string;\n calloutContentY: string;\n descriptionMessage: string;\n ratio: string;\n numerator: string;\n denominator: string;\n calloutInfoContainer: string;\n calloutContainer: string;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/CommonComponents/ChartPopover.types.ts"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport { YValueHover } from '../../index';\nimport { PositioningShorthand } from '@fluentui/react-positioning';\n\nexport interface ChartPopoverProps {\n clickPosition?: { x: number; y: number };\n isPopoverOpen?: boolean;\n xCalloutValue?: string;\n legend?: string | number | Date;\n yCalloutValue?: string;\n YValue?: string | number | Date;\n XValue?: string;\n color?: string;\n culture?: string;\n customCallout?: {\n customizedCallout?: JSXElement;\n customCalloutProps?: ChartPopoverProps;\n };\n isCalloutForStack?: boolean;\n xAxisCalloutAccessibilityData?: { ariaLabel?: string; data?: string };\n hoverXValue?: string | number;\n YValueHover?: YValueHover[];\n descriptionMessage?: string;\n ratio?: [number, number];\n isCartesian?: boolean;\n styles?: Partial<PopoverComponentStyles>;\n positioning?: PositioningShorthand;\n}\n\nexport interface PopoverComponentStyles {\n calloutContentRoot: string;\n calloutDateTimeContainer: string;\n calloutContentX: string;\n calloutBlockContainer: string;\n calloutBlockContainertoDrawShapefalse: string;\n calloutBlockContainertoDrawShapetrue: string;\n shapeStyles: string;\n calloutlegendText: string;\n calloutContentY: string;\n descriptionMessage: string;\n ratio: string;\n numerator: string;\n denominator: string;\n calloutInfoContainer: string;\n calloutContainer: string;\n}\n"],"names":[],"mappings":"AA6BA,WAgBC"}
|
|
@@ -730,10 +730,11 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
730
730
|
const legendShape = getLegendShape(series);
|
|
731
731
|
const validXYRanges = getValidXYRanges(series);
|
|
732
732
|
return validXYRanges.map(([rangeStart, rangeEnd], rangeIdx)=>{
|
|
733
|
-
var _series_marker, _input_layout, _input_layout_polar_angularaxis, _input_layout_polar, _input_layout1, _input_layout_polar_angularaxis1, _input_layout_polar1, _input_layout2;
|
|
733
|
+
var _series_marker, _series_marker1, _series_marker2, _input_layout, _input_layout_polar_angularaxis, _input_layout_polar, _input_layout1, _input_layout_polar_angularaxis1, _input_layout_polar1, _input_layout2;
|
|
734
734
|
const rangeXValues = xValues.slice(rangeStart, rangeEnd);
|
|
735
735
|
const rangeYValues = series.y.slice(rangeStart, rangeEnd);
|
|
736
736
|
const markerSizes = isArrayOrTypedArray((_series_marker = series.marker) === null || _series_marker === void 0 ? void 0 : _series_marker.size) ? series.marker.size.slice(rangeStart, rangeEnd) : [];
|
|
737
|
+
const markerColors = isArrayOrTypedArray((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.color) ? series.marker.color.slice(rangeStart, rangeEnd) : Array.isArray((_series_marker2 = series.marker) === null || _series_marker2 === void 0 ? void 0 : _series_marker2.color) ? series.marker.color.slice(rangeStart, rangeEnd) : undefined;
|
|
737
738
|
const textValues = Array.isArray(series.text) ? series.text.slice(rangeStart, rangeEnd) : undefined;
|
|
738
739
|
var _rgb_copy_formatHex8;
|
|
739
740
|
return {
|
|
@@ -749,6 +750,9 @@ const transformPlotlyJsonToScatterTraceProps = (input, isMultiPlot, chartType, c
|
|
|
749
750
|
} : typeof ((_series_marker1 = series.marker) === null || _series_marker1 === void 0 ? void 0 : _series_marker1.size) === 'number' ? {
|
|
750
751
|
markerSize: series.marker.size
|
|
751
752
|
} : {},
|
|
753
|
+
...markerColors ? {
|
|
754
|
+
markerColor: markerColors[i]
|
|
755
|
+
} : {},
|
|
752
756
|
...textValues ? {
|
|
753
757
|
text: textValues[i]
|
|
754
758
|
} : {},
|