Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/microsoft/fluentui into u…
Browse files Browse the repository at this point in the history
…sers/srmukher/legendsMultiSelectVBC
  • Loading branch information
srmukher committed Dec 24, 2024
2 parents b7b36ff + e09d638 commit 5c071bc
Show file tree
Hide file tree
Showing 100 changed files with 1,350 additions and 185 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 15 additions & 0 deletions packages/azure-themes/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@fluentui/azure-themes",
"entries": [
{
"date": "Mon, 23 Dec 2024 07:22:58 GMT",
"tag": "@fluentui/azure-themes_v8.6.115",
"version": "8.6.115",
"comments": {
"patch": [
{
"author": "beachball",
"package": "@fluentui/azure-themes",
"comment": "Bump @fluentui/react to v8.122.2",
"commit": "7b4a3785c6c1d7c207602cad0a1795e3df9122ee"
}
]
}
},
{
"date": "Fri, 13 Dec 2024 07:23:12 GMT",
"tag": "@fluentui/azure-themes_v8.6.114",
Expand Down
11 changes: 10 additions & 1 deletion packages/azure-themes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Change Log - @fluentui/azure-themes

This log was last generated on Fri, 13 Dec 2024 07:23:12 GMT and should not be manually modified.
This log was last generated on Mon, 23 Dec 2024 07:22:58 GMT and should not be manually modified.

<!-- Start content -->

## [8.6.115](https://github.com/microsoft/fluentui/tree/@fluentui/azure-themes_v8.6.115)

Mon, 23 Dec 2024 07:22:58 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/azure-themes_v8.6.114..@fluentui/azure-themes_v8.6.115)

### Patches

- Bump @fluentui/react to v8.122.2 ([PR #33445](https://github.com/microsoft/fluentui/pull/33445) by beachball)

## [8.6.114](https://github.com/microsoft/fluentui/tree/@fluentui/azure-themes_v8.6.114)

Fri, 13 Dec 2024 07:23:12 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/azure-themes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentui/azure-themes",
"version": "8.6.114",
"version": "8.6.115",
"description": "Azure themes for Fluent UI React",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand All @@ -27,7 +27,7 @@
"@fluentui/scripts-webpack": "*"
},
"dependencies": {
"@fluentui/react": "^8.122.1",
"@fluentui/react": "^8.122.2",
"@fluentui/set-version": "^8.2.23",
"tslib": "^2.1.0"
}
Expand Down
33 changes: 33 additions & 0 deletions packages/charts/react-charting/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
{
"name": "@fluentui/react-charting",
"entries": [
{
"date": "Mon, 23 Dec 2024 07:22:57 GMT",
"tag": "@fluentui/react-charting_v5.23.29",
"version": "5.23.29",
"comments": {
"patch": [
{
"author": "[email protected]",
"package": "@fluentui/react-charting",
"commit": "7b4a3785c6c1d7c207602cad0a1795e3df9122ee",
"comment": "feat: add functionality to export chart as image"
},
{
"author": "beachball",
"package": "@fluentui/react-charting",
"comment": "Bump @fluentui/react-focus to v8.9.20",
"commit": "7b4a3785c6c1d7c207602cad0a1795e3df9122ee"
},
{
"author": "beachball",
"package": "@fluentui/react-charting",
"comment": "Bump @fluentui/theme-samples to v8.7.191",
"commit": "7b4a3785c6c1d7c207602cad0a1795e3df9122ee"
},
{
"author": "beachball",
"package": "@fluentui/react-charting",
"comment": "Bump @fluentui/react to v8.122.2",
"commit": "7b4a3785c6c1d7c207602cad0a1795e3df9122ee"
}
]
}
},
{
"date": "Fri, 20 Dec 2024 07:20:00 GMT",
"tag": "@fluentui/react-charting_v5.23.28",
Expand Down
14 changes: 13 additions & 1 deletion packages/charts/react-charting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# Change Log - @fluentui/react-charting

This log was last generated on Fri, 20 Dec 2024 07:20:00 GMT and should not be manually modified.
This log was last generated on Mon, 23 Dec 2024 07:22:57 GMT and should not be manually modified.

<!-- Start content -->

## [5.23.29](https://github.com/microsoft/fluentui/tree/@fluentui/react-charting_v5.23.29)

Mon, 23 Dec 2024 07:22:57 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charting_v5.23.28..@fluentui/react-charting_v5.23.29)

### Patches

- feat: add functionality to export chart as image ([PR #33445](https://github.com/microsoft/fluentui/pull/33445) by [email protected])
- Bump @fluentui/react-focus to v8.9.20 ([PR #33445](https://github.com/microsoft/fluentui/pull/33445) by beachball)
- Bump @fluentui/theme-samples to v8.7.191 ([PR #33445](https://github.com/microsoft/fluentui/pull/33445) by beachball)
- Bump @fluentui/react to v8.122.2 ([PR #33445](https://github.com/microsoft/fluentui/pull/33445) by beachball)

## [5.23.28](https://github.com/microsoft/fluentui/tree/@fluentui/react-charting_v5.23.28)

Fri, 20 Dec 2024 07:20:00 GMT
Expand Down
31 changes: 31 additions & 0 deletions packages/charts/react-charting/etc/react-charting.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IFocusZoneProps } from '@fluentui/react-focus';
import { IHoverCardStyleProps } from '@fluentui/react/lib/HoverCard';
import { IHoverCardStyles } from '@fluentui/react/lib/HoverCard';
import { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';
import { IRefObject } from '@fluentui/react/lib/Utilities';
import { IRenderFunction } from '@fluentui/react/lib/Utilities';
import { IStyle } from '@fluentui/react/lib/Styling';
import { IStyle as IStyle_2 } from '@fluentui/react';
Expand Down Expand Up @@ -125,6 +126,7 @@ export const DeclarativeChart: React_2.FunctionComponent<DeclarativeChartProps>;
// @public
export interface DeclarativeChartProps extends React_2.RefAttributes<HTMLDivElement> {
chartSchema: Schema;
componentRef?: IRefObject<IDeclarativeChart>;
onSchemaChange?: (eventData: Schema) => void;
}

Expand Down Expand Up @@ -267,6 +269,7 @@ export interface ICartesianChartProps {
// @deprecated
chartLabel?: string;
className?: string;
componentRef?: IRefObject<IChart>;
customDateTimeFormatter?: (dateTime: Date) => string;
dateLocalizeOptions?: Intl.DateTimeFormatOptions;
enabledLegendsWrapLines?: boolean;
Expand Down Expand Up @@ -352,6 +355,12 @@ export interface ICartesianChartStyles {
yAxis?: IStyle;
}

// @public (undocumented)
export interface IChart {
// (undocumented)
chartContainer: HTMLElement | null;
}

// @public (undocumented)
export interface IChartDataPoint {
callOutAccessibilityData?: IAccessibilityProps;
Expand Down Expand Up @@ -481,13 +490,20 @@ export interface IDataPoint {
y: number;
}

// @public (undocumented)
export interface IDeclarativeChart {
// (undocumented)
exportAsImage: (opts?: IImageExportOptions) => Promise<string>;
}

// @public (undocumented)
export interface IDonutChart {
}

// @public
export interface IDonutChartProps extends ICartesianChartProps {
calloutProps?: Partial<ICalloutProps>;
componentRef?: IRefObject<IChart>;
culture?: string;
data?: IChartProps;
enableGradient?: boolean;
Expand Down Expand Up @@ -536,6 +552,7 @@ export interface IGaugeChartProps {
chartValue: number;
chartValueFormat?: GaugeValueFormat | ((sweepFraction: [number, number]) => string);
className?: string;
componentRef?: IRefObject<IChart>;
culture?: string;
enableGradient?: boolean;
height?: number;
Expand Down Expand Up @@ -832,6 +849,18 @@ export interface IHorizontalDataPoint {
y: number;
}

// @public (undocumented)
export interface IImageExportOptions {
// (undocumented)
background?: string;
// (undocumented)
height?: number;
// (undocumented)
scale?: number;
// (undocumented)
width?: number;
}

// @public
export interface ILegend {
action?: VoidFunction;
Expand Down Expand Up @@ -1068,6 +1097,7 @@ export interface IModifiedCartesianChartProps extends ICartesianChartProps {
maxOfYVal?: number;
onChartMouseLeave?: () => void;
points: any;
ref?: IRefObject<IChart>;
showYAxisLables?: boolean;
showYAxisLablesTooltip?: boolean;
stringDatasetForYAxisDomain?: string[];
Expand Down Expand Up @@ -1200,6 +1230,7 @@ export interface ISankeyChartProps {
borderColorsForNodes?: string[];
className?: string;
colorsForNodes?: string[];
componentRef?: IRefObject<IChart>;
data: IChartProps;
enableReflow?: boolean;
formatNumberOptions?: Intl.NumberFormatOptions;
Expand Down
8 changes: 4 additions & 4 deletions packages/charts/react-charting/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentui/react-charting",
"version": "5.23.28",
"version": "5.23.29",
"description": "React web charting controls for Microsoft fluentui system.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand Down Expand Up @@ -39,8 +39,8 @@
"jest-canvas-mock": "2.4.0"
},
"dependencies": {
"@fluentui/react-focus": "^8.9.19",
"@fluentui/theme-samples": "^8.7.190",
"@fluentui/react-focus": "^8.9.20",
"@fluentui/theme-samples": "^8.7.191",
"@microsoft/load-themed-styles": "^1.10.26",
"@types/d3-array": "^3.0.0",
"@types/d3-axis": "^3.0.0",
Expand All @@ -66,7 +66,7 @@
"tslib": "^2.1.0"
},
"peerDependencies": {
"@fluentui/react": "^8.122.1",
"@fluentui/react": "^8.122.2",
"@types/react": ">=16.8.0 <19.0.0",
"@types/react-dom": ">=16.8.0 <19.0.0",
"react": ">=16.8.0 <19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/react-charting/src/DeclarativeChart.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './components/DeclarativeChart/DeclarativeChart';
export * from './components/DeclarativeChart/index';
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { max as d3Max, bisector } from 'd3-array';
import { pointer } from 'd3-selection';
import { select as d3Select } from 'd3-selection';
import { area as d3Area, stack as d3Stack, curveMonotoneX as d3CurveBasis, line as d3Line } from 'd3-shape';
import { classNamesFunction, find, getId, memoizeFunction } from '@fluentui/react/lib/Utilities';
import {
classNamesFunction,
find,
getId,
initializeComponentRef,
memoizeFunction,
} from '@fluentui/react/lib/Utilities';
import {
IAccessibilityProps,
CartesianChart,
Expand Down Expand Up @@ -38,6 +44,7 @@ import {
} from '../../utilities/index';
import { ILegend, Legends } from '../Legends/index';
import { DirectionalHint } from '@fluentui/react/lib/Callout';
import { IChart } from '../../types/index';

const getClassNames = classNamesFunction<IAreaChartStyleProps, IAreaChartStyles>();

Expand Down Expand Up @@ -82,7 +89,7 @@ export interface IAreaChartState extends IBasestate {
activePoint: string;
}

export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartState> {
export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartState> implements IChart {
public static defaultProps: Partial<IAreaChartProps> = {
useUTC: true,
};
Expand Down Expand Up @@ -119,9 +126,13 @@ export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartSt
private _enableComputationOptimization: boolean;
private _firstRenderOptimization: boolean;
private _emptyChartId: string;
private _cartesianChartRef: React.RefObject<IChart>;

public constructor(props: IAreaChartProps) {
super(props);

initializeComponentRef(this);

this._createSet = memoizeFunction(this._createDataSet);
this.state = {
selectedLegend: props.legendProps?.selectedLegend ?? '',
Expand All @@ -148,6 +159,7 @@ export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartSt
this._enableComputationOptimization = true;
this._firstRenderOptimization = true;
this._emptyChartId = getId('_AreaChart_empty');
this._cartesianChartRef = React.createRef();
}

public componentDidUpdate() {
Expand Down Expand Up @@ -212,6 +224,7 @@ export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartSt
customizedCallout={this._getCustomizedCallout()}
onChartMouseLeave={this._handleChartMouseLeave}
enableFirstRenderOptimization={this.props.enablePerfOptimization && this._firstRenderOptimization}
ref={this._cartesianChartRef}
/* eslint-disable react/jsx-no-bind */
// eslint-disable-next-line react/no-children-prop
children={(props: IChildProps) => {
Expand Down Expand Up @@ -249,6 +262,10 @@ export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartSt
);
}

public get chartContainer(): HTMLElement | null {
return this._cartesianChartRef.current?.chartContainer || null;
}

private _getDomainNRangeValues = (
points: ILineChartPoints[],
margins: IMargins,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
} from '../../utilities/index';
import { LegendShape, Shape } from '../Legends/index';
import { SVGTooltipText } from '../../utilities/SVGTooltipText';
import { IChart } from '../../types/index';

const getClassNames = classNamesFunction<ICartesianChartStyleProps, ICartesianChartStyles>();
const ChartHoverCard = React.lazy(() =>
Expand Down Expand Up @@ -63,9 +64,12 @@ export interface ICartesianChartState {
* 2.Callout
* 3.Fit parent Continer
*/
export class CartesianChartBase extends React.Component<IModifiedCartesianChartProps, ICartesianChartState> {
export class CartesianChartBase
extends React.Component<IModifiedCartesianChartProps, ICartesianChartState>
implements IChart
{
public chartContainer: HTMLDivElement;
private _classNames: IProcessedStyleSet<ICartesianChartStyles>;
private chartContainer: HTMLDivElement;
private legendContainer: HTMLDivElement;
private minLegendContainerHeight: number = 32;
private xAxisElement: SVGSVGElement | null;
Expand Down Expand Up @@ -619,6 +623,7 @@ export class CartesianChartBase extends React.Component<IModifiedCartesianChartP
</div>
);
}

/**
* Dedicated function to return the Callout JSX Element , which can further be used to only call this when
* only the calloutprops and charthover props changes.
Expand Down
Loading

0 comments on commit 5c071bc

Please sign in to comment.