nivo icon indicating copy to clipboard operation
nivo copied to clipboard

Support a popover like behavior for tooltips

Open OgDev-01 opened this issue 3 years ago • 18 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Currently working on a project and making use of the scatterplot chart. But discovered some limitations with the tooltip provided

  • Tooltip can't be hovered on

https://user-images.githubusercontent.com/62995161/207777072-97967a39-3b3c-4507-b978-2164cc2df77c.mov

Describe the solution you'd like A clear and concise description of what you want to happen.

A behavior similar to GitHub hovercard where we can hiver on the tooltip itself

https://user-images.githubusercontent.com/62995161/207776852-7d605c29-e78c-459f-b99f-f5a1b83e2fde.mov

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

OgDev-01 avatar Dec 15 '22 05:12 OgDev-01

Bump

bdougie avatar Mar 18 '23 05:03 bdougie

cc @plouc can this be achieved? Would be very happy to help with this if possible :smiley:

takanome-dev avatar May 01 '23 22:05 takanome-dev

I think it's more the behavior of a popover, but it's definitely possible to implement this in the lib.

However @nivo/tooltip is a core component used for all charts, and we currently assume that the tooltip disappear on mouse leave, meaning that we would need to change all charts' event handlers.

@takanome-dev, if you want to give it a try, that would be great indeed :)

plouc avatar May 01 '23 22:05 plouc

We would also need to introduce a new property to control this behavior.

plouc avatar May 01 '23 23:05 plouc

I think it's more the behavior of a popover, but it's definitely possible to implement this in the lib.

However @nivo/tooltip is a core component used for all charts, and we currently assume that the tooltip disappear on mouse leave, meaning that we would need to change all charts' event handlers.

@takanome-dev, if you want to give it a try, that would be great indeed :)

That sounds a lot :sweat_smile: Alright, I'm gonna give it a shot :+1:

We would also need to introduce a new property to control this behavior.

Can you elaborate more on that?

takanome-dev avatar May 01 '23 23:05 takanome-dev

I mean that it might not be the expected behavior, tooltip VS popover, so for retro-compatibility, this should be an opt-in IMHO.

plouc avatar May 01 '23 23:05 plouc

I think that a reasonable approach would be to start with a single chart (maybe the bar chart), before going all in and changing the numerous packages that nivo provides 😅.

plouc avatar May 01 '23 23:05 plouc

I agree with that :sweat_smile:

takanome-dev avatar May 01 '23 23:05 takanome-dev

Also using a property and keeping the current behavior by default would allow us to gradually ship this feature.

plouc avatar May 01 '23 23:05 plouc

I was having a look at the open sauced dashboard, and I understand why you want such feature 😄

plouc avatar May 01 '23 23:05 plouc

Yeah it would be pretty cool to have it 😃

takanome-dev avatar May 01 '23 23:05 takanome-dev

Seems like a nice project btw, would you mind if I add it to the references?

plouc avatar May 01 '23 23:05 plouc

Seems like a nice project btw, would you mind if I add it to the references?

That would be great 😊 Thoughts @bdougie?

takanome-dev avatar May 01 '23 23:05 takanome-dev

The references page is not that nice right now, just a list of bare links, but I plan to change that to include some screenshots, maybe something similar to https://nextjs.org/showcase or https://www.gatsbyjs.com/customers/.

plouc avatar May 01 '23 23:05 plouc

Seems like a nice project btw, would you mind if I add it to the references?

Yes, please do. Also thanks for the engaging discussion.

bdougie avatar May 01 '23 23:05 bdougie

Thank you @bdougie and @takanome-dev!

plouc avatar May 01 '23 23:05 plouc

Has this idea been abandoned? I have a similar use case

jasongerbes avatar Sep 08 '23 22:09 jasongerbes

We actually figured out a work around in this PR https://github.com/open-sauced/app/pull/1266

@OgDev-01 can probably provide more context here.

bdougie avatar Sep 09 '23 00:09 bdougie