-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from RealWagmi/feature/density-chart
feat: density chart
- Loading branch information
Showing
13 changed files
with
386 additions
and
273 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 was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
src/components/Charts/Density/components/CustomTooltip/index.tsx
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
src/components/Charts/Density/components/CustomTooltip/styles.ts
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/components/Charts/Density/components/CustomTooltip/types.ts
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/components/Charts/Density/components/CustomTooltip/utils/formatNumber.ts
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export const DEFAULT_SURROUNDING_TICKS = 300; | ||
export const INITIAL_TICKS_TO_FETCH = 200; | ||
export const ZOOM_INTERVAL = 20; | ||
|
||
export const maxUint128 = 2n ** 128n - 1n; |
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,28 @@ | ||
import ReactEcharts from 'echarts-for-react'; | ||
import { MutableRefObject, useCallback, useEffect, useMemo, useRef } from 'react'; | ||
|
||
interface IUseChartResize { | ||
chartRef: MutableRefObject<ReactEcharts | null>; | ||
} | ||
|
||
export const useChartResize = (): IUseChartResize => { | ||
const chartRef = useRef<ReactEcharts>(null); | ||
|
||
const resizeHandler = useCallback((): void => { | ||
const echartsInstance = chartRef.current?.getEchartsInstance(); | ||
echartsInstance && echartsInstance.resize(); | ||
}, [chartRef]); | ||
|
||
useEffect(() => { | ||
window.addEventListener('resize', resizeHandler); | ||
return (): void => { | ||
window.removeEventListener('resize', resizeHandler); | ||
}; | ||
}, [resizeHandler]); | ||
|
||
return useMemo((): IUseChartResize => { | ||
return { | ||
chartRef, | ||
}; | ||
}, []); | ||
}; |
Oops, something went wrong.