Hack up brush rendering to fix possible Chrome bug (#950)

This commit is contained in:
Marshall Polaris 2022-09-28 00:58:51 -07:00 committed by GitHub
parent 8f88af4e2a
commit 925a9e850f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,13 @@ export const SVGChart = <X, Y>(props: {
justSelected.current = false
}
})
select(overlayRef.current).call(brush)
// mqp: shape-rendering null overrides the default d3-brush shape-rendering
// of `crisp-edges`, which seems to cause graphical glitches on Chrome
// (i.e. the bug where the area fill flickers white)
select(overlayRef.current)
.call(brush)
.select('.selection')
.attr('shape-rendering', 'null')
}
}, [innerW, innerH, onSelect])