Skip to content

Commit

Permalink
Rename structure and try to implement a loader for demo tag
Browse files Browse the repository at this point in the history
  • Loading branch information
joserodolfofreitas committed Dec 10, 2024
1 parent 2a9ec80 commit 930d31d
Show file tree
Hide file tree
Showing 39 changed files with 551 additions and 46 deletions.
7 changes: 0 additions & 7 deletions docs/pages/blog/2022-developer-survey-results.js

This file was deleted.

7 changes: 7 additions & 0 deletions docs/pages/blog/developer-survey-impacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as React from 'react';
import TopLayoutSurvey from 'docs/src/modules/components/TopLayoutSurvey';
import { docs } from './developer-survey-impacts.md?@mui/markdown';

export default function Page() {
return <TopLayoutSurvey docs={docs} />;
}

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions docs/pages/blog/survey-charts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import {
DataGridPremium,
GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD,
GridToolbar,
useGridApiRef,
useKeepGroupedColumnsHidden,
} from '@mui/x-data-grid-premium';
import { useDemoData } from '@mui/x-data-grid-generator';

const visibleFields = [
'commodity',
'quantity',
'filledQuantity',
'status',
'isFilled',
'unitPrice',
'unitPriceCurrency',
'subTotal',
'feeRate',
'feeAmount',
'incoTerm',
];

export default function DataGridPremiumDemo() {
const { data, loading } = useDemoData({
dataSet: 'Commodity',
rowLength: 100,
editable: true,
visibleFields,
});
const apiRef = useGridApiRef();

const initialState = useKeepGroupedColumnsHidden({
apiRef,
initialState: {
...data.initialState,
rowGrouping: {
...data.initialState?.rowGrouping,
model: ['commodity'],
},
sorting: {
sortModel: [{ field: GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD, sort: 'asc' }],
},
aggregation: {
model: {
quantity: 'sum',
},
},
},
});

return (
<Box sx={{ height: 520, width: '100%' }}>
<DataGridPremium
{...data}
apiRef={apiRef}
loading={loading}
disableRowSelectionOnClick
initialState={initialState}
slots={{ toolbar: GridToolbar }}
/>
</Box>
);
}
Loading

0 comments on commit 930d31d

Please sign in to comment.