Skip to content
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

feat(react-charts): Migrate Gauge chart to V9 #33998

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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,7 @@
{
"type": "patch",
"comment": "feat(react-charts): Migrate Gauge chart to V9",
"packageName": "@fluentui/react-charts-preview",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export interface AccessibilityProps {
ariaLabelledBy?: string;
}

// @public (undocumented)
export const ARC_PADDING = 2;

// @public (undocumented)
export interface Basestate {
// (undocumented)
Expand Down Expand Up @@ -63,6 +66,16 @@ export interface Basestate {
}[];
}

// @public (undocumented)
export const BREAKPOINTS: {
minRadius: number;
arcWidth: number;
fontSize: number;
}[];

// @public (undocumented)
export const calcNeedleRotation: (chartValue: number, minValue: number, maxValue: number) => number;

// @public (undocumented)
export const CartesianChart: React_2.FunctionComponent<ModifiedCartesianChartProps>;

Expand Down Expand Up @@ -400,12 +413,102 @@ export interface EventsAnnotationProps {
strokeColor?: string;
}

// @public (undocumented)
export interface ExtendedSegment extends GaugeChartSegment {
// (undocumented)
end: number;
// (undocumented)
start: number;
}

// @public (undocumented)
export const GaugeChart: React_2.FunctionComponent<GaugeChartProps>;

// @public
export interface GaugeChartProps {
calloutProps?: Partial<ChartPopoverProps>;
chartTitle?: string;
chartValue: number;
chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string);
className?: string;
culture?: string;
enableGradient?: boolean;
height?: number;
hideLegend?: boolean;
hideMinMax?: boolean;
hideTooltip?: boolean;
// (undocumented)
legendProps?: Partial<LegendsProps>;
maxValue?: number;
minValue?: number;
roundCorners?: boolean;
segments: GaugeChartSegment[];
styles?: GaugeChartStyles;
sublabel?: string;
variant?: GaugeChartVariant;
width?: number;
}

// @public
export interface GaugeChartSegment {
accessibilityData?: AccessibilityProps;
color?: string;
gradient?: [string, string];
legend: string;
size: number;
}

// @public
export interface GaugeChartStyles {
calloutBlockContainer?: string;
calloutContentRoot?: string;
calloutContentX?: string;
calloutContentY?: string;
calloutDateTimeContainer?: string;
calloutInfoContainer?: string;
calloutlegendText?: string;
chart?: string;
chartTitle?: string;
chartValue?: string;
descriptionMessage?: string;
gradientSegment?: string;
legendsContainer?: string;
limits?: string;
needle?: string;
root?: string;
segment?: string;
shapeStyles?: string;
sublabel?: string;
}

// @public (undocumented)
export enum GaugeChartVariant {
// (undocumented)
MultipleSegments = "multiple-segments",
// (undocumented)
SingleSegment = "single-segment"
}

// @public (undocumented)
export enum GaugeValueFormat {
// (undocumented)
Fraction = "fraction",
// (undocumented)
Percentage = "percentage"
}

// @public (undocumented)
export const getChartValueLabel: (chartValue: number, minValue: number, maxValue: number, chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string) | undefined, forCallout?: boolean) => string;

// @public (undocumented)
export const getColorFromToken: (token: string, isDarkTheme?: boolean) => string;

// @public (undocumented)
export const getNextColor: (index: number, offset?: number, isDarkTheme?: boolean) => string;

// @public (undocumented)
export const getSegmentLabel: (segment: ExtendedSegment, minValue: number, maxValue: number, variant?: GaugeChartVariant, isAriaLabel?: boolean) => string;

// @public (undocumented)
export interface GroupedVerticalBarChartData {
name: string;
Expand Down Expand Up @@ -545,6 +648,8 @@ export interface LegendsProps {
onChange?: (selectedLegends: string[], event: React_2.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;
overflowStyles?: React_2.CSSProperties;
overflowText?: string;
selectedLegend?: string;
selectedLegends?: string[];
shape?: LegendShape;
styles?: LegendsStyles;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components/GaugeChart/index';
Loading