@mui/icons-material APIs
- Close
- Add
- Delete
- ExpandMore
- Settings
- Check
- Update
- GitHub
- MoreVert
- HelpOutline
- ChevronRight
- ExpandLess
- Menu
- FileCopy
- CheckBox
- CheckBoxOutlineBlank
- ArrowBack
- DeleteForever
- Visibility
- VisibilityOff
- Save
- Person
- Edit
- People
- ChevronLeft
- PlayArrow
- Home
- ExitToApp
- MoreHoriz
- WbSunny
- Download
- Upload
- Search
- HighlightOffOutlined
- ContentCopy
- Calculate
- ShoppingCart
- AccountBalance
- BarChart
- Paid
- Clear
- Cancel
- ArrowDownward
- ArrowUpward
- PhotoCamera
- Folder
- InfoOutlined
- Code
- KeyboardArrowDown
- Lock
- LockOpen
- Replay
- Favorite
- Build
- Refresh
- AssignmentInd
- Pets
- Public
- Group
- Brush
- KeyboardTab
- Phone
- HelpOutlineOutlined
- NetworkWifi
- CompareArrows
- AdminPanelSettings
- BugReport
- Logout
- Message
- AddCircle
- LockOutlined
- HomeOutlined
- BarChartOutlined
- MusicNote
- MusicNoteOutlined
- Album
- AlbumOutlined
- PersonOutlined
- SettingsOutlined
- Share
- ShareOutlined
- FastRewind
- Help
- Loop
- VolumeDown
- VolumeUp
- PauseCircle
- PlayCircle
- VolumeOff
- ChatBubbleOutline
- LockRounded
- WifiOffRounded
- VideocamOutlined
- AddRounded
- MoreVertRounded
- SyncProblem
- VideoCallOutlined
- GetAppRounded
- SaveAlt
- ErrorRounded
- InsertDriveFileRounded
- CheckCircleOutline
- CloudOff
- ClearAll
- CloseOutlined
- Link
- AttachmentOutlined
- CodeOutlined
- MailOutlineRounded
- Brightness7Rounded
- MenuRounded
- NightsStayRounded
- ArrowForward
- BrushRounded
- VisibilityRounded
- FileCopyRounded
- FavoriteRounded
- DesktopMacRounded
- PhoneAndroidRounded
- TabletMac
- ThumbUpOutlined
- ThumbDownOutlined
- AssistantPhotoOutlined
- Publish
- Create
- WbCloudy
- Computer
- KeyboardArrowUp
- BusinessCenter
- FavoriteBorder
- Groups
- Shuffle
- Difference
- SwapHoriz
- Info
- KeyboardDoubleArrowDown
- KeyboardDoubleArrowUp
- PersonAdd
- Checkroom
- FactCheck
- ArrowRightAlt
- Scanner
- Brightness4
- Brightness7
- Translate
- Backpack
- SettingsBrightness
- Equalizer
- Handyman
- SentimentVerySatisfied
- SentimentDissatisfied
- SentimentSatisfied
- AccessTime
- Remove
- ArrowDropDown
- ArrowRight
- Undo
- Redo
- CreateNewFolder
- Description
- Outbox
- Inbox
- DriveFileRenameOutline
- ContentPaste
- Block
- Star
- StarBorder
- Security
- Today
- Event
- Login
- Sick
- FaceRetouchingOff
- Fireplace
- ErrorOutline
- Stop
- ViewList
- Send
- PlayCircleFilledWhite
- PlaylistAddCheck
- Telegram
- VerifiedUser
- Notifications
- MenuOpen
- GppGood
- ContactPhone
- Payment
- FolderShared
- Class
- Shield
- MoveUp
- VolunteerActivism
- DisplaySettings
- Apartment
- BusAlert
- Category
- FilterNone
- Forest
- MedicalServices
- School
- SportsTennis
- TheaterComedy
- ReportGmailerrorred
- ArrowCircleUp
- UploadFile
- YouTube
- Web
- AccountCircle
- AccessibilityNew
- Chat
- FolderOpen
- FileCopyOutlined
- KeyboardBackspace
- CheckCircleOutlined
- ReportProblemOutlined
- ManageAccounts
- PhotoLibrary
- SettingsBackupRestore
- SupervisorAccount
- Api
- FeaturedPlayList
- BugReportOutlined
- NewReleases
- ColorLens
- FolderOutlined
- Apps
- SpeakerNotes
- LocalCafe
- BurstModeSharp
- DevicesOther
- VideoLibrary
- AddOutlined
- DeleteOutlineOutlined
- EditOutlined
- MoreHorizOutlined
- Bookmarks
- CopyAll
- InsertComment
- KeyboardArrowRight
- FileDownload
- Done
- PendingOutlined
- HelpOutlineRounded
- ReportProblem
- HelpOutlined
Other Related APIs
- react#useState
- react#useContext
- react#useMemo
- @mui/material#Button
- @mui/material#Tooltip
- @mui/material#CardContent
- @mui/material#Typography
- @mui/material#Divider
- @mui/material#MenuItem
- @mui/material#Grid
- @mui/material#Collapse
- @mui/material#styled
- recharts#Line
- recharts#CartesianGrid
- recharts#Legend
- recharts#ResponsiveContainer
- recharts#Scatter
- recharts#ComposedChart
- @mui/icons-material#CheckBox
- @mui/icons-material#CheckBoxOutlineBlank
- @mui/icons-material#Download
@mui/icons-material#Info TypeScript Examples
The following examples show how to use
@mui/icons-material#Info.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChartCard.tsx From genshin-optimizer with MIT License | 4 votes |
export default function ChartCard({ chartData, plotBase, setPlotBase, disabled = false }: ChartCardProps) {
const [showDownload, setshowDownload] = useState(false)
const [showMin, setshowMin] = useState(true)
const { data } = useContext(DataContext)
const statKeys = ["atk", "hp", "def", "eleMas", "critRate_", "critDMG_", "heal_", "enerRech_"]
if (data.get(input.weaponType).value !== "catalyst") statKeys.push("physical_dmg_")
statKeys.push(`${data.get(input.charEle).value}_dmg_`)
const { displayData, downloadData } = useMemo(() => {
if (!chartData) return { displayData: null, downloadData: null }
const points = chartData.data.map(({ value: y, plot: x }) => ({ x, y })) as Point[]
const increasingX: Point[] = points.sort((a, b) => a.x - b.x)
const minimumData: Point[] = []
for (const point of increasingX) {
let last: Point | undefined
while ((last = minimumData.pop())) {
if (last.y > point.y) {
minimumData.push(last)
break
}
}
minimumData.push(point)
}
// Note:
// We can also just use `minimumData` if the plotter supports multiple data sources.
// It could be faster too since there're no empty entries in `minimumData`.
if (minimumData[0]?.x !== increasingX[0]?.x)
increasingX[0].min = minimumData[0].y
minimumData.forEach(x => { x.min = x.y })
const downloadData = {
minimum: minimumData.map(({ x, y }) => [x, y]),
allData: increasingX.map(({ x, y }) => [x, y]),
}
return { displayData: increasingX, downloadData }
}, [chartData])
return <CardLight>
<CardContent>
<Grid container spacing={1} alignItems="center">
<Grid item>
<Typography variant="h6" >Optimization Target vs</Typography>
</Grid>
<Grid item>
<DropdownButton title={plotBase ? KeyMap.get(plotBase) : "Not Selected"}
color={plotBase ? "success" : "primary"}
disabled={disabled}
>
<MenuItem onClick={() => { setPlotBase("") }}>Unselect</MenuItem>
<Divider />
{statKeys.map(sKey => <MenuItem key={sKey} onClick={() => { setPlotBase(sKey as any) }}>{KeyMap.get(sKey)}</MenuItem>)}
</DropdownButton>
</Grid>
<Grid item flexGrow={1}>
<Tooltip placement="top" title="Using data from the builder, this will generate a graph to visualize Optimization Target vs. a selected stat. The graph will show the maximum Optimization Target value per 0.01 of the selected stat.">
<Info />
</Tooltip>
</Grid>
{!!downloadData && <Grid item>
<Button startIcon={showMin ? <CheckBox /> : <CheckBoxOutlineBlank />}
color={showMin ? "success" : "secondary"}
onClick={() => setshowMin(!showMin)}>Show Min Stat Threshold</Button>
</Grid>}
{!!downloadData && <Grid item>
<Button color="info" startIcon={<Download />} onClick={() => setshowDownload(!showDownload)}>Download Data</Button>
</Grid>}
</Grid>
</CardContent>
{!!displayData && <Divider />}
{chartData && !!displayData && <CardContent>
<Collapse in={!!downloadData && showDownload}>
<CardDark sx={{ mb: 2 }}>
<CardContent>
<Typography>Min Data</Typography>
<DataDisplay data={downloadData?.minimum} />
<Typography>All Data</Typography>
<DataDisplay data={downloadData?.allData} />
</CardContent>
</CardDark>
</Collapse>
<Chart displayData={displayData} plotNode={chartData.plotNode} valueNode={chartData.valueNode} showMin={showMin} />
</CardContent>}
</CardLight >
}