{{ define "page" }}
	{{ $version := .VERSION }}
	<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/{{ .CONFIG.THEME }}/datapoints.css">
	<script src="/js/{{ .VERSION }}/lib/plotly-2.32.0.min.js" charset="utf-8"></script>

	{{ block "page_label" . }}{{end}}

	{{ if eq .Data.Display "list" }}
	<div id="values">
		{{ range .Data.Values }}
		<div class="value">{{ format_time .Ts }}</div>
		<div class="value">{{ .Value }}</div>
		{{ end }}
	</div>
	{{ else }}
	<div class="graph" id="tester"></div>
	<script type="text/javascript">
		const tester = document.getElementById('tester');
		let data = {{ .Data }}
		let x = data.Values.map(d => d.Ts)
		let y = data.Values.map(d => d.ValueInt.Int64)
		Plotly.newPlot(
			tester,
			[
				{
					x,
					y,
				},
			], {
				margin: { t: 0 },
			}
		);
	</script>
	{{ end }}
{{ end }}
