Skip to content

Commit b28112a

Browse files
authored
feat(react-charts): onboard v9 charts to nx workspace plugin and enable griffel raw styles (#34912)
1 parent 90fd5b6 commit b28112a

File tree

19 files changed

+75
-37
lines changed

19 files changed

+75
-37
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "feat: enable griffel raw styles",
4+
"packageName": "@fluentui/react-charts",
5+
"email": "martinhochel@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

nx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@
145145
"packages/eslint-plugin/**",
146146
"packages/tokens/**",
147147
"packages/react-conformance/**",
148-
"packages/react-components/**/*"
148+
"packages/react-components/**/*",
149+
"packages/charts/react-charts/**/*"
149150
]
150151
}
151152
],
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
{
22
"extends": ["plugin:@fluentui/eslint-plugin/react"],
3-
"root": true
3+
"root": true,
4+
"rules": {
5+
"@fluentui/no-global-react": "warn",
6+
"@nx/workspace-no-restricted-globals": "warn",
7+
"@rnx-kit/no-export-all": "warn",
8+
"@typescript-eslint/naming-convention": "warn",
9+
"@typescript-eslint/no-explicit-any": "warn",
10+
"@typescript-eslint/no-shadow": "warn",
11+
"array-callback-return": "warn",
12+
"eqeqeq": "warn",
13+
"import/no-extraneous-dependencies": "warn",
14+
"jsdoc/check-tag-names": "warn",
15+
"no-restricted-syntax": "warn",
16+
"object-shorthand": "warn",
17+
"prefer-const": "warn",
18+
"react-compiler/react-compiler": "warn",
19+
"react-hooks/exhaustive-deps": "warn",
20+
"react/jsx-no-bind": "warn"
21+
}
422
}

packages/charts/react-charts/library/bundle-size/LineChart.fixture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LineChart } from '@fluentui/react-charting';
1+
import { LineChart } from '@fluentui/react-charts';
22

33
console.log(LineChart);
44

packages/charts/react-charts/library/just.config.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/charts/react-charts/library/package.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,14 @@
1717
"url": "https://github.com/microsoft/fluentui"
1818
},
1919
"license": "MIT",
20-
"scripts": {
21-
"build": "just-scripts build",
22-
"clean": "just-scripts clean",
23-
"generate-api": "just-scripts generate-api",
24-
"start": "yarn storybook",
25-
"storybook": "yarn --cwd ../stories storybook",
26-
"test": "jest --passWithNoTests",
27-
"type-check": "just-scripts type-check"
28-
},
2920
"syncpack": {
3021
"dependencyTypes": []
3122
},
3223
"devDependencies": {
3324
"@fluentui/eslint-plugin": "*",
3425
"@fluentui/react-conformance": "*",
3526
"@fluentui/react-conformance-griffel": "*",
36-
"@fluentui/scripts-api-extractor": "*",
37-
"@fluentui/scripts-tasks": "*"
27+
"@fluentui/scripts-api-extractor": "*"
3828
},
3929
"dependencies": {
4030
"@fluentui/chart-utilities": "^1.1.26",

packages/charts/react-charts/library/src/components/DeclarativeChart/imageExporter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function cloneLegendsToSVG(chartContainer: HTMLElement, svgWidth: number, svgHei
152152
textOffset = 28;
153153
} else {
154154
legendText = legendButtons[i] as HTMLButtonElement;
155+
// eslint-disable-next-line no-console
155156
console.log(legendText!.textContent);
156157
textOffset = 8;
157158
}

packages/charts/react-charts/library/src/components/DonutChart/DonutChart.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ describe('Donut Chart - axe-core', () => {
222222
});
223223
});
224224

225+
/* eslint-disable @typescript-eslint/no-deprecated */
226+
225227
describe('DonutChart snapShot testing', () => {
226228
it('renders DonutChart correctly', () => {
227229
let component = renderer.create(<DonutChart data={chartPointsDC} innerRadius={55} />);
@@ -275,11 +277,13 @@ describe('DonutChart snapShot testing', () => {
275277
const tree = component!.toJSON();
276278
expect(tree).toMatchSnapshot();
277279
});
280+
278281
it('Should elevate all smaller values to minimums', () => {
279282
let component = renderer.create(<DonutChart data={chartPointsDCElevateMinimums} />);
280283
const tree = component!.toJSON();
281284
expect(tree).toMatchSnapshot();
282285
});
286+
/* eslint-enable @typescript-eslint/no-deprecated */
283287
});
284288

285289
describe('DonutChart - basic props', () => {

packages/charts/react-charts/library/src/components/DonutChart/Pie/Pie.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ export const Pie: React.FunctionComponent<PieProps> = React.forwardRef<HTMLDivEl
4646
}
4747

4848
// eslint-disable-next-line @typescript-eslint/no-explicit-any
49-
function arcGenerator(d: any, i: number, focusData: any, href?: string): JSX.Element {
49+
function arcGenerator(
50+
d: any,
51+
i: number,
52+
focusData: any,
53+
href?: string,
54+
): // eslint-disable-next-line @typescript-eslint/no-deprecated
55+
JSX.Element {
5056
const color = d && d.data && d.data.color;
5157
return (
5258
<Arc

packages/charts/react-charts/library/src/components/GroupedVerticalBarChart/GroupedVerticalBarChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export const GroupedVerticalBarChart: React.FC<GroupedVerticalBarChartProps> = R
244244
const legends: JSX.Element = _getLegendData(points!);
245245
_adjustProps();
246246

247-
// eslint-disable-next-line @typescript-eslint/no-explicit-anyAdd commentMore actions
247+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Add commentMore actions
248248
function _getMinMaxOfYAxis(datasetForBars: any, yAxisType?: YAxisType, useSecondaryYScale?: boolean) {
249249
const values: number[] = [];
250250
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)