Skip to content

Instantly share code, notes, and snippets.

@davidlav
Created October 27, 2016 22:48
Show Gist options
  • Save davidlav/5b4556fcac9fc5b409dbd92d35a413a9 to your computer and use it in GitHub Desktop.
Save davidlav/5b4556fcac9fc5b409dbd92d35a413a9 to your computer and use it in GitHub Desktop.
SVG Dimensions without Aurelia (does work)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>EDIS</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="place-holder" id="splash-banner"></div>
<div id="under-splash-banner">
<div class="place-holder" id="news-feed"></div>
<div id="resizable-panels">
<div id="patient-info">
<div class="place-holder" id="order-history"></div>
<div class="place-holder" id="health-status"></div>
<div class="place-holder" id="to-do"></div>
</div>
<div id="timeline">
<svg id="timeline-svg"></svg>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment.js"></script>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script>
const w = parseInt(d3.select('#timeline-svg').style('width'), 10);
const h = parseInt(d3.select('#timeline-svg').style('height'), 10);
document.getElementById('news-feed').innerHTML = "Empty SVG dimensions are: " + w + " x " + h + "<br>These numbers are accurate despite the SVG being empty. Resize, rerun, and they'll change.";
</script>
</body>
</html>
@import 'https://fonts.googleapis.com/css?family=Roboto';
@import 'https://fonts.googleapis.com/css?family=Open+Sans';
/* line 4, D:/Webstorm Projects/EDIS/css/style.sass */
html {
box-sizing: border-box;
}
/* line 7, D:/Webstorm Projects/EDIS/css/style.sass */
*, *::before, *::after {
box-sizing: inherit;
}
/* line 10, D:/Webstorm Projects/EDIS/css/style.sass */
body {
display: flex;
flex-direction: column;
margin: 0;
height: 100vh;
font-family: 'Roboto', 'Open Sans', sans-serif;
text-align: center;
}
/* line 17, D:/Webstorm Projects/EDIS/css/style.sass */
.place-holder {
display: flex;
font-size: 18pt;
justify-content: center;
align-items: center;
}
/* line 23, D:/Webstorm Projects/EDIS/css/style.sass */
#splash-banner {
height: 100px;
background-color: rgba(255, 0, 0, 0.2);
}
/* line 27, D:/Webstorm Projects/EDIS/css/style.sass */
#under-splash-banner {
display: flex;
flex-direction: row-reverse;
flex: 1;
width: 100vw;
}
/* line 33, D:/Webstorm Projects/EDIS/css/style.sass */
#news-feed {
width: 400px;
background-color: rgba(0, 255, 0, 0.2);
}
/* line 37, D:/Webstorm Projects/EDIS/css/style.sass */
#resizable-panels {
display: flex;
flex-direction: column;
width: 100%;
}
/* line 42, D:/Webstorm Projects/EDIS/css/style.sass */
#patient-info {
display: flex;
flex: 1;
}
/* line 46, D:/Webstorm Projects/EDIS/css/style.sass */
#order-history {
flex: 1;
background-color: rgba(0, 0, 255, 0.1);
}
/* line 50, D:/Webstorm Projects/EDIS/css/style.sass */
#health-status {
flex: 1;
background-color: rgba(0, 0, 255, 0.2);
}
/* line 54, D:/Webstorm Projects/EDIS/css/style.sass */
#to-do {
flex: 1;
background-color: rgba(0, 0, 255, 0.3);
}
/* line 58, D:/Webstorm Projects/EDIS/css/style.sass */
#timeline {
display: flex;
flex: 1;
}
/* line 63, D:/Webstorm Projects/EDIS/css/style.sass */
#timeline-svg {
flex: 1;
border: 1px solid gray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment