Skip to content

tcp/d3-tip

This branch is up to date with cgav/d3-tip:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Constantin Gavrilete
Sep 9, 2016
900e44b · Sep 9, 2016
Mar 28, 2014
Jul 4, 2016
Jul 4, 2016
Jul 4, 2016
Jul 4, 2016
Jul 4, 2016
Feb 2, 2014
Jul 4, 2016
Sep 9, 2016
Jul 4, 2016
Jul 4, 2016

Repository files navigation

d3.tip: Tooltips for d3.js visualizations

API Docs

See the API Documentation

Download Latest Version

Install with Bower

bower install d3-tip

Quick Usage

/* Initialize tooltip */
tip = d3.tip().attr('class', 'd3-tip').html(function(d) { return d; });

/* Invoke the tip in the context of your visualization */
vis.call(tip)

vis.selectAll('rect')
  .data(data)
.enter().append('rect')
  .attr('width', function() { return x.rangeBand() })
  .attr('height', function(d) { return h - y(d) })
  .attr('y', function(d) { return y(d) })
  .attr('x', function(d, i) { return x(i) })
  .on('mouseover', tip.show)
  .on('mouseout', tip.hide)

If you want basic styling, you can include example-styles.css using a service like rawgithub.com.

<link rel="stylesheet" href="//rawgithub.com/Caged/d3-tip/master/examples/example-styles.css">

Packages

No packages published

Languages

  • JavaScript 100.0%