Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 10, 2024
1 parent a0f7a99 commit 33b3fd9
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions packages/x-charts/src/BarChart/BarPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const useCompletedData = (): CompletedBarData[] => {
if (verticalLayout) {
if (!isBandScaleConfig(xAxisConfig)) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
xAxisKey === DEFAULT_X_AXIS_KEY
? 'The first `xAxis`'
: `The x-axis with id "${xAxisKey}"`
Expand All @@ -107,7 +107,7 @@ const useCompletedData = (): CompletedBarData[] => {
}
if (xAxis[xAxisKey].data === undefined) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
xAxisKey === DEFAULT_X_AXIS_KEY
? 'The first `xAxis`'
: `The x-axis with id "${xAxisKey}"`
Expand All @@ -118,7 +118,7 @@ const useCompletedData = (): CompletedBarData[] => {
} else {
if (!isBandScaleConfig(yAxisConfig)) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
yAxisKey === DEFAULT_Y_AXIS_KEY
? 'The first `yAxis`'
: `The y-axis with id "${yAxisKey}"`
Expand All @@ -128,7 +128,7 @@ const useCompletedData = (): CompletedBarData[] => {

if (yAxis[yAxisKey].data === undefined) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
yAxisKey === DEFAULT_Y_AXIS_KEY
? 'The first `yAxis`'
: `The y-axis with id "${yAxisKey}"`
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/BarChart/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const formatter: Formatter<'bar'> = (params, dataset) => {
} else if (dataset === undefined) {
throw new Error(
[
`MUI-X-Charts: bar series with id='${id}' has no data.`,
`MUI X Charts: bar series with id='${id}' has no data.`,
'Either provide a data property to the series or use the dataset prop.',
].join('\n'),
);
Expand Down
8 changes: 4 additions & 4 deletions packages/x-charts/src/ChartsAxis/ChartsAxis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,31 +97,31 @@ function ChartsAxis(props: ChartsAxisProps) {
if (topId !== null && !xAxis[topId]) {
throw Error(
[
`MUI-X-Charts: id used for top axis "${topId}" is not defined.`,
`MUI X Charts: id used for top axis "${topId}" is not defined.`,
`Available ids are: ${xAxisIds.join(', ')}.`,
].join('\n'),
);
}
if (leftId !== null && !yAxis[leftId]) {
throw Error(
[
`MUI-X-Charts: id used for left axis "${leftId}" is not defined.`,
`MUI X Charts: id used for left axis "${leftId}" is not defined.`,
`Available ids are: ${yAxisIds.join(', ')}.`,
].join('\n'),
);
}
if (rightId !== null && !yAxis[rightId]) {
throw Error(
[
`MUI-X-Charts: id used for right axis "${rightId}" is not defined.`,
`MUI X Charts: id used for right axis "${rightId}" is not defined.`,
`Available ids are: ${yAxisIds.join(', ')}.`,
].join('\n'),
);
}
if (bottomId !== null && !xAxis[bottomId]) {
throw Error(
[
`MUI-X-Charts: id used for bottom axis "${bottomId}" is not defined.`,
`MUI X Charts: id used for bottom axis "${bottomId}" is not defined.`,
`Available ids are: ${xAxisIds.join(', ')}.`,
].join('\n'),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ function ChartsReferenceLine(props: ChartsReferenceLineProps) {
const { x, y } = props;
if (x !== undefined && y !== undefined) {
throw new Error(
'MUI-X-Charts: The ChartsReferenceLine can not have both `x` and `y` props set.',
'MUI X Charts: The ChartsReferenceLine can not have both `x` and `y` props set.',
);
}

if (x === undefined && y === undefined) {
throw new Error(
'MUI-X-Charts: The ChartsReferenceLine should have a value in `x` or `y` prop.',
'MUI X Charts: The ChartsReferenceLine should have a value in `x` or `y` prop.',
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/LineChart/AreaPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function AreaPlot(props: AreaPlotProps) {
if (process.env.NODE_ENV !== 'production') {
if (xData === undefined) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
xAxisKey === DEFAULT_X_AXIS_KEY
? 'The first `xAxis`'
: `The x-axis with id "${xAxisKey}"`
Expand All @@ -73,7 +73,7 @@ function AreaPlot(props: AreaPlotProps) {
}
if (xData.length < stackedData.length) {
throw new Error(
`MUI-X-Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`,
`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/LineHighlightPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function LineHighlightPlot(props: LineHighlightPlotProps) {

if (xData === undefined) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
xAxisKey === DEFAULT_X_AXIS_KEY
? 'The first `xAxis`'
: `The x-axis with id "${xAxisKey}"`
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/LineChart/LinePlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function LinePlot(props: LinePlotProps) {
if (process.env.NODE_ENV !== 'production') {
if (xData === undefined) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
xAxisKey === DEFAULT_X_AXIS_KEY
? 'The first `xAxis`'
: `The x-axis with id "${xAxisKey}"`
Expand All @@ -71,7 +71,7 @@ function LinePlot(props: LinePlotProps) {
}
if (xData.length < stackedData.length) {
throw new Error(
`MUI-X-Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`,
`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/MarkPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function MarkPlot(props: MarkPlotProps) {

if (xData === undefined) {
throw new Error(
`MUI-X-Charts: ${
`MUI X Charts: ${
xAxisKey === DEFAULT_X_AXIS_KEY
? 'The first `xAxis`'
: `The x-axis with id "${xAxisKey}"`
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const formatter: Formatter<'line'> = (params, dataset) => {
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
throw new Error(
[
`MUI-X-Charts: line series with id='${id}' has no data.`,
`MUI X Charts: line series with id='${id}' has no data.`,
'Either provide a data property to the series or use the dataset prop.',
].join('\n'),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/ResponsiveChartContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ const useChartDimensions = (
if (process.env.NODE_ENV !== 'production') {
if (displayError.current && inWidth === undefined && width === 0) {
console.error(
`MUI-X-Charts: ChartContainer does not have \`width\` prop, and its container has no \`width\` defined.`,
`MUI X Charts: ChartContainer does not have \`width\` prop, and its container has no \`width\` defined.`,
);
displayError.current = false;
}
if (displayError.current && inHeight === undefined && height === 0) {
console.error(
`MUI-X-Charts: ChartContainer does not have \`height\` prop, and its container has no \`height\` defined.`,
`MUI X Charts: ChartContainer does not have \`height\` prop, and its container has no \`height\` defined.`,
);
displayError.current = false;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/context/CartesianContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function CartesianContextProvider(props: CartesianContextProviderProps) {
return axisConfig;
}
if (dataset === undefined) {
throw Error('MUI-X-Charts: x-axis uses `dataKey` but no `dataset` is provided.');
throw Error('MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.');
}
return {
...axisConfig,
Expand All @@ -126,7 +126,7 @@ function CartesianContextProvider(props: CartesianContextProviderProps) {
return axisConfig;
}
if (dataset === undefined) {
throw Error('MUI-X-Charts: y-axis uses `dataKey` but no `dataset` is provided.');
throw Error('MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.');
}
return {
...axisConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/context/SeriesContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const formatSeries = (series: AllSeriesType[], colors: string[], dataset?: Datas
seriesGroups[type] = { series: {}, seriesOrder: [] };
}
if (seriesGroups[type]?.series[id] !== undefined) {
throw new Error(`MUI-X-Charts: series' id "${id}" is not unique.`);
throw new Error(`MUI X Charts: series' id "${id}" is not unique.`);
}

seriesGroups[type]!.series[id] = {
Expand Down

0 comments on commit 33b3fd9

Please sign in to comment.