-
-
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 'perf-filtering-cache-values' of github.com:romgrk/mui-x…
… into perf-filtering-cache-values
- Loading branch information
Showing
199 changed files
with
3,353 additions
and
959 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import * as React from 'react'; | ||
import { LineChart } from '@mui/x-charts/LineChart'; | ||
|
||
const time = [ | ||
new Date(2015, 1, 0), | ||
new Date(2015, 2, 0), | ||
new Date(2015, 3, 0), | ||
new Date(2015, 4, 0), | ||
new Date(2015, 5, 0), | ||
new Date(2015, 6, 0), | ||
new Date(2015, 7, 0), | ||
]; | ||
|
||
const a = [4000, 3000, 2000, 2780, 1890, 2390, 3490]; | ||
const b = [2400, 1398, 9800, 3908, 4800, 3800, 4300]; | ||
const c = [2400, 2210, 2290, 2000, 2181, 2500, 2100]; | ||
|
||
const getPercents = (array) => | ||
array.map((v, index) => (100 * v) / (a[index] + b[index] + c[index])); | ||
|
||
export default function PercentAreaChart() { | ||
return ( | ||
<LineChart | ||
width={500} | ||
height={300} | ||
series={[ | ||
{ | ||
data: getPercents(a), | ||
type: 'line', | ||
label: 'a', | ||
area: true, | ||
stack: 'total', | ||
color: '#8884d8', | ||
}, | ||
{ | ||
data: getPercents(b), | ||
type: 'line', | ||
label: 'b', | ||
area: true, | ||
stack: 'total', | ||
color: '#82ca9d', | ||
}, | ||
{ | ||
data: getPercents(c), | ||
type: 'line', | ||
label: 'c', | ||
area: true, | ||
stack: 'total', | ||
color: '#ffc658', | ||
}, | ||
]} | ||
xAxis={[ | ||
{ | ||
scaleType: 'time', | ||
data: time, | ||
min: time[0].getTime(), | ||
max: time[time.length - 1].getTime(), | ||
}, | ||
]} | ||
sx={{ | ||
'.MuiMarkElement-root': { | ||
display: 'none', | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
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,66 @@ | ||
import * as React from 'react'; | ||
import { LineChart } from '@mui/x-charts/LineChart'; | ||
|
||
const time = [ | ||
new Date(2015, 1, 0), | ||
new Date(2015, 2, 0), | ||
new Date(2015, 3, 0), | ||
new Date(2015, 4, 0), | ||
new Date(2015, 5, 0), | ||
new Date(2015, 6, 0), | ||
new Date(2015, 7, 0), | ||
]; | ||
const a = [4000, 3000, 2000, 2780, 1890, 2390, 3490]; | ||
const b = [2400, 1398, 9800, 3908, 4800, 3800, 4300]; | ||
const c = [2400, 2210, 2290, 2000, 2181, 2500, 2100]; | ||
|
||
const getPercents = (array: number[]) => | ||
array.map((v, index) => (100 * v) / (a[index] + b[index] + c[index])); | ||
|
||
export default function PercentAreaChart() { | ||
return ( | ||
<LineChart | ||
width={500} | ||
height={300} | ||
series={[ | ||
{ | ||
data: getPercents(a), | ||
type: 'line', | ||
label: 'a', | ||
area: true, | ||
stack: 'total', | ||
color: '#8884d8', | ||
}, | ||
{ | ||
data: getPercents(b), | ||
type: 'line', | ||
label: 'b', | ||
area: true, | ||
stack: 'total', | ||
color: '#82ca9d', | ||
}, | ||
{ | ||
data: getPercents(c), | ||
type: 'line', | ||
label: 'c', | ||
area: true, | ||
stack: 'total', | ||
color: '#ffc658', | ||
}, | ||
]} | ||
xAxis={[ | ||
{ | ||
scaleType: 'time', | ||
data: time, | ||
min: time[0].getTime(), | ||
max: time[time.length - 1].getTime(), | ||
}, | ||
]} | ||
sx={{ | ||
'.MuiMarkElement-root': { | ||
display: 'none', | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
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,29 @@ | ||
import * as React from 'react'; | ||
import { LineChart } from '@mui/x-charts/LineChart'; | ||
|
||
const uData = [4000, 3000, 2000, 2780, 1890, 2390, 3490]; | ||
const xLabels = [ | ||
'Page A', | ||
'Page B', | ||
'Page C', | ||
'Page D', | ||
'Page E', | ||
'Page F', | ||
'Page G', | ||
]; | ||
|
||
export default function SimpleAreaChart() { | ||
return ( | ||
<LineChart | ||
width={500} | ||
height={300} | ||
series={[{ data: uData, label: 'uv', area: true, color: '#82ca9d' }]} | ||
xAxis={[{ scaleType: 'point', data: xLabels }]} | ||
sx={{ | ||
'.MuiLineElement-root, .MuiMarkElement-root': { | ||
display: 'none', | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
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,29 @@ | ||
import * as React from 'react'; | ||
import { LineChart } from '@mui/x-charts/LineChart'; | ||
|
||
const uData = [4000, 3000, 2000, 2780, 1890, 2390, 3490]; | ||
const xLabels = [ | ||
'Page A', | ||
'Page B', | ||
'Page C', | ||
'Page D', | ||
'Page E', | ||
'Page F', | ||
'Page G', | ||
]; | ||
|
||
export default function SimpleAreaChart() { | ||
return ( | ||
<LineChart | ||
width={500} | ||
height={300} | ||
series={[{ data: uData, label: 'uv', area: true, color: '#82ca9d' }]} | ||
xAxis={[{ scaleType: 'point', data: xLabels }]} | ||
sx={{ | ||
'.MuiLineElement-root, .MuiMarkElement-root': { | ||
display: 'none', | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
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,11 @@ | ||
<LineChart | ||
width={500} | ||
height={300} | ||
series={[{ data: uData, label: 'uv', area: true, color: '#82ca9d' }]} | ||
xAxis={[{ scaleType: 'point', data: xLabels }]} | ||
sx={{ | ||
'.MuiLineElement-root, .MuiMarkElement-root': { | ||
display: 'none', | ||
}, | ||
}} | ||
/> |
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,41 @@ | ||
import * as React from 'react'; | ||
import { LineChart } from '@mui/x-charts/LineChart'; | ||
|
||
const uData = [4000, 3000, 2000, 2780, 1890, 2390, 3490]; | ||
const pData = [2400, 1398, 9800, 3908, 4800, 3800, 4300]; | ||
const amtData = [2400, 2210, 2290, 2000, 2181, 2500, 2100]; | ||
const xLabels = [ | ||
'Page A', | ||
'Page B', | ||
'Page C', | ||
'Page D', | ||
'Page E', | ||
'Page F', | ||
'Page G', | ||
]; | ||
|
||
export default function StackedAreaChart() { | ||
return ( | ||
<LineChart | ||
width={500} | ||
height={300} | ||
series={[ | ||
{ data: uData, label: 'uv', area: true, stack: 'total', color: '#8884d8' }, | ||
{ data: pData, label: 'pv', area: true, stack: 'total', color: '#82ca9d' }, | ||
{ | ||
data: amtData, | ||
label: 'amt', | ||
area: true, | ||
stack: 'total', | ||
color: '#ffc658', | ||
}, | ||
]} | ||
xAxis={[{ scaleType: 'point', data: xLabels }]} | ||
sx={{ | ||
'.MuiLineElement-root, .MuiMarkElement-root': { | ||
display: 'none', | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
Oops, something went wrong.