signalk-auto-polar
Version:
Aggregates boat performance data into running averages per wind condition (with a capped count) and displays the results via a static HTML/JS interface with CSV download.
55 lines • 1.64 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>Polar Performance Aggregated Data</title>
<!-- Include Chart.js from CDN -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Link to our custom JavaScript -->
<script src="/plugin/polar-performance/static/main.js"></script>
<style>
/* Position the toggle button in the top right corner */
#toggleViewButton {
position: fixed;
top: 10px;
right: 10px;
z-index: 1000;
padding: 8px 12px;
background: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
/* Position the download button in the bottom right corner */
#downloadCSV {
position: fixed;
bottom: 10px;
right: 10px;
z-index: 1000;
padding: 8px 12px;
background: #28a745;
color: #fff;
text-decoration: none;
border-radius: 4px;
}
/* Some basic styling for the content */
body {
font-family: Arial, sans-serif;
margin: 20px;
}
#content {
margin-top: 50px;
}
</style>
</head>
<body>
<h1>Polar Performance Aggregated Data</h1>
<!-- Toggle button at top right -->
<button id="toggleViewButton">Switch to Table View</button>
<!-- Main content area where the diagram or table will appear -->
<div id="content"></div>
<!-- Download CSV button at bottom right -->
<a id="downloadCSV" href="/plugin/polar-performance/csv" download="polar_data.csv">Download CSV</a>
</body>
</html>