Skip to content

Commit

Permalink
[code-infra] Add Charts sandbox generation (#15830)
Browse files Browse the repository at this point in the history
  • Loading branch information
JCQuintas authored Dec 10, 2024
1 parent 1b53854 commit 767e185
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"@mui/x-tree-view-pro": "packages/x-tree-view-pro/build",
"@mui/x-internals": "packages/x-internals/build"
},
"sandboxes": ["/bug-reproductions/x-data-grid"],
"sandboxes": ["/bug-reproductions/x-data-grid", "/bug-reproductions/x-charts"],
"silent": true
}
25 changes: 25 additions & 0 deletions bug-reproductions/x-charts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"dependencies": {
"@emotion/react": "latest",
"@emotion/styled": "latest",
"@mui/icons-material": "latest",
"@mui/material": "latest",
"@mui/x-charts": "latest",
"@mui/x-charts-pro": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"react": "latest",
"react-dom": "latest",
"typescript": "latest"
},
"devDependencies": {
"react-scripts": "latest"
},
"main": "src/index.tsx",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
}
19 changes: 19 additions & 0 deletions bug-reproductions/x-charts/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<title>Charts — MUI X</title>
<!-- Fonts to support Material Design -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap"
/>
<meta name="viewport" content="initial-scale=1, width=device-width" />
<!-- Icons to support Material Design -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
</head>
<body>
<div id="root"></div>
</body>
</html>
20 changes: 20 additions & 0 deletions bug-reproductions/x-charts/src/demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { BarChart } from '@mui/x-charts';

export default function Demo() {
return (
<Box sx={{ height: 520, width: '100%' }}>
<BarChart
xAxis={[{ scaleType: 'band', data: ['group A', 'group B', 'group C'] }]}
series={[
{ label: 'first', data: [4, 3, 5] },
{ label: 'second', data: [1, 6, 3] },
{ label: 'third', data: [2, 5, 6] },
]}
width={500}
height={300}
/>
</Box>
);
}
12 changes: 12 additions & 0 deletions bug-reproductions/x-charts/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom/client';
import { StyledEngineProvider } from '@mui/material/styles';
import Demo from './demo';

ReactDOM.createRoot(document.querySelector('#root')!).render(
<React.StrictMode>
<StyledEngineProvider injectFirst>
<Demo />
</StyledEngineProvider>
</React.StrictMode>,
);
6 changes: 6 additions & 0 deletions bug-reproductions/x-charts/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "MUI X Charts template",
"description": "Base template for reporting a bug",
"tags": ["react", "typescript"],
"published": true
}
19 changes: 19 additions & 0 deletions bug-reproductions/x-charts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": ["src"]
}

0 comments on commit 767e185

Please sign in to comment.