Porting some of bootstrap's plugins over to d3
JavaScript CoffeeScript CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


d3.js meets bootstrap

js/css duo for bootstrap style tooltips and popovers.

How does it work?

The tooltip function attaches event listeners to selections that go and display bootstrap tooltips or popovers when the specified events are detected.

An example of how to use it:

    return {        
      //The text within the tooltip
      text: d.title 
      placement: "fixed" 
      // Base positioning. Not used when placement is "mouse"
      position: [d.x,d.y]
      //How far the tooltip is shifted from the base
      displacement: [0,20] //Shifting parts of the graph over.           
      //If "mouse"" is the base poistion, then mousemove true allows
      //the tooltip to move with the mouse
      mousemove: false

    //TODO: add in a svg element here based on data
    return {        
      // The title that will be displayed on the popover
      title: "A title" 
      //A d3 svg element
      content: svg 
      placement: "fixed"
      gravity: "right" 
      position: [d.x,d.y]
      displacement: [0,20]            
      mousemove: false

Viola! Tooltips! Popovers!

Current TODOS

  • Get easy voronoi detection working without breaking everything. Checkout the voronoi branch for current work on this.
  • Bring over the less files from bootstrap directly instead of replying on their css.
  • Write some tests.
  • Use it in production.


Local development uses grunt (npm install grunt)

grunt watch- automatically compile the files as you change the src directory

grunt build- goes through concatenation and minification of js and css.

If you are adding new features, please create an example that demonstrates that feature specifically.


Major components:

Everything else:

MIT License.