Created
July 28, 2019 23:33
-
-
Save fabiokandrade/049b71412319486c05e847618f987d21 to your computer and use it in GitHub Desktop.
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
const viz = (margin={ top: 10, right: 20, bottom: 25, left: 25}, selection= d3.select('.viz'))=>{ | |
const width = 425 - margin.left - margin.right; | |
const height = 625 - margin.top - margin.bottom; | |
const container = selection | |
.append('svg') | |
.attr('width', width + margin.left + margin.right) | |
.attr('height', height + margin.top + margin.bottom) | |
.append('g') | |
.attr('transform', `translate(${margin.left}, ${margin.top})`); | |
return [container,margin, width, height] | |
} | |
[container,margin, width, height] = viz() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment