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

make node text a link #183

Open
iliasaz opened this issue Aug 14, 2021 · 2 comments
Open

make node text a link #183

iliasaz opened this issue Aug 14, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@iliasaz
Copy link

iliasaz commented Aug 14, 2021

I have a requirement to navigate to another page when a user clicks on a particular node text (not the frame itself). I tried embedding an tag in the data element itself, but it comes out as text/html, no rendered. Is there a function I could use to inject html rendering of the node text? Will it be clickable?

Thanks!

@spiermar
Copy link
Owner

Hey @iliasaz
Setting the node text to something other than pure text is not an option right now, and I cant see a simple workaround. What probably needs to be done is to change the node creation call to include an SVG <a> before the text name. See https://github.com/spiermar/d3-flame-graph/blob/master/src/flamegraph.js#L346.

This would require a custom build right now, since there's no option to change the default behavior. Something in the lines of the setDetailsHandler option. See https://github.com/spiermar/d3-flame-graph/blob/master/src/flamegraph.js#L791.

If you're interested in implementing this and opening a PR, I'm happy to merge it. Should be a matter of replacing the .text call with a function that can be overridden.

@spiermar
Copy link
Owner

Related to #94.

@spiermar spiermar changed the title How to make node text a link make node text a link Oct 12, 2021
@spiermar spiermar added enhancement New feature or request and removed feature-request labels Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants