susielu/d3-annotation

Extending Badge + CalloutCircle

Opened this issue · 4 comments

Hi Susie! First off, amazing D3 module you built out. This is absolutely great. I just had a quick question about extending the badge or CalloutCircle type to combine the features of both. I'd love to have a circle with text inside that can handle a hover/click/action to pop out additional information. Any info pointing me in the right way would be great! Also sorry if this isn't the appropriate place to ask about annotation questions, first time using Github Issues.

Hi there, how much text inside the circle do you need to be able to handle? Is it more than one character?

So the badge has a radius parameter you could use to fit the 3 character size, then you could wire it up to change to a calloutcircle on hover or on click. These are all of the actions you could add to an annotation: annotation.on() Takes the values 'subjectover', 'subjeout', 'subjectclick', 'connectorover', 'connectout', 'connectorclick', 'noteover', 'noteout', 'notecclick', 'dragend', 'dragstart' as custom dispatch events you can hook into. This block has an example: https://bl.ocks.org/susielu/63269cf8ec84497920f2b7ef1ac85039

Does that make sense?