t-viSNE: Interactive Assessment and Interpretation of t-SNE Projections https://doi.org/10.1109/TVCG.2020.2986996
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
t-viSNE/modules/d3-tip/docs/initializing-tooltips.md

28 lines
648 B

6 years ago
[API Documentation](index.md) ➤ Initializing tooltips
# Initializing tooltips
### d3.tip
Create and return a [configurable function](http://bost.ocks.org/mike/chart) for
a tooltip.
You ***must*** call the tip on the context of the target visualization.
``` javascript
var tip = d3.tip()
.attr('class', 'd3-tip')
.html(function(d) { return d; })
var vis = d3.select(document.body)
.append('svg')
// REQUIRED: Call the tooltip on the context of the visualization
.call(tip)
vis.append('rect')
.attr('width', 100)
.attr('height', 100)
// Show and hide the tooltip
.on('mouseover', tip.show)
.on('mouseout', tip.hide)
```