GithubHelp home page GithubHelp logo

d3-bootstrap-plugins's Introduction

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:

selection.tooltip(function(d,i){
    return {        
      //The text within the tooltip
      text: d.title 
      //Where 
      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
    };
});

selection.popover(function(d,i){
    //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.

Contributing

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.

License

Major components:

Everything else:

MIT License.

d3-bootstrap-plugins's People

Contributors

marcneuwirth avatar zmaril avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.