nivo icon indicating copy to clipboard operation
nivo copied to clipboard

Feature (or example) request: Brush

Open jfsiii opened this issue 8 years ago • 46 comments

This is a common, but often challenging, interaction. It'd be great to see how it should work in nivo.

jfsiii avatar Aug 22 '17 22:08 jfsiii

I created a simple line chart with a brush using nivo components. I didn't create a pull request since I had to do some hacked actions to make it work.

  1. I had to add a new child component called Brush inside the Line component.
  2. I added three new props to the Line component that are then passed to the Brush component. Two to set the initial Brush position, and a callback to call onBrush.
  3. I had to modify the SvgWrappercomponent to provide a handler to each children, that gives them access to a ref of the parent svg component. I needed this ref to convert mouse coordinates to svg coordinates.

Do you approve of these API modification, or would you do things differently. I can generate a pull request from your comments if you want.

guzmonne avatar Jan 22 '18 21:01 guzmonne

@guzmonne this is great. Your description and examples of 'hacked actions' to make this work are helpful for understanding how to customize or enhance Nivo.

Here's what I was thinking of doing with a stacked bar chart. I've seen this before with D3 but wasn't sure how to bring it to Nivo:

capture d ecran 2018-02-18 a 20 47 48

stahlmanDesign avatar Feb 19 '18 01:02 stahlmanDesign

I believe you could accomplish it with nivo by extending the Bar components to handle child components, or hacking it like I did with the Line component.

I published a medium article explaining how I did it, and the shortcomings of my method.

guzmonne avatar Feb 19 '18 03:02 guzmonne

Great work @guzmonne! I've just noticed this issue while I was exposition such feature in a 'zoom' related issue. I'm thinking about the same "generic" kinda brush feature that would simply return the range (start/end) of the selected data to be able to do whatever you want with it such as this sample from highcharts: https://www.highcharts.com/demo/line-time-series

Having a generic simple capability to select an area by dragging dropping the mouse to act on it is a top feature.

MarcMagnin avatar Sep 13 '18 19:09 MarcMagnin

@guzmonne this is great. Your description and examples of 'hacked actions' to make this work are helpful for understanding how to customize or enhance Nivo.

Here's what I was thinking of doing with a stacked bar chart. I've seen this before with D3 but wasn't sure how to bring it to Nivo:

capture d ecran 2018-02-18 a 20 47 48

can I get your code for bar chart with nivo-brush-zoom its too urgent for me please

ghost avatar Jan 03 '20 10:01 ghost

@stahlmanDesign please share your code for bar charts nivo-brush-zoom. please its too urgent

ghost avatar Jan 03 '20 10:01 ghost

Sorry, I never moved forward with this so I don't have a working solution. I am still interested if someone is able to make it work.

stahlmanDesign avatar Jan 03 '20 15:01 stahlmanDesign

Hello sir, I am working on it. I will let you know when it is done.

Thanks satyam kumar

On Fri, 3 Jan 2020, 21:17 Justin Stahlman, [email protected] wrote:

Sorry, I never moved forward with this so I don't have a working solution. I am still interested if someone is able to make it work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/plouc/nivo/issues/32?email_source=notifications&email_token=ALQWK4J24N5SQGF5YERJFZTQ35MXNA5CNFSM4DX5B5F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIBNEOY#issuecomment-570610235, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALQWK4OOTEJDHVYHT66GKP3Q35MXNANCNFSM4DX5B5FQ .

ghost avatar Jan 03 '20 17:01 ghost

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Oct 29 '20 17:10 stale[bot]

This feature would be very useful. Please prioritize when possible. Thank you!

sattuchin avatar Nov 03 '20 11:11 sattuchin

I agree, this is needed

wolasss avatar Dec 29 '20 20:12 wolasss

bump

RafaelZamoraBallerTV avatar Feb 03 '21 17:02 RafaelZamoraBallerTV

Bump

asherccohen avatar Feb 24 '21 19:02 asherccohen

bump

Ynng avatar Mar 04 '21 14:03 Ynng

bump

nico-hernandez avatar Mar 29 '21 04:03 nico-hernandez

bump

shockhs avatar Apr 05 '21 10:04 shockhs

Can someone explain how to do this with the responsive heat map.

swest06 avatar Apr 09 '21 09:04 swest06

Very essential features for mobile viewing support. Bump.

yuqian5 avatar Apr 30 '21 08:04 yuqian5

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Jul 29 '21 08:07 stale[bot]

bump

kbzowski avatar Jul 29 '21 09:07 kbzowski

bump

lm93547 avatar Sep 28 '21 08:09 lm93547

bump

AmalRichwin-AT avatar Oct 27 '21 07:10 AmalRichwin-AT

bump

Kvodnon avatar Oct 29 '21 05:10 Kvodnon

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Jan 27 '22 07:01 stale[bot]

bump

wolasss avatar Jan 28 '22 14:01 wolasss

Bump

natBizitza avatar Apr 25 '22 07:04 natBizitza

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Jul 30 '22 17:07 stale[bot]

bump

wolasss avatar Jul 30 '22 22:07 wolasss

bump

JavaScriptJohn avatar Sep 20 '22 10:09 JavaScriptJohn

bump

umble avatar Sep 28 '22 05:09 umble