Switch to server side rendered SVG based graph library

This commit is contained in:
Peter Stockings
2023-01-22 22:39:32 +11:00
parent 0a93eb7507
commit cd7411eac7
4 changed files with 10 additions and 19 deletions

View File

@@ -7,7 +7,6 @@
<title>Cardio</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.plot.ly/plotly-2.14.0.min.js"></script>
<script src="https://unpkg.com/htmx.org"></script>
<script src="https://unpkg.com/hyperscript.org"></script>
</head>

View File

@@ -2,16 +2,7 @@
class="mb-4 text-4xl font-extrabold leading-none tracking-tight text-gray-900 md:text-5xl lg:text-6xl dark:text-white text-center">
{{last_cadence}} rpm</h1>
<div id="overview-plot" class="w-full mt-2 aspect-video"></div>
<script>
Plotly.newPlot(document.getElementById("overview-plot"), [
{{ plot | tojson}}
], {
margin: { t: 0 }, xaxis: { showgrid: false, showticklabels: false }, yaxis: {
showgrid: false
}
});
</script>
<embed type="image/svg+xml" src={{graph_data|safe}} class="w-full h-1/4" />
<div class="relative overflow-x-auto">
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">