Skip to content

Instantly share code, notes, and snippets.

@micha2jm
Created April 16, 2018 18:04
Show Gist options
  • Save micha2jm/e12b08090bacf90d2864707b57fb6693 to your computer and use it in GitHub Desktop.
Save micha2jm/e12b08090bacf90d2864707b57fb6693 to your computer and use it in GitHub Desktop.
Bubble Attempt Lol
license: mit
var bubbleChart = function () {
var width = 600,
height = 400;
function chart (selection) {
// we'll come back to this
}
chart.width = function(value) {
if (!arguments.length) { return width; }
width = value;
return chart;
}
chart.height = function(value) {
if (!arguments.length) { return height; }
height = value;
return chart;
}
return chart;
}
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<script>
var chart = bubbleChart();
console.log(bubbleChart().width())
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment