plouc / nivo

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries
https://nivo.rocks
MIT License
13.19k stars 1.03k forks source link

Feature request: Ability to render custom sliceLabel #62

Closed andresgutgon closed 4 years ago

andresgutgon commented 7 years ago

Hi, thanks for this amaizing project. I just started using it and I was wondering if it would be possible to add ability to change sliceLabel look & feel by passing a custom renderer.

What I want to accomplish is rounded labels like this: image

If I'm not wrong that's not possible with a <text .../>{label}</text> node. And I don't see I way of overwrite it in code https://github.com/plouc/nivo/blob/8db9a1366fc53a8d0eb9dbd53bec5573e2c04ac0/src/components/charts/pie/PieRadialLabels.js#L101

Maybe I'm missing something.

I would like to contribute and do a PR to allow this behaviour. What do you think?

Thanks again for your work

plouc commented 7 years ago

@andresgutgon, you're right, it's not feasible in SVG. In fact, the first pie implementation had this feature, but I removed it as it's not really standard and can cause issue depending on the chart / font size.

I like the idea to have the ability to define a custom component, your PR will be really welcome :)

stale[bot] commented 4 years ago

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!