Skip to content

Commit

Permalink
0-100 in binary all (#3163)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingawei authored Nov 25, 2024
1 parent 2672512 commit f51e657
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion web/components/charts/contract/binary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,18 @@ const getVisibleYRange = (params: {
}) => {
const { data, zoomY, start, end, zoomParams } = params

if (!zoomY) return [0, 1]
if (!zoomY || !zoomParams?.xScale) return [0, 1]

const [minXDate, maxXDate] = zoomParams?.viewXScale.domain() ?? [null, null]
const [fullMin, fullMax] = zoomParams.xScale.domain()

if (
minXDate.getTime() === fullMin.getTime() &&
maxXDate.getTime() === fullMax.getTime()
) {
return [0, 1]
}

const minX = minXDate ? minXDate.getTime() : start
const maxX = maxXDate ? maxXDate.getTime() : end

Expand Down

0 comments on commit f51e657

Please sign in to comment.