Created
December 20, 2016 04:34
-
-
Save NPashaP/9c37330f52028645e7a13d3d812a1a42 to your computer and use it in GitHub Desktop.
lg - size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
rect{ | |
fill:#3F51B5; | |
stroke:black; | |
} | |
</style> | |
<body> | |
<svg width="960" height="500"> | |
<g id="g1" transform="translate(200, 50)"></g> | |
<g id="g2" transform="translate(600, 50)"></g> | |
</svg> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="http://vizjs.org/viz.v1.1.8.min.js"></script> | |
<script> | |
var browsers = [ | |
'Chrome','Edge','Netscape','Firefox' | |
,'Safari','Vivaldi','Opera','Dooble' | |
]; | |
//default | |
var lg = viz.lg().data(browsers); | |
d3.select("#g1").call(lg); | |
//custom | |
var lg = viz.lg().data(browsers).size(50); | |
d3.select("#g2").call(lg); | |
// adjust the bl.ocks frame dimension. Not part of example. | |
d3.select(self.frameElement).style("height", "500px").style("width", "960px"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment