Skip to content

Commit

Permalink
Merge branch 'master' into users/srmukher/LegendsMultiSel
Browse files Browse the repository at this point in the history
  • Loading branch information
srmukher authored Dec 19, 2024
2 parents 040b1bd + da882f4 commit d4339d8
Show file tree
Hide file tree
Showing 85 changed files with 727 additions and 150 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "patch",
"comment": "Enabled Multi Select behaviour of Controlled legends",
"comment": "Ensure type safety of dependent fields",
"packageName": "@fluentui/react-charting",
"email": "[email protected]",
"dependentChangeType": "patch"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 21 additions & 0 deletions packages/charts/react-charting/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"name": "@fluentui/react-charting",
"entries": [
{
"date": "Wed, 18 Dec 2024 07:20:30 GMT",
"tag": "@fluentui/react-charting_v5.23.27",
"version": "5.23.27",
"comments": {
"patch": [
{
"author": "[email protected]",
"package": "@fluentui/react-charting",
"commit": "870fdfd57db59eb0c549c6c12645fc50130970a4",
"comment": "Enabled Multi Select behaviour of Controlled legends"
},
{
"author": "[email protected]",
"package": "@fluentui/react-charting",
"commit": "835c01b1fd7bcdf86d28f95963950e0e5285319c",
"comment": "Mode check for declarative area chart "
}
]
}
},
{
"date": "Tue, 17 Dec 2024 07:21:19 GMT",
"tag": "@fluentui/react-charting_v5.23.26",
Expand Down
12 changes: 11 additions & 1 deletion packages/charts/react-charting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Change Log - @fluentui/react-charting

This log was last generated on Tue, 17 Dec 2024 07:21:19 GMT and should not be manually modified.
This log was last generated on Wed, 18 Dec 2024 07:20:30 GMT and should not be manually modified.

<!-- Start content -->

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

Wed, 18 Dec 2024 07:20:30 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charting_v5.23.26..@fluentui/react-charting_v5.23.27)

### Patches

- Enabled Multi Select behaviour of Controlled legends ([PR #33479](https://github.com/microsoft/fluentui/pull/33479) by [email protected])
- Mode check for declarative area chart ([PR #33467](https://github.com/microsoft/fluentui/pull/33467) by [email protected])

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

Tue, 17 Dec 2024 07:21:19 GMT
Expand Down
2 changes: 1 addition & 1 deletion 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.26",
"version": "5.23.27",
"description": "React web charting controls for Microsoft fluentui system.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const DeclarativeChart: React.FunctionComponent<DeclarativeChartProps> =
<LineChart
{...transformPlotlyJsonToScatterChartProps({ data, layout }, false, colorMap, isDarkTheme)}
legendProps={{
...legendProps,
onChange: onActiveLegendsChange,
canSelectMultipleLegends: true,
selectedLegends: activeLegends,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ export const transformPlotlyJsonToDonutProps = (
};
});

const width: number = layout?.width || 440;
const height: number = layout?.height || 220;
const hideLabels = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : false;
const donutMarginHorizontal = hideLabels ? 0 : 80;
const donutMarginVertical = 40 + (hideLabels ? 0 : 40);
const width: number = typeof layout?.width === 'number' ? layout?.width : 440;
const height: number = typeof layout?.height === 'number' ? layout?.height : 220;
const hideLabels: boolean = firstData.textinfo ? !['value', 'percent'].includes(firstData.textinfo) : false;
const donutMarginHorizontal: number = hideLabels ? 0 : 80;
const donutMarginVertical: number = 40 + (hideLabels ? 0 : 40);
const innerRadius: number = firstData.hole
? firstData.hole * (Math.min(width - donutMarginHorizontal, height - donutMarginVertical) / 2)
: 0;

const styles: IDonutChartProps['styles'] = {
root: {
'[class^="arcLabel"]': {
fontSize: firstData.textfont?.size,
...(typeof firstData.textfont?.size === 'number' ? { fontSize: firstData.textfont.size } : {}),
},
},
};
Expand Down Expand Up @@ -225,8 +225,8 @@ export const transformPlotlyJsonToVBCProps = (
const totalDataPoints = d3Merge(buckets).length;

buckets.forEach(bucket => {
const legend = series.name || `Series ${index + 1}`;
const color = getColor(legend, colorMap, isDarkTheme);
const legend: string = series.name || `Series ${index + 1}`;
const color: string = getColor(legend, colorMap, isDarkTheme);
let y = bucket.length;

if (series.histnorm === 'percent') {
Expand Down Expand Up @@ -259,7 +259,7 @@ export const transformPlotlyJsonToVBCProps = (

return {
data: vbcData,
chartTitle: layout?.title,
chartTitle: typeof layout?.title === 'string' ? layout?.title : '',
// width: layout?.width,
// height: layout?.height,
hideLegend: true,
Expand All @@ -281,7 +281,7 @@ export const transformPlotlyJsonToScatterChartProps = (
const isString = typeof xValues[0] === 'string';
const isXDate = isDateArray(xValues);
const isXNumber = isNumberArray(xValues);
const legend = series.name || `Series ${index + 1}`;
const legend: string = series.name || `Series ${index + 1}`;
const lineColor = getColor(legend, colorMap, isDarkTheme);

return {
Expand All @@ -295,7 +295,7 @@ export const transformPlotlyJsonToScatterChartProps = (
});

const chartProps: IChartProps = {
chartTitle: layout.title || '',
chartTitle: typeof layout.title === 'string' ? layout.title : '',
lineChartData: chartData,
};

Expand Down Expand Up @@ -333,24 +333,24 @@ export const transformPlotlyJsonToHorizontalBarWithAxisProps = (
})
.flat();

const chartHeight = layout.height || 450;
const margin = layout.margin?.l || 0;
const padding = layout.margin?.pad || 0;
const availableHeight = chartHeight - margin - padding;
const chartHeight: number = typeof layout.height === 'number' ? layout.height : 450;
const margin: number = typeof layout.margin?.l === 'number' ? layout.margin?.l : 0;
const padding: number = typeof layout.margin?.pad === 'number' ? layout.margin?.pad : 0;
const availableHeight: number = chartHeight - margin - padding;
const numberOfBars = data[0].y.length;
const scalingFactor = 0.01;
const gapFactor = 1 / (1 + scalingFactor * numberOfBars);
const barHeight = availableHeight / (numberOfBars * (1 + gapFactor));

return {
data: chartData,
chartTitle: layout.title || '',
chartTitle: typeof layout.title === 'string' ? layout.title : '',
barHeight,
showYAxisLables: true,
styles: {
root: {
height: chartHeight,
width: layout.width || 600,
width: typeof layout.width === 'number' ? layout.width : 600,
},
},
};
Expand Down Expand Up @@ -378,7 +378,7 @@ export const transformPlotlyJsonToHeatmapProps = (jsonObj: any): IHeatMapChartPr
});
});
const heatmapData: IHeatMapChartData = {
legend: firstData.name || '',
legend: typeof firstData.name === 'string' ? firstData.name : '',
data: heatmapDataPoints,
value: 0,
};
Expand Down Expand Up @@ -432,17 +432,17 @@ export const transformPlotlyJsonToSankeyProps = (
}),
};

const width: number = layout?.width || 440;
const height: number = layout?.height || 220;
const width: number = typeof layout?.width === 'number' ? layout?.width : 440;
const height: number = typeof layout?.height === 'number' ? layout?.height : 220;
const styles: ISankeyChartProps['styles'] = {
root: {
fontSize: layout.font?.size,
...(typeof layout.font?.size === 'number' ? { fontSize: layout.font?.size } : {}),
},
};
const shouldResize: number = width + height;
return {
data: {
chartTitle: layout?.title,
chartTitle: typeof layout?.title === 'string' ? layout?.title : '',
SankeyChartData: sankeyChartData,
},
width,
Expand Down Expand Up @@ -494,15 +494,15 @@ export const transformPlotlyJsonToGaugeProps = (

return {
segments,
chartValue: firstData.value,
chartTitle: firstData.title?.text,
chartValue: typeof firstData.value === 'number' ? firstData.value : 0,
chartTitle: typeof firstData.title?.text === 'string' ? firstData.title?.text : '',
sublabel,
// range values can be null
minValue: firstData.gauge?.axis?.range?.[0] ?? undefined,
maxValue: firstData.gauge?.axis?.range?.[1] ?? undefined,
minValue: typeof firstData.gauge?.axis?.range?.[0] === 'number' ? firstData.gauge?.axis?.range?.[0] : undefined,
maxValue: typeof firstData.gauge?.axis?.range?.[1] === 'number' ? firstData.gauge?.axis?.range?.[1] : undefined,
chartValueFormat: () => firstData.value,
width: layout?.width,
height: layout?.height,
width: typeof layout?.width === 'number' ? layout?.width : 0,
height: typeof layout?.height === 'number' ? layout?.height : 0,
hideLegend: true,
styles,
};
Expand Down
21 changes: 21 additions & 0 deletions packages/charts/react-charts-preview/library/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"name": "@fluentui/react-charts-preview",
"entries": [
{
"date": "Wed, 18 Dec 2024 10:59:37 GMT",
"tag": "@fluentui/react-charts-preview_v0.1.5",
"version": "0.1.5",
"comments": {
"patch": [
{
"author": "beachball",
"package": "@fluentui/react-charts-preview",
"comment": "Bump @fluentui/react-overflow to v9.2.5",
"commit": "54afa8c6ce8f7d200d5241584801899b27baaf1b"
},
{
"author": "beachball",
"package": "@fluentui/react-charts-preview",
"comment": "Bump @fluentui/react-popover to v9.9.29",
"commit": "54afa8c6ce8f7d200d5241584801899b27baaf1b"
}
]
}
},
{
"date": "Mon, 16 Dec 2024 16:26:49 GMT",
"tag": "@fluentui/react-charts-preview_v0.1.4",
Expand Down
12 changes: 11 additions & 1 deletion packages/charts/react-charts-preview/library/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Change Log - @fluentui/react-charts-preview

This log was last generated on Mon, 16 Dec 2024 16:26:49 GMT and should not be manually modified.
This log was last generated on Wed, 18 Dec 2024 10:59:37 GMT and should not be manually modified.

<!-- Start content -->

## [0.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts-preview_v0.1.5)

Wed, 18 Dec 2024 10:59:37 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts-preview_v0.1.4..@fluentui/react-charts-preview_v0.1.5)

### Patches

- Bump @fluentui/react-overflow to v9.2.5 ([PR #33483](https://github.com/microsoft/fluentui/pull/33483) by beachball)
- Bump @fluentui/react-popover to v9.9.29 ([PR #33483](https://github.com/microsoft/fluentui/pull/33483) by beachball)

## [0.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts-preview_v0.1.4)

Mon, 16 Dec 2024 16:26:49 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/charts/react-charts-preview/library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentui/react-charts-preview",
"version": "0.1.4",
"version": "0.1.5",
"description": "React web chart controls for Microsoft fluentui v9 system.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand Down Expand Up @@ -39,8 +39,8 @@
"dependencies": {
"@fluentui/react-button": "^9.3.98",
"@fluentui/react-jsx-runtime": "^9.0.48",
"@fluentui/react-overflow": "^9.2.4",
"@fluentui/react-popover": "^9.9.28",
"@fluentui/react-overflow": "^9.2.5",
"@fluentui/react-popover": "^9.9.29",
"@fluentui/react-shared-contexts": "^9.21.2",
"@fluentui/react-tabster": "^9.23.2",
"@fluentui/react-theme": "^9.1.24",
Expand Down
15 changes: 15 additions & 0 deletions packages/react-components/react-avatar/library/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@fluentui/react-avatar",
"entries": [
{
"date": "Wed, 18 Dec 2024 10:59:37 GMT",
"tag": "@fluentui/react-avatar_v9.6.47",
"version": "9.6.47",
"comments": {
"patch": [
{
"author": "beachball",
"package": "@fluentui/react-avatar",
"comment": "Bump @fluentui/react-popover to v9.9.29",
"commit": "54afa8c6ce8f7d200d5241584801899b27baaf1b"
}
]
}
},
{
"date": "Mon, 16 Dec 2024 16:26:49 GMT",
"tag": "@fluentui/react-avatar_v9.6.46",
Expand Down
11 changes: 10 additions & 1 deletion packages/react-components/react-avatar/library/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Change Log - @fluentui/react-avatar

This log was last generated on Mon, 16 Dec 2024 16:26:49 GMT and should not be manually modified.
This log was last generated on Wed, 18 Dec 2024 10:59:37 GMT and should not be manually modified.

<!-- Start content -->

## [9.6.47](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.6.47)

Wed, 18 Dec 2024 10:59:37 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.6.46..@fluentui/react-avatar_v9.6.47)

### Patches

- Bump @fluentui/react-popover to v9.9.29 ([PR #33483](https://github.com/microsoft/fluentui/pull/33483) by beachball)

## [9.6.46](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.6.46)

Mon, 16 Dec 2024 16:26:49 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/react-avatar/library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentui/react-avatar",
"version": "9.6.46",
"version": "9.6.47",
"description": "React components for building Microsoft web experiences.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand All @@ -24,7 +24,7 @@
"@fluentui/react-badge": "^9.2.48",
"@fluentui/react-context-selector": "^9.1.71",
"@fluentui/react-icons": "^2.0.245",
"@fluentui/react-popover": "^9.9.28",
"@fluentui/react-popover": "^9.9.29",
"@fluentui/react-shared-contexts": "^9.21.2",
"@fluentui/react-tabster": "^9.23.2",
"@fluentui/react-theme": "^9.1.24",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentui/react-breadcrumb",
"version": "9.0.46",
"version": "9.0.47",
"description": "Breadcrumb component for Fluent UI React.",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
Expand Down
Loading

0 comments on commit d4339d8

Please sign in to comment.