-
-
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 'mui:master' into focused_cell_fix
- Loading branch information
Showing
128 changed files
with
2,759 additions
and
1,089 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,68 @@ | ||
import * as React from 'react'; | ||
import ChartsUsageDemo from 'docsx/src/modules/components/ChartsUsageDemo'; | ||
import { BarChart } from '@mui/x-charts/BarChart'; | ||
|
||
const series = [ | ||
{ data: [1, 5, 2], stack: 'a' }, | ||
{ data: [2, 3, 4], stack: 'a' }, | ||
{ data: [3, 2, 3], stack: 'b' }, | ||
{ data: [8, 3, 6], stack: 'b' }, | ||
{ data: [11, 6, 9] }, | ||
]; | ||
export default function BarGapNoSnap() { | ||
return ( | ||
<ChartsUsageDemo | ||
componentName="Bar gap" | ||
data={[ | ||
{ | ||
propName: `categoryGapRatio`, | ||
knob: 'number', | ||
defaultValue: 0.3, | ||
step: 0.1, | ||
min: 0, | ||
max: 1, | ||
}, | ||
{ | ||
propName: `barGapRatio`, | ||
knob: 'number', | ||
defaultValue: 0.1, | ||
step: 0.1, | ||
min: -2, | ||
max: 5, | ||
}, | ||
]} | ||
renderDemo={(props) => ( | ||
<BarChart | ||
series={series} | ||
width={500} | ||
height={300} | ||
margin={{ top: 5 }} | ||
xAxis={[ | ||
{ | ||
scaleType: 'band', | ||
data: ['Page 1', 'Page 2', 'Page 3'], | ||
categoryGapRatio: props.categoryGapRatio, | ||
barGapRatio: props.barGapRatio, | ||
}, | ||
]} | ||
/> | ||
)} | ||
getCode={({ props }) => { | ||
return [ | ||
`import { BarChart } from '@mui/x-charts/BarChart';`, | ||
'', | ||
`<BarChart`, | ||
` // ...`, | ||
` xAxis={[`, | ||
` {`, | ||
` scaleType: 'band'`, | ||
` data: ['Page 1', 'Page 2', 'Page 3']`, | ||
` categoryGapRatio: ${props.categoryGapRatio}`, | ||
` barGapRatio: ${props.barGapRatio}`, | ||
` }`, | ||
'/>', | ||
].join('\n'); | ||
}} | ||
/> | ||
); | ||
} |
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,64 @@ | ||
import * as React from 'react'; | ||
import { styled } from '@mui/material/styles'; | ||
import { ResponsiveChartContainer, LinePlot, useDrawingArea } from '@mui/x-charts'; | ||
|
||
const StyledPath = styled('path')(({ theme }) => ({ | ||
fill: 'none', | ||
stroke: theme.palette.text.primary, | ||
shapeRendering: 'crispEdges', | ||
strokeWidth: 1, | ||
pointerEvents: 'none', | ||
})); | ||
|
||
const StyledText = styled('text')(({ theme }) => ({ | ||
stroke: 'none', | ||
fill: theme.palette.text.primary, | ||
shapeRendering: 'crispEdges', | ||
})); | ||
|
||
function DrawingAreaBox() { | ||
const { left, top, width, height } = useDrawingArea(); | ||
return ( | ||
<React.Fragment> | ||
<StyledPath | ||
d={`M ${left} ${top} l ${width} 0 l 0 ${height} l -${width} 0 Z`} | ||
/> | ||
<circle cx={left} cy={top} r={3} style={{ fill: 'red' }} /> | ||
<circle cx={left + width} cy={top + height} r={3} style={{ fill: 'red' }} /> | ||
<StyledText | ||
x={left} | ||
y={top} | ||
textAnchor="start" | ||
alignmentBaseline="text-after-edge" | ||
> | ||
({left},{top}) | ||
</StyledText> | ||
<StyledText | ||
x={left + width} | ||
y={top + height} | ||
textAnchor="end" | ||
alignmentBaseline="text-before-edge" | ||
> | ||
({left + width},{top + height}) | ||
</StyledText> | ||
</React.Fragment> | ||
); | ||
} | ||
export default function BasicScaleDemo() { | ||
return ( | ||
<ResponsiveChartContainer | ||
margin={{ top: 20, left: 10, right: 10, bottom: 30 }} | ||
height={300} | ||
series={[ | ||
{ | ||
type: 'line', | ||
data: [13, 13, 54, 651, 657, 987, 64, 654, 954, 654, 897, 84], | ||
}, | ||
]} | ||
xAxis={[{ data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }]} | ||
> | ||
<LinePlot /> | ||
<DrawingAreaBox /> | ||
</ResponsiveChartContainer> | ||
); | ||
} |
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,64 @@ | ||
import * as React from 'react'; | ||
import { styled } from '@mui/material/styles'; | ||
import { ResponsiveChartContainer, LinePlot, useDrawingArea } from '@mui/x-charts'; | ||
|
||
const StyledPath = styled('path')(({ theme }) => ({ | ||
fill: 'none', | ||
stroke: theme.palette.text.primary, | ||
shapeRendering: 'crispEdges', | ||
strokeWidth: 1, | ||
pointerEvents: 'none', | ||
})); | ||
|
||
const StyledText = styled('text')(({ theme }) => ({ | ||
stroke: 'none', | ||
fill: theme.palette.text.primary, | ||
shapeRendering: 'crispEdges', | ||
})); | ||
|
||
function DrawingAreaBox() { | ||
const { left, top, width, height } = useDrawingArea(); | ||
return ( | ||
<React.Fragment> | ||
<StyledPath | ||
d={`M ${left} ${top} l ${width} 0 l 0 ${height} l -${width} 0 Z`} | ||
/> | ||
<circle cx={left} cy={top} r={3} style={{ fill: 'red' }} /> | ||
<circle cx={left + width} cy={top + height} r={3} style={{ fill: 'red' }} /> | ||
<StyledText | ||
x={left} | ||
y={top} | ||
textAnchor="start" | ||
alignmentBaseline="text-after-edge" | ||
> | ||
({left},{top}) | ||
</StyledText> | ||
<StyledText | ||
x={left + width} | ||
y={top + height} | ||
textAnchor="end" | ||
alignmentBaseline="text-before-edge" | ||
> | ||
({left + width},{top + height}) | ||
</StyledText> | ||
</React.Fragment> | ||
); | ||
} | ||
export default function BasicScaleDemo() { | ||
return ( | ||
<ResponsiveChartContainer | ||
margin={{ top: 20, left: 10, right: 10, bottom: 30 }} | ||
height={300} | ||
series={[ | ||
{ | ||
type: 'line', | ||
data: [13, 13, 54, 651, 657, 987, 64, 654, 954, 654, 897, 84], | ||
}, | ||
]} | ||
xAxis={[{ data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }]} | ||
> | ||
<LinePlot /> | ||
<DrawingAreaBox /> | ||
</ResponsiveChartContainer> | ||
); | ||
} |
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,14 @@ | ||
<ResponsiveChartContainer | ||
margin={{ top: 20, left: 10, right: 10, bottom: 30 }} | ||
height={300} | ||
series={[ | ||
{ | ||
type: 'line', | ||
data: [13, 13, 54, 651, 657, 987, 64, 654, 954, 654, 897, 84], | ||
}, | ||
]} | ||
xAxis={[{ data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] }]} | ||
> | ||
<LinePlot /> | ||
<DrawingAreaBox /> | ||
</ResponsiveChartContainer> |
Oops, something went wrong.