Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts][docs] Avoid use of shorthand #12000

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/charts/lines/LineDataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export default function LineDataset() {
xAxis={[
{
dataKey: 'year',
valueFormatter: (v) => v.toString(),
valueFormatter: (value) => value.toString(),
min: 1985,
max: 2022,
},
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/lines/LineDataset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export default function LineDataset() {
xAxis={[
{
dataKey: 'year',
valueFormatter: (v) => v.toString(),
valueFormatter: (value) => value.toString(),
min: 1985,
max: 2022,
},
Expand Down
4 changes: 2 additions & 2 deletions docs/data/charts/tooltip/Formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export default function Formatting() {
<LineChart
{...lineChartsParams}
xAxis={[{ data: years, scaleType: 'time', valueFormatter: yearFormatter }]}
series={lineChartsParams.series.map((s) => ({
...s,
series={lineChartsParams.series.map((serie) => ({
...serie,
valueFormatter: currencyFormatter,
}))}
/>
Expand Down
4 changes: 2 additions & 2 deletions docs/data/charts/tooltip/Formatting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export default function Formatting() {
<LineChart
{...lineChartsParams}
xAxis={[{ data: years, scaleType: 'time', valueFormatter: yearFormatter }]}
series={lineChartsParams.series.map((s) => ({
...s,
series={lineChartsParams.series.map((serie) => ({
...serie,
valueFormatter: currencyFormatter,
}))}
/>
Expand Down
4 changes: 2 additions & 2 deletions docs/data/charts/tooltip/Formatting.tsx.preview
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<LineChart
{...lineChartsParams}
xAxis={[{ data: years, scaleType: 'time', valueFormatter: yearFormatter }]}
series={lineChartsParams.series.map((s) => ({
...s,
series={lineChartsParams.series.map((serie) => ({
...serie,
valueFormatter: currencyFormatter,
}))}
/>
2 changes: 1 addition & 1 deletion docs/pages/x/api/charts/spark-line-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"valueFormatter": {
"type": { "name": "func" },
"default": "(v: number | null) => (v === null ? '' : v.toString())",
"default": "(value: number | null) => (value === null ? '' : value.toString())",
"signature": {
"type": "function(value: number) => string",
"describedArgs": ["value"],
Expand Down
6 changes: 3 additions & 3 deletions packages/x-charts/src/SparkLineChart/SparkLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface SparkLineChartProps
* Formatter used by the tooltip.
* @param {number} value The value to format.
* @returns {string} the formatted value.
* @default (v: number | null) => (v === null ? '' : v.toString())
* @default (value: number | null) => (value === null ? '' : value.toString())
*/
valueFormatter?: (value: number | null) => string;
/**
Expand Down Expand Up @@ -143,7 +143,7 @@ const SparkLineChart = React.forwardRef(function SparkLineChart(props: SparkLine
slotProps,
data,
plotType = 'line',
valueFormatter = (v: number | null) => (v === null ? '' : v.toString()),
valueFormatter = (value: number | null) => (value === null ? '' : value.toString()),
area,
curve = 'linear',
} = props;
Expand Down Expand Up @@ -328,7 +328,7 @@ SparkLineChart.propTypes = {
* Formatter used by the tooltip.
* @param {number} value The value to format.
* @returns {string} the formatted value.
* @default (v: number | null) => (v === null ? '' : v.toString())
* @default (value: number | null) => (value === null ? '' : value.toString())
*/
valueFormatter: PropTypes.func,
viewBox: PropTypes.shape({
Expand Down
Loading