Skip to content

Instantly share code, notes, and snippets.

@davelandry
Last active August 22, 2016 15:24
Show Gist options
  • Save davelandry/e86deb23ec60ac884bfc to your computer and use it in GitHub Desktop.
Save davelandry/e86deb23ec60ac884bfc to your computer and use it in GitHub Desktop.
Hiding the Focus Tooltip

Visualizations that support setting a Focus Element automatically create a tooltip on the right side of the visualization for that element (if there is data to show).

To disable this tooltip from displaying, we simply set the "tooltip" parameter of .focus( ) to false.

Featured on D3plus.org

<!doctype html>
<meta charset="utf-8">
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<div id="viz"></div>
<script>
var connections = [
{"source": "alpha", "target": "beta"},
{"source": "alpha", "target": "gamma"},
{"source": "beta", "target": "delta"},
{"source": "beta", "target": "epsilon"},
{"source": "zeta", "target": "gamma"},
{"source": "theta", "target": "gamma"},
{"source": "eta", "target": "gamma"}
]
var visualization = d3plus.viz()
.container("#viz")
.type("rings")
.edges(connections)
.focus({
"tooltip" : false,
"value" : "alpha"
})
.draw()
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment