diff --git a/package-lock.json b/package-lock.json index 82e3eefc..dc6d747c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@visx/axis": "^3.10.1", "@visx/curve": "^3.3.0", "@visx/event": "^3.3.0", + "@visx/gradient": "^3.3.0", "@visx/grid": "^3.5.0", "@visx/group": "^3.3.0", "@visx/hierarchy": "^3.3.0", @@ -4621,6 +4622,18 @@ "@visx/point": "3.3.0" } }, + "node_modules/@visx/gradient": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@visx/gradient/-/gradient-3.3.0.tgz", + "integrity": "sha512-t3vqukahDQsJ64/fcm85woFm2XPpSPMBz92gFvaY4J8EJY3e6rFOg382v5Dm17fgNsLRKJA0Vqo7mUtDe2pWOw==", + "dependencies": { + "@types/react": "*", + "prop-types": "^15.5.7" + }, + "peerDependencies": { + "react": "^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0" + } + }, "node_modules/@visx/grid": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@visx/grid/-/grid-3.5.0.tgz", diff --git a/package.json b/package.json index 6691d892..fc54de85 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@visx/axis": "^3.10.1", "@visx/curve": "^3.3.0", "@visx/event": "^3.3.0", + "@visx/gradient": "^3.3.0", "@visx/grid": "^3.5.0", "@visx/group": "^3.3.0", "@visx/hierarchy": "^3.3.0", diff --git a/src/avs/charts/OperatorsTabLineChart.jsx b/src/avs/charts/OperatorsTabLineChart.jsx index 9ec6ee98..83341e5b 100644 --- a/src/avs/charts/OperatorsTabLineChart.jsx +++ b/src/avs/charts/OperatorsTabLineChart.jsx @@ -1,5 +1,5 @@ +import { AreaClosed, Circle, LinePath } from '@visx/shape'; import { AxisBottom, AxisRight } from '@visx/axis'; -import { Circle, LinePath } from '@visx/shape'; import { getGrowthPercentage, reduceState } from '../../shared/helpers'; import { scaleLinear, scaleUtc } from '@visx/scale'; import { Tab, Tabs } from '@nextui-org/react'; @@ -10,6 +10,7 @@ import { curveMonotoneX } from '@visx/curve'; import { formatNumber } from '../../shared/formatters'; import { GridRows } from '@visx/grid'; import { Group } from '@visx/group'; +import { LinearGradient } from '@visx/gradient'; import { localPoint } from '@visx/event'; import { tabs } from '../../shared/slots'; import { useMutativeReducer } from 'use-mutative'; @@ -163,6 +164,13 @@ export default function OperatorsTabLineChart({ points, height, width }) { ref={containerRef} width={width} > + + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + yScale={scaleValue} + /> + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + /> - scaleDate(getDate(d)) ?? 0} - y={d => scaleValue(getValue(d)) ?? 0} - /> - {tooltipOpen && ( + + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + yScale={scaleValue} + /> + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + /> - scaleDate(getDate(d)) ?? 0} - y={d => scaleValue(getValue(d)) ?? 0} - /> - {tooltipOpen && ( + + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + yScale={scaleValue} + /> + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + /> - scaleDate(getDate(d)) ?? 0} - y={d => scaleValue(getValue(d)) ?? 0} - /> {tooltipOpen && ( + + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + yScale={scaleValue} + /> + scaleDate(getDate(d)) ?? 0} + y={d => scaleValue(getValue(d)) ?? 0} + /> - scaleDate(getDate(d)) ?? 0} - y={d => scaleValue(getValue(d)) ?? 0} - /> - {tooltipOpen && (