Skip to content

Instantly share code, notes, and snippets.

@mathisonian mathisonian/app.js
Created Jan 27, 2016

Embed
What would you like to do?
var aspectRatio= '16:9'
var svg = d3.select('#example-4')
.append('svg')
.attr('width', '100%')
.attr('viewBox', '0 0 ' + aspectRatio.split(':').join(' '));
// draw a rect to act as an outline
svg.append('rect')
.style('fill', 'orange')
.attr('width', '100%')
.attr('height', '100%');
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<div id="example-4" style="max-width: 800px;"></div>
<script type="text/javascript" src="./app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.