GithubHelp home page GithubHelp logo

jfirebaugh / d3-bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shawnbot/d3-bootstrap

1.0 3.0 0.0 121 KB

d3-friendly versions of Twitter bootstrap JavaScript tools

Home Page: http://prag.ma/code/d3-bootstrap/

JavaScript 100.00%

d3-bootstrap's Introduction

d3-bootstrap

Twitter's Bootstrap is an awesome CSS framework with some really nice JavaScript tools. The problem with these tools, though, is that they rely heavily on jQuery, while d3 provides (approximately) 99% of the functionality they require.

At first I considered a shim for $ that would expose a more jQuery-like facade on top of d3, but that quickly got messy. Instead, I decided to start rewriting each of Bootstrap's tools from scratch and in a more d3-friendly style. For example, Bootstrap's tooltips:

$("a.tt").tooltip({
  placement: "right"
});

become:

d3.selectAll("a.tt")
  .call(d3.tooltip()
    .placement("right"));

Plugins

So far we've got:

  1. Tooltips (bootstrap)
  2. Popovers (bootstrap)
  3. Alerts (bootstrap)

Usage

There are a couple of ways to use the plugins. The easiest is to just include d3-bootstrap.js (or the minified version, d3-bootstrap.min.js). If you want individual tools you'll need:

  1. d3-compat.js (or d3-compat.min.js), which provides some baseline jQuery-like compatibility such as "mouseenter" and "mouseleave" event support; and
  2. One or more bootstrap-{tool}.js scripts, e.g. bootstrap-tooltip.js.

d3-bootstrap's People

Contributors

tmcw avatar

Stargazers

 avatar

Watchers

 avatar  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.