From c73fe82b9b7ae47480c905657b96090e14440d59 Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:43:48 +0200 Subject: [PATCH] [docs] Address charts docs feedback (#10119) --- docs/data/charts/legend/DimensionsNoSnap.js | 2 +- .../legend/LegendCustomizationNoSnap.js | 2 +- docs/data/charts/lines/InterpolationDemo.tsx | 48 ------------------- ...tionDemo.js => InterpolationDemoNoSnap.js} | 14 +++++- docs/data/charts/lines/lines.md | 5 +- 5 files changed, 19 insertions(+), 52 deletions(-) delete mode 100644 docs/data/charts/lines/InterpolationDemo.tsx rename docs/data/charts/lines/{InterpolationDemo.js => InterpolationDemoNoSnap.js} (73%) diff --git a/docs/data/charts/legend/DimensionsNoSnap.js b/docs/data/charts/legend/DimensionsNoSnap.js index b303e053c727..7752737248c0 100644 --- a/docs/data/charts/legend/DimensionsNoSnap.js +++ b/docs/data/charts/legend/DimensionsNoSnap.js @@ -82,7 +82,7 @@ export default function DimensionsNoSnap() { `('linear'); - - return ( - - setCurveType(event.target.value as CurveType)} - > - {curveTypes.map((curve) => ( - - {curve} - - ))} - - - - ); -} diff --git a/docs/data/charts/lines/InterpolationDemo.js b/docs/data/charts/lines/InterpolationDemoNoSnap.js similarity index 73% rename from docs/data/charts/lines/InterpolationDemo.js rename to docs/data/charts/lines/InterpolationDemoNoSnap.js index 71cc402daf00..9ee64cc05e75 100644 --- a/docs/data/charts/lines/InterpolationDemo.js +++ b/docs/data/charts/lines/InterpolationDemoNoSnap.js @@ -4,6 +4,8 @@ import TextField from '@mui/material/TextField'; import MenuItem from '@mui/material/MenuItem'; import { LineChart } from '@mui/x-charts/LineChart'; +import HighlightedCode from 'docs/src/modules/components/HighlightedCode'; + const curveTypes = [ 'catmullRom', 'linear', @@ -15,7 +17,16 @@ const curveTypes = [ 'stepAfter', ]; -export default function InterpolationDemo() { +function getExample(curveType) { + return ``; +} +export default function InterpolationDemoNoSnap() { const [curveType, setCurveType] = React.useState('linear'); return ( @@ -42,6 +53,7 @@ export default function InterpolationDemo() { height={300} margin={{ top: 10, bottom: 30 }} /> + ); } diff --git a/docs/data/charts/lines/lines.md b/docs/data/charts/lines/lines.md index a1ee7f32eca9..ab300ed717bf 100644 --- a/docs/data/charts/lines/lines.md +++ b/docs/data/charts/lines/lines.md @@ -59,7 +59,10 @@ For more information, see [stacking docs](/x/react-charts/stacking/). The interpolation between data points can be customized by the `curve` property. This property expects one of the following string values, corresponding to the interpolation method: `'catmullRom'`, `'linear'`, `'monotoneX'`, `'monotoneY'`, `'natural'`, `'step'`, `'stepBefore'`, `'stepAfter'`. -{{"demo": "InterpolationDemo.js", "hideToolbar": true, "bg": "inline"}} +This series property adds the option to control the interpolation of a series. +Different series could even have different interpolations. + +{{"demo": "InterpolationDemoNoSnap.js", "hideToolbar": true, "bg": "inline"}} ### CSS