Skip to content

Commit 1aca48e

Browse files
authored
build: declare d3-curve-circlecorners types (#4288)
1 parent 95f4e53 commit 1aca48e

File tree

3 files changed

+6
-149
lines changed

3 files changed

+6
-149
lines changed

src/components/Charts/PriceChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { GlyphCircle } from '@visx/glyph'
44
import { Group } from '@visx/group'
55
import { Line, LinePath } from '@visx/shape'
66
import { bisect, scaleLinear } from 'd3'
7+
import { radius } from 'd3-curve-circlecorners'
78
import useTheme from 'hooks/useTheme'
89
import { useCallback, useState } from 'react'
910
import { ArrowDownRight, ArrowUpRight } from 'react-feather'
1011
import styled from 'styled-components/macro'
1112

12-
import circleCorners from './circleCorners'
1313
import data from './data.json'
1414

1515
type PricePoint = { value: number; timestamp: number }
@@ -138,7 +138,7 @@ export function PriceChart({ width, height }: PriceChartProps) {
138138
)}
139139
<Group top={margin.top}>
140140
<LinePath
141-
curve={circleCorners.radius(1)}
141+
curve={radius(1)}
142142
stroke={theme.accentActive}
143143
strokeWidth={2}
144144
data={data.priceHistory}

src/components/Charts/circleCorners.js

Lines changed: 0 additions & 147 deletions
This file was deleted.

src/react-app-env.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ declare module 'multihashes' {
2727
declare function decode(buff: Uint8Array): { code: number; name: string; length: number; digest: Uint8Array }
2828
declare function toB58String(hash: Uint8Array): string
2929
}
30+
31+
declare module 'd3-curve-circlecorners' {
32+
declare function radius(r: number): d3.CurveFactory
33+
}

0 commit comments

Comments
 (0)