Skip to content

Commit

Permalink
Take snapshot of color scales
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Apr 19, 2024
1 parent 5c48a86 commit c0d196e
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import { BarChart } from '@mui/x-charts/BarChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import { HighlightedCode } from '@mui/docs/HighlightedCode';

const series = [{ data: [-2, -9, 12, 11, 6, -4] }];

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState('piecewise');
const [colorY, setColorY] = React.useState('None');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { HighlightedCode } from '@mui/docs/HighlightedCode';

const series = [{ data: [-2, -9, 12, 11, 6, -4] }];

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState<
'None' | 'piecewise' | 'continuous' | 'ordinal'
>('piecewise');
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/bars/bars.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The bar charts use by priority:

Learn more about the `colorMap` properties in the [Styling docs](/x/react-charts/styling/#values-color).

{{"demo": "ColorScaleNoSnap.js"}}
{{"demo": "ColorScale.js"}}

## Click event

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { LineChart } from '@mui/x-charts/LineChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import { HighlightedCode } from '@mui/docs/HighlightedCode';

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState('None');
const [colorY, setColorY] = React.useState('piecewise');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import { HighlightedCode } from '@mui/docs/HighlightedCode';

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState<
'None' | 'piecewise' | 'continuous' | 'ordinal'
>('None');
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/lines/lines.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ The line charts use by priority:

Learn more about the `colorMap` properties in the [Styling docs](/x/react-charts/styling/#values-color).

{{"demo": "ColorScaleNoSnap.js"}}
{{"demo": "ColorScale.js"}}

:::warning
For now, ordinal config is not supported for line chart.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { ScatterChart } from '@mui/x-charts/ScatterChart';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
// @ts-ignore
import { HighlightedCode } from '@mui/docs/HighlightedCode';

import { Chance } from 'chance';

const POINTS_NUMBER = 50;
const chance = new Chance(42);

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState('piecewise');
const [colorY, setColorY] = React.useState('None');
const [colorZ, setColorZ] = React.useState('None');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Chance } from 'chance';
const POINTS_NUMBER = 50;
const chance = new Chance(42);

export default function ColorScaleNoSnap() {
export default function ColorScale() {
const [colorX, setColorX] = React.useState<'None' | 'piecewise' | 'continuous'>(
'piecewise',
);
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/scatter/scatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Here are three ways to set z value to 5.

Learn more about the `colorMap` properties in the [Styling docs](/x/react-charts/styling/#values-color).

{{"demo": "ColorScaleNoSnap.js"}}
{{"demo": "ColorScale.js"}}

### Grid

Expand Down

0 comments on commit c0d196e

Please sign in to comment.