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

How to color the bubble using different colors? #455

Open
xieduo7 opened this issue Mar 12, 2024 · 3 comments
Open

How to color the bubble using different colors? #455

xieduo7 opened this issue Mar 12, 2024 · 3 comments
Assignees
Labels

Comments

@xieduo7
Copy link

xieduo7 commented Mar 12, 2024

In this example you change the size of the bubble based on the number of copies. But if I have different types of tips and I want to colour them with different colours. How can I do it? Use bubble-styler?

@stevenweaver
Copy link
Member

Dear @xieduo7,

You should be able to use bubble-styler but for some reason the configurable option isn't being called in our Observable notebook when it is defined. I'm going to keep this issue open while I track down what is happening.

Best,
Steven

@stevenweaver stevenweaver self-assigned this Mar 12, 2024
@xieduo7
Copy link
Author

xieduo7 commented Mar 12, 2024

Dear @stevenweaver ,

Thank you for the update on the bubble-styler issue. phylotree.js is a really good tool!

Best,
Duo

@rafEmweb
Copy link

bubble-styler is not like node-styler in that it does not have the element parameter. It can only really be used to return a size, it seems. A simple workaround is to enable render option draw-size-bubbles and then use the node-styler:

'draw-size-bubbles': true,
'node-styler': function(element, node) {
  element.selectAll('circle').style('fill', color);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants