nivo
nivo copied to clipboard
Allow custom legendNode for markers
Allow legendNode
props on markers for finer control over legend.
Usecases :
- Display other content than text (image, shape…)
- Create tooltips to display additional information, when a lot of markers are rendered and remaining place is low
Usage :
...
markers={[{
axis: "x",
lineStyle: {
stroke: "lightblue",
strokeWidth: 5
},
legendPosition: "top",
legendNode: <foreignObject x={0} y={0} width={32} height={32}>
<FontAwesomeIcon icon={faRocket} />
</foreignObject>,
}]}
Expected result :
Codechanges :
Two lines changed to bypass legendNode creation with legend text. Doesn't break any existing functionality, and seams easy to maintain across updates.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
nivo | ❌ Failed (Inspect) | Sep 20, 2023 3:06pm |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 16ecb26baaf8dfbce301ae43e7ff4b4beb79c413:
Sandbox | Source |
---|---|
nivo | Configuration |
@plouc Can I do something to help this PR be merged ?
lets aprovve this PR @plouc !
Up'ing this, how can I help?
@Bigood, sorry for the late reply, the PR needs to be rebased, I think it would be good to add a test for it as well, maybe not in the core though, it's probably better to test this on a chart supporting markers.