Added graph
This commit is contained in:
@@ -24,8 +24,10 @@ class GaugeGroup {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`).join('')}
|
`).join('')}
|
||||||
<div id="graph${nodeId}></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="plotly-container">
|
||||||
|
<div id="liveGraph${this.nodeId}" ></div>
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Append the new div to the body
|
// Append the new div to the body
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
|
||||||
<script src="GaugGroup.js"></script>
|
<script src="GaugGroup.js"></script>
|
||||||
<script src="main.js"></script>
|
<script src="main.js"></script>
|
||||||
<script src="liveGraph.js"></script>
|
<script src="liveGraph.js"></script>
|
||||||
|
@@ -98,9 +98,17 @@ async function nodeAdressHandler(node, dataTypes) {
|
|||||||
|
|
||||||
let gaugeGroup = new GaugeGroup(nodeName, nodeLocation, dataTypes.length, maxGaugeValues, dataTypes);
|
let gaugeGroup = new GaugeGroup(nodeName, nodeLocation, dataTypes.length, maxGaugeValues, dataTypes);
|
||||||
sensorData[node] = gaugeGroup;
|
sensorData[node] = gaugeGroup;
|
||||||
|
gaugeGroup.graph = new liveGraph(nodeName);
|
||||||
|
sensorData[node] = gaugeGroup;
|
||||||
|
gaugeGroup.graph.makeGraph();
|
||||||
|
sensorData[node] = gaugeGroup;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getNodeInfo(node){
|
function getNodeInfo(node){
|
||||||
return fetch("http://145.92.8.114/getNodeInfo?macAdress=" + node)
|
return fetch("http://145.92.8.114/getNodeInfo?macAdress=" + node)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
Reference in New Issue
Block a user