From d0525c0c1cb698da4a418e376f9868f21afc4215 Mon Sep 17 00:00:00 2001 From: dapplion Date: Sun, 11 Aug 2019 19:21:43 +0200 Subject: [PATCH] Fine tune chart appearance --- src/PriceSimulationChart.tsx | 30 ++++++++++++++++++++---------- src/SupplyVsDemandChart.tsx | 6 +++++- src/parametersDescriptions.ts | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/PriceSimulationChart.tsx b/src/PriceSimulationChart.tsx index c043bb7..eb5e900 100644 --- a/src/PriceSimulationChart.tsx +++ b/src/PriceSimulationChart.tsx @@ -19,6 +19,12 @@ const keyVerticalLeft = "Price (DAI/token)"; const keyVerticalLeft2 = "Floor price (DAI/token)"; const keyVerticalRight = "Total funds raised (DAI)"; +// Do to transparency and color merging issues +// these colors are handpicked to look the closest to the theme colors +const yLeftColor = "#53c388"; +const yRightColor = "#4090d9"; +const referenceLineColor = "#b7c1cb"; + const useStyles = makeStyles((theme: Theme) => createStyles({ tooltip: { @@ -66,7 +72,7 @@ function PriceSimulationChart({ * Keep the animation active only during the initial animation time, * but afterwards, deactivate to prevent the re-size ugly effect */ - const [isAnimationActive, setIsAnimationActive] = useState(true); + const [isAnimationActive, setIsAnimationActive] = useState(false); useEffect(() => { const timeout = setTimeout(() => { setIsAnimationActive(false); @@ -88,12 +94,12 @@ function PriceSimulationChart({ const formatter = (n: number) => (+n.toPrecision(3)).toLocaleString(); function ReferenceLabel(props: any) { - const { textAnchor, viewBox, text } = props; + const { textAnchor, viewBox, text, fill } = props; return ( {text} @@ -149,7 +155,11 @@ function PriceSimulationChart({ bottom: 0 }} > - + {/* Capital collected from withdraw fees - AXIS */} @@ -180,9 +190,9 @@ function PriceSimulationChart({ +(totalFundsMax + totalFundsRange).toPrecision(2) ]} orientation="right" - tick={{ fill: theme.palette.text.secondary }} tickFormatter={formatter} - stroke={theme.palette.text.secondary} + tick={{ fill: yRightColor }} + stroke={yRightColor} /> } /> @@ -214,14 +224,14 @@ function PriceSimulationChart({ y={p0} yAxisId="left" stroke={theme.palette.primary.main} - strokeDasharray="9 0" + // strokeDasharray="9 0" label={} /> } /> diff --git a/src/SupplyVsDemandChart.tsx b/src/SupplyVsDemandChart.tsx index d64b846..1e00f92 100644 --- a/src/SupplyVsDemandChart.tsx +++ b/src/SupplyVsDemandChart.tsx @@ -162,7 +162,11 @@ function SupplyVsDemandChart({ bottom: 0 }} > - +