-
Notifications
You must be signed in to change notification settings - Fork 218
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
Easiest way to add more text below label #46
Comments
It works until the circles start moving – after that, the tspan element gets removed. It happens on some timeout – I'll try to get more information. I could always wait until the circles on done moving to render the text, but that's not preferable. |
Sometimes its nice to have some properties on how things were laid out: for instance the textCentres were needed for issue #46, and it can also be useful to have info on circles, transitions etc for later customization. Return those from the chart call, and add an example of using those to add a sublabel underneath the main label.
I added an example with transitions for this: http://benfred.github.io/venn.js/examples/sublabels.html This required making some minor changes to the library (a13bab7) so you'll need to get the latest version if you want to go this route. hope this helps =) |
Thanks! I've got the sublabels working exactly as desired now. However, is there something in the latest commit that would've changed the way hover on intersection works? Even when not including the new sublabels feature, my old hover on intersection code is not working like it was before. |
I double checked and this issue was not present in 050d9ad |
Figured it out – a simple change – https://github.com/benfred/venn.js/blob/master/src/diagram.js#L92 should read Was there a reason you made that change? The label rendering still works properly with |
sorry about that - didn't mean to check that in =( the indentation level changed, so I didn't spot it in the diff. thanks for fixing! |
Sublabels work better when you "retext" the labels on update – they refresh if the sizes have changed. For example:
|
Hi – I'd like to add some more text below each label (a little reference to the contents of each circle).
Is there a way to do this without modifying the code?
The text was updated successfully, but these errors were encountered: