-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Block issuance rate graph in Mana Calculator (#1318)
* feat: Flexible network selector in the mana calculator * feat: Improved user flow for the Mana calculator * typo * chore: Refactor the Mana Calculator * ✨ * clean up * clean up * feat: Add user total holding input * feat: Mana accumulation graph * feat: Block issuance rate graph * clean up * network params * clean up * clean up * fmt * prettify * typo * fix * fix * fix * improve graph * tweak * enhancement * Update src/components/ManaCalculator/hooks/useManaState.ts Co-authored-by: Dr-Electron <[email protected]> * Update src/components/ManaCalculator/hooks/useManaState.ts Co-authored-by: Dr-Electron <[email protected]> * fmt * clean up * fmt --------- Co-authored-by: Begoña Alvarez <[email protected]> Co-authored-by: Dr-Electron <[email protected]>
- Loading branch information
1 parent
67c2d3b
commit b0f1dc7
Showing
5 changed files
with
84 additions
and
17 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/components/ManaCalculator/components/BlocksAllowance.tsx
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,51 @@ | ||
import React from 'react'; | ||
import { | ||
Area, | ||
AreaChart, | ||
CartesianGrid, | ||
ResponsiveContainer, | ||
Tooltip, | ||
XAxis, | ||
YAxis, | ||
} from 'recharts'; | ||
import { EpochReward } from '../types'; | ||
|
||
export function BlocksAllowance({ results }: { results: EpochReward[] }) { | ||
return ( | ||
<div className='table'> | ||
<br /> | ||
<h3>Blocks Allowance</h3> | ||
<ResponsiveContainer width='100%' height={250}> | ||
<AreaChart data={results}> | ||
<defs> | ||
<linearGradient id='totalTps' x1='0' y1='0' x2='0' y2='1'> | ||
<stop offset='5%' stopColor='#7caae6' stopOpacity={0.8} /> | ||
<stop offset='95%' stopColor='#7caae6' stopOpacity={0} /> | ||
</linearGradient> | ||
</defs> | ||
<XAxis | ||
dataKey='epoch' | ||
height={50} | ||
label={{ value: 'Epochs', position: 'insideBottom' }} | ||
/> | ||
<YAxis | ||
width={100} | ||
label={{ value: 'Blocks', angle: -90, position: 'insideLeft' }} | ||
/> | ||
<CartesianGrid | ||
strokeDasharray='3 3' | ||
stroke='rgb(255, 255, 255, 0.15)' | ||
/> | ||
<Tooltip /> | ||
<Area | ||
type='monotone' | ||
dataKey='totalTps' | ||
stroke='#7caae6' | ||
fillOpacity={1} | ||
fill='url(#totalTps)' | ||
/> | ||
</AreaChart> | ||
</ResponsiveContainer> | ||
</div> | ||
); | ||
} |
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