react-vis icon indicating copy to clipboard operation
react-vis copied to clipboard

Fix LineMarkSeries blocking pointer events on other LineMarkSeries

Open samulisuomi opened this issue 6 years ago • 7 comments

Fixes https://github.com/uber/react-vis/issues/1004 (and probably https://github.com/uber/react-vis/issues/1099#issuecomment-463553067).

Issue

Having multiple LineMarkSeries overlapping in a single plot may result in some of the marks not firing the onValueMouseOver callback.

This is because the LineMarkSeries draws an invisible area with the <plot> that is blocking pointer events on marks rendered behind it. I've set lineStyle={{ fill: "#80808080" }} in my codesandboxes to highlight this otherwise invisible area.

Before

https://codesandbox.io/s/43q7xyq3vw

before

After

https://codesandbox.io/s/xp3w5kly1p

after

samulisuomi avatar Apr 10 '19 12:04 samulisuomi

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 10 '19 12:04 CLAassistant

Now that I thought about this more, shouldn't this bug also appear when using just LineSeries? I'm not sure how to fix the issue in that case. For LineMarkSeries, fixing the issue this way seems like a reasonable approach for now but let me know if you have other ideas.

samulisuomi avatar Apr 10 '19 14:04 samulisuomi

This should fix #1157 as well

bmaupin avatar Jun 27 '19 18:06 bmaupin

Will this Pull Request get merged anytime soon?

danchyy avatar Feb 11 '21 15:02 danchyy

Will this Pull Request get merged anytime soon?

My guess is the answer is no. This repository appears to be unmaintained as per https://github.com/uber/react-vis/issues/1303

Thankfully the workaround is pretty straightforward: https://github.com/uber/react-vis/issues/1004#issuecomment-481666020

bmaupin avatar Feb 11 '21 16:02 bmaupin

Thanks for reply @bmaupin . Could you help me out just a bit more please, should that CSS you mentioned in #1004 be assigned to style variable of LineMarkSeries?

Like this?

<LineMarkSeries
   data={[...]}
   style={{
         lineStyle: {
              pointerEvents: 'none'
         }
   }}/>

danchyy avatar Feb 11 '21 16:02 danchyy

Thanks for reply @bmaupin . Could you help me out just a bit more please, should that CSS you mentioned in #1004 be assigned to style variable of LineMarkSeries?

Like this?

<LineMarkSeries
   data={[...]}
   style={{
         lineStyle: {
              pointerEvents: 'none'
         }
   }}/>

You probably figured it out already, but for any future readers of this issue:

lineStyle is a property of LineMarkSeries (and probably LineSeries) though it doesn't seem to be in the documentation.

<LineMarkSeries
   data={[...]}
   lineStyle: {
       pointerEvents: 'none'
   }
 />

There's also a markStyle property you can set, if needed.

Hivemind9000 avatar Apr 15 '21 02:04 Hivemind9000