Skip to content

Commit 767e185

Browse files
authored
[code-infra] Add Charts sandbox generation (#15830)
1 parent 1b53854 commit 767e185

File tree

7 files changed

+102
-1
lines changed

7 files changed

+102
-1
lines changed

Diff for: .codesandbox/ci.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
"@mui/x-tree-view-pro": "packages/x-tree-view-pro/build",
3333
"@mui/x-internals": "packages/x-internals/build"
3434
},
35-
"sandboxes": ["/bug-reproductions/x-data-grid"],
35+
"sandboxes": ["/bug-reproductions/x-data-grid", "/bug-reproductions/x-charts"],
3636
"silent": true
3737
}

Diff for: bug-reproductions/x-charts/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"dependencies": {
3+
"@emotion/react": "latest",
4+
"@emotion/styled": "latest",
5+
"@mui/icons-material": "latest",
6+
"@mui/material": "latest",
7+
"@mui/x-charts": "latest",
8+
"@mui/x-charts-pro": "latest",
9+
"@types/react": "latest",
10+
"@types/react-dom": "latest",
11+
"react": "latest",
12+
"react-dom": "latest",
13+
"typescript": "latest"
14+
},
15+
"devDependencies": {
16+
"react-scripts": "latest"
17+
},
18+
"main": "src/index.tsx",
19+
"scripts": {
20+
"start": "react-scripts start",
21+
"build": "react-scripts build",
22+
"test": "react-scripts test",
23+
"eject": "react-scripts eject"
24+
}
25+
}

Diff for: bug-reproductions/x-charts/public/index.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>Charts — MUI X</title>
5+
<!-- Fonts to support Material Design -->
6+
<link rel="preconnect" href="https://fonts.googleapis.com" />
7+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8+
<link
9+
rel="stylesheet"
10+
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap"
11+
/>
12+
<meta name="viewport" content="initial-scale=1, width=device-width" />
13+
<!-- Icons to support Material Design -->
14+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
15+
</head>
16+
<body>
17+
<div id="root"></div>
18+
</body>
19+
</html>

Diff for: bug-reproductions/x-charts/src/demo.tsx

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
import Box from '@mui/material/Box';
3+
import { BarChart } from '@mui/x-charts';
4+
5+
export default function Demo() {
6+
return (
7+
<Box sx={{ height: 520, width: '100%' }}>
8+
<BarChart
9+
xAxis={[{ scaleType: 'band', data: ['group A', 'group B', 'group C'] }]}
10+
series={[
11+
{ label: 'first', data: [4, 3, 5] },
12+
{ label: 'second', data: [1, 6, 3] },
13+
{ label: 'third', data: [2, 5, 6] },
14+
]}
15+
width={500}
16+
height={300}
17+
/>
18+
</Box>
19+
);
20+
}

Diff for: bug-reproductions/x-charts/src/index.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as React from 'react';
2+
import * as ReactDOM from 'react-dom/client';
3+
import { StyledEngineProvider } from '@mui/material/styles';
4+
import Demo from './demo';
5+
6+
ReactDOM.createRoot(document.querySelector('#root')!).render(
7+
<React.StrictMode>
8+
<StyledEngineProvider injectFirst>
9+
<Demo />
10+
</StyledEngineProvider>
11+
</React.StrictMode>,
12+
);

Diff for: bug-reproductions/x-charts/template.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"title": "MUI X Charts template",
3+
"description": "Base template for reporting a bug",
4+
"tags": ["react", "typescript"],
5+
"published": true
6+
}

Diff for: bug-reproductions/x-charts/tsconfig.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"esModuleInterop": true,
8+
"allowSyntheticDefaultImports": true,
9+
"strict": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"module": "esnext",
12+
"moduleResolution": "node",
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"noEmit": true,
16+
"jsx": "react"
17+
},
18+
"include": ["src"]
19+
}

0 commit comments

Comments
 (0)