-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into extract-Chip-slot
- Loading branch information
Showing
437 changed files
with
12,632 additions
and
4,383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import * as React from 'react'; | ||
import ChartsUsageDemo from 'docsx/src/modules/components/ChartsUsageDemo'; | ||
import { DEFAULT_X_AXIS_KEY } from '@mui/x-charts/constants'; | ||
import { ScatterChart } from '@mui/x-charts/ScatterChart'; | ||
import { Chance } from 'chance'; | ||
|
||
const chance = new Chance(42); | ||
|
||
const data = Array.from({ length: 200 }, () => ({ | ||
x: chance.floating({ min: -25, max: 25 }), | ||
y: chance.floating({ min: -25, max: 25 }), | ||
})).map((d, index) => ({ ...d, id: index })); | ||
|
||
const defaultXAxis = { | ||
disableLine: false, | ||
disableTicks: false, | ||
fill: 'currentColor', | ||
fontSize: 12, | ||
label: 'my axis', | ||
labelFontSize: 14, | ||
stroke: 'currentColor', | ||
tickSize: 6, | ||
}; | ||
export default function AxisCustomizationNoSnap() { | ||
return ( | ||
<ChartsUsageDemo | ||
componentName="Alert" | ||
data={[ | ||
{ propName: 'disableLine', knob: 'switch', defaultValue: false }, | ||
{ propName: 'disableTicks', knob: 'switch', defaultValue: false }, | ||
{ | ||
propName: 'fill', | ||
knob: 'color', | ||
defaultValue: 'currentColor', | ||
options: ['red', 'blue', 'currentColor'], | ||
}, | ||
{ propName: 'fontSize', knom: 'number', defaultValue: 12 }, | ||
{ propName: 'label', knob: 'input', defaultValue: 'my axis' }, | ||
{ propName: 'labelFontSize', knom: 'number', defaultValue: 14 }, | ||
{ | ||
propName: 'stroke', | ||
knob: 'color', | ||
defaultValue: 'currentColor', | ||
options: ['red', 'blue', 'currentColor'], | ||
}, | ||
{ propName: 'tickSize', knob: 'number', defaultValue: 6 }, | ||
]} | ||
renderDemo={(props) => ( | ||
<ScatterChart | ||
series={[ | ||
{ | ||
type: 'scatter', | ||
id: 'linear', | ||
data, | ||
}, | ||
]} | ||
leftAxis={null} | ||
bottomAxis={{ | ||
axisId: DEFAULT_X_AXIS_KEY, | ||
...defaultXAxis, | ||
...props, | ||
}} | ||
width={400} | ||
height={300} | ||
/> | ||
)} | ||
getCode={({ props }) => | ||
[ | ||
`import { ScatterChart } from '@mui/x-charts/ScatterChart';`, | ||
'', | ||
`<ScatterChart`, | ||
' {/** ... */}', | ||
` bottomAxis={{`, | ||
...Object.keys(props) | ||
.filter((prop) => props[prop] !== defaultXAxis[prop]) | ||
.map( | ||
(prop) => | ||
` ${prop}: ${ | ||
typeof props[prop] === 'string' ? `"${props[prop]}"` : props[prop] | ||
},`, | ||
), | ||
' }}', | ||
'/>', | ||
].join('\n') | ||
} | ||
/> | ||
); | ||
} |
Oops, something went wrong.