Skip to content

Instantly share code, notes, and snippets.

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

What would you like to do?
var aspectRatio= '16:9'
var svg ='#example-4')
.attr('width', '100%')
.attr('viewBox', '0 0 ' + aspectRatio.split(':').join(' '));
// draw a rect to act as an outline
.style('fill', 'orange')
.attr('width', '100%')
.attr('height', '100%');
<!DOCTYPE html>
<meta charset="utf-8">
<script type="text/javascript" src=""></script>
<div id="example-4" style="max-width: 800px;"></div>
<script type="text/javascript" src="./app.js"></script>
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.