Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VictoryLegend items should support an Element to allow for custom icons. #2892

Open
2 tasks done
zlayne opened this issue Sep 4, 2024 · 3 comments · May be fixed by #2900
Open
2 tasks done

VictoryLegend items should support an Element to allow for custom icons. #2892

zlayne opened this issue Sep 4, 2024 · 3 comments · May be fixed by #2900
Assignees
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release

Comments

@zlayne
Copy link

zlayne commented Sep 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Feature Request

Currently, the VictoryLegend only supports a string. Including a custom icon/symbol as part of the legend data would be useful. 

ex:
data={[
    { name: "One", symbol: <CUSTOM_ICON> },
  ]}
@zlayne zlayne added the Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release label Sep 4, 2024
@carbonrobot carbonrobot added the Issue: Accepted The submitted issue has been confirmed by the Victory core team label Sep 4, 2024
@carbonrobot
Copy link
Contributor

@zlayne Are you looking for support for an SVG, or an image type like PNG?

@zlayne
Copy link
Author

zlayne commented Sep 4, 2024

Ideally I would be looking for an svg / ReactElement, but I am open to suggestions if there is a better approach for the context of your Legend component.

@carbonrobot
Copy link
Contributor

The Legend itself is an SVG, so embedding a child SVG inside is perfectly valid, we just need to alter the API to allow it. ReactElement would not work though, since that can't be embedded into an SVG element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Accepted The submitted issue has been confirmed by the Victory core team Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants