Skip to content

feat(react-charts): Migrate VSBC to V9 #33909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ef9b968
migrate VSBC to V9
Anush2303 Feb 26, 2025
f25d2cc
fix build errors
Anush2303 Feb 27, 2025
4f995a0
Add change file
Anush2303 Feb 27, 2025
bcb624c
Add chart popover
Anush2303 Feb 27, 2025
744b914
change in condition
Anush2303 Feb 27, 2025
72e3c94
Add tabster
Anush2303 Feb 28, 2025
563bc9e
remove unused code
Anush2303 Feb 28, 2025
80b0b1a
resolve comments
Anush2303 Mar 1, 2025
c03487f
bug fix: segments not greying out
Anush2303 Mar 1, 2025
190892d
popover not closing fix
Anush2303 Mar 1, 2025
9ca970f
resolve comments
Anush2303 Mar 11, 2025
3dc3740
resolve comments
Anush2303 Mar 11, 2025
07f55fd
fix popover bug
Anush2303 Mar 11, 2025
85f8cfc
revert change
Anush2303 Mar 11, 2025
b9c4194
fix build errors
Anush2303 Mar 11, 2025
bfde893
Merge branch 'master' into usr/agupta/v9/VSBC
Anush2303 Mar 12, 2025
f54c9b5
Merge branch 'master' of https://github.com/microsoft/fluentui into u…
Anush2303 Mar 26, 2025
2ac8a60
Merge branch 'usr/agupta/v9/VSBC' of https://github.com/microsoft/flu…
Anush2303 Mar 26, 2025
04dc955
add missed utility
Anush2303 Mar 26, 2025
a801cc8
solve build error
Anush2303 Mar 26, 2025
0a42996
Regenerate change file
Anush2303 Mar 26, 2025
e2d0142
fix build error
Anush2303 Mar 26, 2025
76eeda4
resolve comments
Anush2303 Mar 27, 2025
73fd1f6
resolve comments
Anush2303 Mar 31, 2025
6a5125a
Add description and Best practices
Anush2303 Mar 31, 2025
ba0156e
Add VSBC AxisTooltip example
Anush2303 Mar 31, 2025
ccb8bbf
Add Callout example
Anush2303 Apr 1, 2025
0748b32
fix build error
Anush2303 Apr 1, 2025
6ed8226
Add examples for VSBC
Anush2303 Apr 1, 2025
6262b51
Merge branch 'master' into usr/agupta/v9/VSBC
Anush2303 Apr 1, 2025
b5092a2
Merge branch 'master' of https://github.com/microsoft/fluentui into u…
Anush2303 Apr 1, 2025
62cdd4f
Merge branch 'usr/agupta/v9/VSBC' of https://github.com/microsoft/flu…
Anush2303 Apr 1, 2025
26f1289
fix build error
Anush2303 Apr 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components/VerticalStackedBarChart/index';
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import * as React from 'react';
import { LegendsProps } from '../Legends/index';
import { AccessibilityProps, Margins } from '../../types/index';
import { ChartTypes, XAxisTypes, YAxisType } from '../../utilities/index';
import {
AccessibilityProps,
Margins,
HorizontalBarChartWithAxisDataPoint,
LineChartPoints,
VerticalBarChartDataPoint,
DataPoint,
VerticalStackedBarDataPoint,
GroupedVerticalBarChartData,
} from '../../types/index';
import { ChartTypes, XAxisTypes, YAxisType, IYAxisParams, IAxisData, IDomainNRange } from '../../utilities/index';
import { TimeLocaleDefinition } from 'd3-time-format';
import { ChartPopoverProps } from './ChartPopover.types';
import { ScaleBand, ScaleLinear } from 'd3-scale';
/**
* Cartesian Chart style properties
* {@docCategory CartesianChart}
Expand Down Expand Up @@ -546,11 +556,22 @@ export interface ModifiedCartesianChartProps extends CartesianChartProps {
*/
children(props: ChildProps): React.ReactNode;

/**
* To enable callout for individualbar or complete stack. Using for only Vertical stacked bar chart.
* @default false
* @type \{boolean \}
*/
isCalloutForStack?: boolean;

/** dataset values to find out domain of the String axis
* Present using for only vertical stacked bar chart and grouped vertical bar chart
*/
datasetForXAxisDomain?: string[];

/** Own callout design */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
customizedCallout?: any;

/**
* if the data points for the y-axis is of type string, then we need to give this
* prop to construct the y-axis
Expand Down Expand Up @@ -595,4 +616,57 @@ export interface ModifiedCartesianChartProps extends CartesianChartProps {
* Used to control the first render cycle Performance optimization code.
*/
enableFirstRenderOptimization?: boolean;

/**
* Get the min and max values of the y-axis
*/
getMinMaxOfYAxis: (
points: LineChartPoints[] | HorizontalBarChartWithAxisDataPoint[] | VerticalBarChartDataPoint[] | DataPoint[],
yAxisType: YAxisType | undefined,
) => { startValue: number; endValue: number };

/**
* Create the y-axis
*/
createYAxis: (
yAxisParams: IYAxisParams,
isRtl: boolean,
axisData: IAxisData,
isIntegralDataset: boolean,
useSecondaryYScale?: boolean,
supportNegativeData?: boolean,
roundedTicks?: boolean,
) => ScaleLinear<number, number, never>;

/**
* Get the domain and range values
*/
getDomainNRangeValues: (
points:
| LineChartPoints[]
| VerticalBarChartDataPoint[]
| VerticalStackedBarDataPoint[]
| HorizontalBarChartWithAxisDataPoint[]
| GroupedVerticalBarChartData[],
margins: Margins,
width: number,
chartType: ChartTypes,
isRTL: boolean,
xAxisType: XAxisTypes,
barWidth: number,
tickValues: Date[] | number[] | string[] | undefined,
shiftX: number,
) => IDomainNRange;

/**
* Create the string y-axis
*/
createStringYAxis: (
yAxisParams: IYAxisParams,
dataPoints: string[],
isRtl: boolean,
chartType: ChartTypes,
barWidth: number | undefined,
culture: string,
) => ScaleBand<string>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,32 @@ export interface LegendsProps {
*/
defaultSelectedLegend?: string;

/**
* Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is
* true. For single-select, use selectedLegend.
*
* When this prop is provided, the component is controlled and does not automatically update the selection based on
* user interactions; the parent component must update the value passed to this property by handling the onChange
* event.
*
* @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.
* @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.
*/
selectedLegends?: string[];

/**
* Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is
* false or unspecified. For multi-select, use selectedLegends.
*
* When this prop is provided, the component is controlled and does not automatically update the selection based on
* user interactions; the parent component must update the value passed to this property by handling the onChange
* event.
*
* @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.
* @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.
*/
selectedLegend?: string;

/**
* The shape for the legend.
*/
Expand Down
Loading
Loading