mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-23 04:29:48 -04:00
maint: cleanup and some helpful comments
This commit is contained in:
parent
631fedfa2f
commit
0ee19320f6
@ -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<Arc<Vec<Dashboard>>>;
|
||||
|
||||
//#[axum_macros::debug_handler]
|
||||
pub async fn graph_query(
|
||||
State(config): Config,
|
||||
Path((dash_idx, graph_idx)): Path<(usize, usize)>,
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user