{% load chartwerk_tags %}
<!DOCTYPE html>
<html>
<head>
{% spaceless %}
<meta charset="UTF-8">
<title>Chartwerk {{werk.slug}}</title>

<!-- CSS reset -->
<style>
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}progress,sub,sup{vertical-align:baseline}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{padding:.35em .75em .625em}legend{color:inherit;display:table;max-width:100%;white-space:normal}textarea{overflow:auto}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}[hidden],template{display:none}
/*Clearfixes to help pym.js set correct height*/
body::before, body::after{content:" ";display:table;}body > div:after{content:"";display:table;clear:both;}
</style>

  <!-- Dependency styles -->
{%for style in werk.dependencies.styles%}
  {%if style.inject%}
<style>{{style.script|safe}}</style>
  {%else%}
<link rel="stylesheet" type="text/css" href="{{style.url}}" />
  {%endif%}
{%endfor%}

<!-- Client rendering styles (legends, annotations) -->
<style>{{werk.client.styles|safe}}</style>

<!-- Chart styles -->
<style>{{werk.scripts.styles|safe}}</style>

<!-- JQUERY needed for client rendering scripts. -->
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<!-- Pym.js for setting height of parent page -->
<script type="text/javascript" src="https://pym.nprapps.org/pym.v1.min.js"></script>

{% block head_block %}{% endblock %}

{% endspaceless %}
</head>
<body>
{% spaceless %}
<div>
  <div id="chartwerk">
    {{werk.scripts.html|safe}}
  </div>
</div>
<!-- Dependency scripts -->
{%for script in werk.dependencies.scripts%}
<script type="text/javascript" src="{{script.url}}"></script>
{%endfor%}

<script type="text/javascript">
{% autoescape off %}
// Werk object
var chartwerk = {{werk.data|jsonify}};
// Helper script
{{werk.scripts.helper}}
// Draw script
{{werk.scripts.draw}}
// Renderer
{{werk.client.scripts}}
// Pym
var pymChild = new pym.Child({ polling: 500 });
{% endautoescape %}
</script>
{% endspaceless %}

{% block body_block %}{% endblock %}
</body>
</html>
