diff --git a/frontend/src/components/Graph.js b/frontend/src/components/Graph.js
index 4d41969..471721e 100644
--- a/frontend/src/components/Graph.js
+++ b/frontend/src/components/Graph.js
@@ -9,7 +9,6 @@ function translator(minX, minY, maxX, maxY, width, height, top, left, bottom, ri
const normalized = [normalize(x, minX, maxX), normalize(y, minY, maxY)];
const dataWidth = width - left - right;
const dataHeight = height - top - bottom;
- console.log('translator',{x, y, minX, maxX, minY, maxY, normalized, dataWidth, dataHeight, top, left, bottom, right});
return [normalized[0] * dataWidth + left, (((1 - normalized[1]) * dataHeight) + top)];
}
}
@@ -20,13 +19,33 @@ function colorFactory(i) {
return `hsl(${hue}, 60%, 43%)`;
}
+class GraphDatasetSelector {
+ view(vnode) {
+ const { options, selectedIndex, onSelect } = vnode.attrs;
+ return (
)
+ }
+}
+
class Graph {
+ oninit(vnode) {
+ vnode.state.selected = 0;
+ }
+
view(vnode) {
const { title, width, height, margins, datasets} = {...Graph.defaults, ...vnode.attrs};
return (
+
{vnode.state.selected = i;}} selectedIndex={vnode.state.selected} options={datasets.map((v)=>(v.title))} />
diff --git a/frontend/src/views/HistoryView.js b/frontend/src/views/HistoryView.js
index 331e8da..7f7f3a0 100644
--- a/frontend/src/views/HistoryView.js
+++ b/frontend/src/views/HistoryView.js
@@ -36,6 +36,11 @@ class HistoryView {
{ position: 20, label: '20'},
{ position: 0, label: '0', line: true},
],
+ xLabels: [
+ { position: 0, label: '0'},
+ { position: 3, label: '3', line: true},
+ { position: 6, label: '6', line: true},
+ ]
},
{
title: "Pressure",