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

allow {placement: "mouse"} option for tooltip #7106

Closed
lanterndev opened this issue Feb 28, 2013 · 3 comments
Closed

allow {placement: "mouse"} option for tooltip #7106

lanterndev opened this issue Feb 28, 2013 · 3 comments

Comments

@lanterndev
Copy link

I'm making a world map visualization with d3 and attaching a bootstrap popup to each country (svg path element). The existing placement options work okay for many countries, but for many others (including the US, whose bounding box spans Hawaii and Alaska), the popup ends up nowhere near where you'd expect it, or worse, offscreen.

Check out how "Chile" appears in the middle of the South Pacific, thanks to Easter Island:

Screen Shot 2013-02-28 at 1 06 57 PM

(Screen grab hid the mouse, but it was over mainland Chile.)

Would you reconsider supporting this use case? It would be great if it was supported out of the box!

Thanks for your consideration and for the awesome work on bootstrap.

@lanterndev
Copy link
Author

http://stackoverflow.com/a/14761335/161642 can be adapted to support this in the meantime, in case it helps anyone else who finds their way here.

@mdo
Copy link
Member

mdo commented Mar 1, 2013

This was brought up before, but we won't be adding it into the core. This would be a great little add-on I think though.

@dalelotts
Copy link

@mdo OK, so it won't be going into core, and you suggest a "great little add-on" - I'm happy to contribute one because I need this functionality. Looking at the hack @Skivvies linked to it seems to me that the placement functionality is not designed to be extensible. Do you have a suggestion on the approach?

It seems to me that one approach might be to change core to allow an object or a function for placement (in addition to the existing values) - the returned object would specify the top and left value. With this approach users can implement any position functionality they need. Thoughts?

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

No branches or pull requests

3 participants