diff --git a/src/routes.rs b/src/routes.rs index 4ef2175..10e0928 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -19,8 +19,9 @@ use axum::{ routing::get, Json, Router, }; -use axum_macros::debug_handler; -use maud::{html, Markup, PreEscaped}; + +// https://maud.lambda.xyz/getting-started.html +use maud::{html, Markup}; use tracing::debug; use crate::dashboard::{Dashboard, Graph}; @@ -28,7 +29,6 @@ use crate::query::{to_samples, QueryResult}; type Config = State>>; -//#[axum_macros::debug_handler] pub async fn graph_query( State(config): Config, Path((dash_idx, graph_idx)): Path<(usize, usize)>, diff --git a/static/lib.js b/static/lib.js index 1d52f5d..1cc6ba1 100644 --- a/static/lib.js +++ b/static/lib.js @@ -102,6 +102,7 @@ class TimeseriesGraph extends HTMLElement { async updateGraph() { const data = await this.fetchData(); if (data.Series) { + // https://plotly.com/javascript/reference/scatter/ var traces = []; for (const pair of data.Series) { const series = pair[1]; @@ -123,6 +124,7 @@ class TimeseriesGraph extends HTMLElement { traces.push(trace); } console.log("Traces: ", traces); + // https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact Plotly.react(this.getTargetNode(), traces, { legend: { @@ -134,6 +136,7 @@ class TimeseriesGraph extends HTMLElement { responsive: true }); } else if (data.Scalar) { + // https://plotly.com/javascript/reference/bar/ console.log("scalar data: ", data.Scalar); var traces = []; for (const pair of data.Scalar) {