Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pluggin-continue
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Jan 13, 2025
2 parents c60c02e + 2c9ddc9 commit 80499bf
Show file tree
Hide file tree
Showing 39 changed files with 827 additions and 674 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
languages: typescript
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -29,4 +29,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
2 changes: 1 addition & 1 deletion .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pull-requests: write
steps:
- name: check if prs are dirty
uses: eps1lon/actions-label-merge-conflict@1b1b1fcde06a9b3d089f3464c96417961dde1168 # v3.0.2
uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 # v3.0.3
with:
dirtyLabel: 'PR: out-of-date'
repoToken: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
with:
sarif_file: results.sarif
22 changes: 11 additions & 11 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.14.0",
"@mui/docs": "6.3.1",
"@mui/icons-material": "^5.16.13",
"@mui/icons-material": "^5.16.14",
"@mui/joy": "^5.0.0-beta.51",
"@mui/lab": "^5.0.0-alpha.175",
"@mui/material": "^5.16.13",
"@mui/material-nextjs": "^5.16.13",
"@mui/styles": "^5.16.13",
"@mui/system": "^5.16.13",
"@mui/utils": "^5.16.13",
"@mui/material": "^5.16.14",
"@mui/material-nextjs": "^5.16.14",
"@mui/styles": "^5.16.14",
"@mui/system": "^5.16.14",
"@mui/utils": "^5.16.14",
"@mui/x-charts": "workspace:*",
"@mui/x-charts-vendor": "workspace:*",
"@mui/x-data-grid": "workspace:*",
Expand All @@ -46,7 +46,7 @@
"@mui/x-date-pickers-pro": "workspace:*",
"@mui/x-tree-view": "workspace:*",
"@react-spring/web": "^9.7.5",
"@tanstack/query-core": "^5.62.15",
"@tanstack/query-core": "^5.64.0",
"ast-types": "^0.14.2",
"autoprefixer": "^10.4.20",
"babel-plugin-module-resolver": "^5.0.2",
Expand All @@ -67,16 +67,16 @@
"doctrine": "^3.0.0",
"exceljs": "^4.4.0",
"fg-loadcss": "^3.1.0",
"jscodeshift": "17.1.1",
"jscodeshift": "17.1.2",
"lodash": "^4.17.21",
"luxon": "^3.5.0",
"lz-string": "^1.5.0",
"markdown-to-jsx": "^7.7.2",
"markdown-to-jsx": "^7.7.3",
"moment": "^2.30.1",
"moment-hijri": "^3.0.0",
"moment-jalaali": "^0.10.4",
"moment-timezone": "^0.5.46",
"next": "^15.1.3",
"next": "^15.1.4",
"nprogress": "^0.2.0",
"postcss": "^8.4.49",
"prismjs": "^1.29.0",
Expand Down Expand Up @@ -114,7 +114,7 @@
"@types/moment-hijri": "^2.1.4",
"@types/moment-jalaali": "^0.7.9",
"@types/prop-types": "^15.7.14",
"@types/react-dom": "^19.0.2",
"@types/react-dom": "^19.0.3",
"@types/react-router-dom": "^5.3.3",
"@types/stylis": "^4.2.7",
"@types/webpack-bundle-analyzer": "^4.7.0",
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@babel/register": "^7.25.9",
"@babel/traverse": "^7.26.4",
"@babel/types": "^7.26.3",
"@babel/traverse": "^7.26.5",
"@babel/types": "^7.26.5",
"@emotion/cache": "^11.14.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/icons-material": "^5.16.13",
"@mui/icons-material": "^5.16.14",
"@mui/internal-babel-plugin-resolve-imports": "1.0.20",
"@mui/internal-markdown": "^1.0.24",
"@mui/internal-test-utils": "^1.0.25",
"@mui/material": "^5.16.13",
"@mui/monorepo": "github:mui/material-ui#5d892caa7325fdc8679862f83804c541954fecbc",
"@mui/utils": "^5.16.13",
"@next/eslint-plugin-next": "15.1.3",
"@octokit/plugin-retry": "^7.1.2",
"@octokit/rest": "^21.0.2",
"@mui/material": "^5.16.14",
"@mui/monorepo": "github:mui/material-ui#c51af8e3db130523bbb71c8758c828225e940c91",
"@mui/utils": "^5.16.14",
"@next/eslint-plugin-next": "15.1.4",
"@octokit/plugin-retry": "^7.1.3",
"@octokit/rest": "^21.1.0",
"@playwright/test": "^1.49.1",
"@types/babel__core": "^7.20.5",
"@types/babel__traverse": "^7.20.6",
Expand All @@ -109,9 +109,9 @@
"@types/karma": "^6.3.9",
"@types/lodash": "^4.17.14",
"@types/mocha": "^10.0.10",
"@types/node": "^20.17.11",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@types/node": "^20.17.12",
"@types/react": "^19.0.6",
"@types/react-dom": "^19.0.3",
"@types/requestidlecallback": "^0.3.7",
"@types/sinon": "^17.0.3",
"@types/yargs": "^17.0.33",
Expand Down Expand Up @@ -152,7 +152,7 @@
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-testing-library": "^7.1.1",
"fast-glob": "^3.3.2",
"fast-glob": "^3.3.3",
"format-util": "^1.0.5",
"fs-extra": "^11.2.0",
"glob-gitignore": "^1.0.15",
Expand Down Expand Up @@ -188,7 +188,7 @@
"string-replace-loader": "^3.1.0",
"terser-webpack-plugin": "^5.3.11",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"unist-util-visit": "^5.0.0",
"util": "^0.12.5",
"webpack": "^5.97.1",
Expand All @@ -198,11 +198,11 @@
},
"resolutions": {
"react-is": "^19.0.0",
"@types/node": "^20.17.11"
"@types/node": "^20.17.12"
},
"packageManager": "[email protected].2",
"packageManager": "[email protected].3",
"engines": {
"pnpm": "9.15.2"
"pnpm": "9.15.3"
},
"pnpm": {
"patchedDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rsc-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"devDependencies": {
"@types/mocha": "^10.0.10",
"@types/node": "^20.17.11"
"@types/node": "^20.17.12"
}
}
4 changes: 2 additions & 2 deletions packages/x-charts-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
}
},
"devDependencies": {
"@mui/material": "^5.16.13",
"@mui/system": "^5.16.13",
"@mui/material": "^5.16.14",
"@mui/system": "^5.16.14",
"@react-spring/core": "^9.7.5",
"@react-spring/shared": "^9.7.5",
"@types/prop-types": "^15.7.14",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts-vendor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/d3-delaunay": "^6.0.4",
"@types/d3-interpolate": "^3.0.4",
"@types/d3-scale": "^4.0.8",
"@types/d3-shape": "^3.1.6",
"@types/d3-shape": "^3.1.7",
"@types/d3-time": "^3.0.4",
"d3-color": "^3.1.0",
"d3-delaunay": "^6.0.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
},
"devDependencies": {
"@mui/internal-test-utils": "^1.0.25",
"@mui/material": "^5.16.13",
"@mui/system": "^5.16.13",
"@mui/material": "^5.16.14",
"@mui/system": "^5.16.14",
"@react-spring/core": "^9.7.5",
"@react-spring/shared": "^9.7.5",
"@types/prop-types": "^15.7.14",
Expand Down
6 changes: 3 additions & 3 deletions packages/x-charts/src/ChartsLegend/ContinuousColorLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
ContinuousColorLegendClasses,
useUtilityClasses,
} from './continuousColorLegendClasses';
import { useChartGradientObjectBound } from '../internals/components/ChartsAxesGradients';
import { useChartGradientIdObjectBoundBuilder } from '../hooks/useChartGradientId';

type LabelFormatter = (params: { value: number | Date; formattedValue: string }) => string;

Expand Down Expand Up @@ -210,7 +210,7 @@ const ContinuousColorLegend = consumeThemeProps(
...other
} = props;

const generateGradientId = useChartGradientObjectBound();
const generateGradientId = useChartGradientIdObjectBoundBuilder();
const axisItem = useAxis({ axisDirection, axisId });

const colorMap = axisItem?.colorMap;
Expand Down Expand Up @@ -261,7 +261,7 @@ const ContinuousColorLegend = consumeThemeProps(
rotate={rotateGradient}
reverse={reverse}
thickness={thickness}
gradientId={gradientId ?? generateGradientId(axisItem.id, axisDirection!)}
gradientId={gradientId ?? generateGradientId(axisItem.id)}
/>
</li>
{reverse ? minComponent : maxComponent}
Expand Down
19 changes: 9 additions & 10 deletions packages/x-charts/src/LineChart/AreaPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import { getValueToPositionMapper } from '../hooks/useScale';
import getCurveFactory from '../internals/getCurve';
import { DEFAULT_X_AXIS_KEY } from '../constants';
import { LineItemIdentifier } from '../models/seriesType/line';
import { useChartGradient } from '../internals/components/ChartsAxesGradients';
import { useLineSeries } from '../hooks/useSeries';
import { AxisId } from '../models/axis';
import { useSkipAnimation } from '../context/AnimationProvider';
import { useChartGradientIdBuilder } from '../hooks/useChartGradientId';
import { useXAxes, useYAxes } from '../hooks/useAxis';

export interface AreaPlotSlots extends AreaElementSlots {}
Expand Down Expand Up @@ -52,6 +51,7 @@ const useAggregatedData = () => {
const seriesData = useLineSeries();
const { xAxis, xAxisIds } = useXAxes();
const { yAxis, yAxisIds } = useYAxes();
const getGradientId = useChartGradientIdBuilder();

// This memo prevents odd line chart behavior when hydrating.
const allData = React.useMemo(() => {
Expand Down Expand Up @@ -81,9 +81,9 @@ const useAggregatedData = () => {
const yScale = yAxis[yAxisId].scale;
const xData = xAxis[xAxisId].data;

const gradientUsed: [AxisId, 'x' | 'y'] | undefined =
(yAxis[yAxisId].colorScale && [yAxisId, 'y']) ||
(xAxis[xAxisId].colorScale && [xAxisId, 'x']) ||
const gradientId: string | undefined =
(yAxis[yAxisId].colorScale && getGradientId(yAxisId)) ||
(xAxis[xAxisId].colorScale && getGradientId(xAxisId)) ||
undefined;

if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -137,13 +137,13 @@ const useAggregatedData = () => {
const d = areaPath.curve(curve)(d3Data) || '';
return {
...series[seriesId],
gradientUsed,
gradientId,
d,
seriesId,
};
});
});
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis]);
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis, getGradientId]);

return allData;
};
Expand All @@ -163,20 +163,19 @@ function AreaPlot(props: AreaPlotProps) {
const { slots, slotProps, onItemClick, skipAnimation: inSkipAnimation, ...other } = props;
const skipAnimation = useSkipAnimation(inSkipAnimation);

const getGradientId = useChartGradient();
const completedData = useAggregatedData();

return (
<AreaPlotRoot {...other}>
{completedData.map(
({ d, seriesId, color, area, gradientUsed }) =>
({ d, seriesId, color, area, gradientId }) =>
!!area && (
<AreaElement
key={seriesId}
id={seriesId}
d={d}
color={color}
gradientId={gradientUsed && getGradientId(...gradientUsed)}
gradientId={gradientId}
slots={slots}
slotProps={slotProps}
onClick={onItemClick && ((event) => onItemClick(event, { type: 'line', seriesId }))}
Expand Down
19 changes: 9 additions & 10 deletions packages/x-charts/src/LineChart/LinePlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import { getValueToPositionMapper } from '../hooks/useScale';
import getCurveFactory from '../internals/getCurve';
import { DEFAULT_X_AXIS_KEY } from '../constants';
import { LineItemIdentifier } from '../models/seriesType/line';
import { useChartGradient } from '../internals/components/ChartsAxesGradients';
import { useLineSeries } from '../hooks/useSeries';
import { AxisId } from '../models/axis';
import { useSkipAnimation } from '../context/AnimationProvider';
import { useChartGradientIdBuilder } from '../hooks/useChartGradientId';
import { useXAxes, useYAxes } from '../hooks';

export interface LinePlotSlots extends LineElementSlots {}
Expand Down Expand Up @@ -53,6 +52,7 @@ const useAggregatedData = () => {

const { xAxis, xAxisIds } = useXAxes();
const { yAxis, yAxisIds } = useYAxes();
const getGradientId = useChartGradientIdBuilder();

// This memo prevents odd line chart behavior when hydrating.
const allData = React.useMemo(() => {
Expand All @@ -78,9 +78,9 @@ const useAggregatedData = () => {
const yScale = yAxis[yAxisId].scale;
const xData = xAxis[xAxisId].data;

const gradientUsed: [AxisId, 'x' | 'y'] | undefined =
(yAxis[yAxisId].colorScale && [yAxisId, 'y']) ||
(xAxis[xAxisId].colorScale && [xAxisId, 'x']) ||
const gradientId: string | undefined =
(yAxis[yAxisId].colorScale && getGradientId(yAxisId)) ||
(xAxis[xAxisId].colorScale && getGradientId(xAxisId)) ||
undefined;

if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -116,13 +116,13 @@ const useAggregatedData = () => {
const d = linePath.curve(getCurveFactory(series[seriesId].curve))(d3Data) || '';
return {
...series[seriesId],
gradientUsed,
gradientId,
d,
seriesId,
};
});
});
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis]);
}, [seriesData, xAxisIds, yAxisIds, xAxis, yAxis, getGradientId]);

return allData;
};
Expand All @@ -141,18 +141,17 @@ function LinePlot(props: LinePlotProps) {
const { slots, slotProps, skipAnimation: inSkipAnimation, onItemClick, ...other } = props;
const skipAnimation = useSkipAnimation(inSkipAnimation);

const getGradientId = useChartGradient();
const completedData = useAggregatedData();
return (
<LinePlotRoot {...other}>
{completedData.map(({ d, seriesId, color, gradientUsed }) => {
{completedData.map(({ d, seriesId, color, gradientId }) => {
return (
<LineElement
key={seriesId}
id={seriesId}
d={d}
color={color}
gradientId={gradientUsed && getGradientId(...gradientUsed)}
gradientId={gradientId}
skipAnimation={skipAnimation}
slots={slots}
slotProps={slotProps}
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/SparkLineChart/SparkLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MakeOptional } from '@mui/x-internals/types';
import { BarPlot } from '../BarChart';
import { LinePlot, AreaPlot, LineHighlightPlot } from '../LineChart';
import { ChartContainer, ChartContainerProps } from '../ChartContainer';
import { DEFAULT_X_AXIS_KEY } from '../constants';
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
import { ChartsTooltip } from '../ChartsTooltip';
import { ChartsTooltipSlots, ChartsTooltipSlotProps } from '../ChartsTooltip/ChartTooltip.types';
import { ChartsAxisHighlight, ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
Expand Down Expand Up @@ -187,7 +187,7 @@ const SparkLineChart = React.forwardRef(function SparkLineChart(
]}
yAxis={[
{
id: DEFAULT_X_AXIS_KEY,
id: DEFAULT_Y_AXIS_KEY,
...yAxis,
},
]}
Expand Down
Loading

0 comments on commit 80499bf

Please sign in to comment.