diff --git a/typescript/Frontend/src/components/Installations/Log/TopologyView.tsx b/typescript/Frontend/src/components/Installations/Log/TopologyView.tsx
new file mode 100644
index 000000000..174b26cf5
--- /dev/null
+++ b/typescript/Frontend/src/components/Installations/Log/TopologyView.tsx
@@ -0,0 +1,122 @@
+import { Box } from "@mui/material";
+import TopologyColumn from "./TopologyColumn";
+import { UnixTime } from "../../../dataCache/time";
+import { extractTopologyValues, parseCsv } from "../../../util/graph.util";
+import { testData } from "./ScalarGraph";
+
+const TopologyView = () => {
+ const values = extractTopologyValues({
+ time: UnixTime.fromTicks(192384239),
+ value: parseCsv(testData),
+ });
+ console.log("csvValue", parseCsv(testData));
+ if (values) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+ return null;
+};
+
+export default TopologyView;
diff --git a/typescript/Frontend/src/dataCache/data.ts b/typescript/Frontend/src/dataCache/data.ts
index ffe3f8a44..74ffdd1a4 100644
--- a/typescript/Frontend/src/dataCache/data.ts
+++ b/typescript/Frontend/src/dataCache/data.ts
@@ -1,21 +1,29 @@
import { Maybe } from "yup";
-import {Timestamped} from "./types";
+import { Timestamped } from "./types";
import { isDefined } from "./utils/maybe";
-export type DataRecord = Record
+export type DataRecord = Record;
-export type DataPoint = Timestamped>
-export type RecordSeries = Array
-export type PointSeries = Array>>
-export type DataSeries = Array>
+export type DataPoint = Timestamped>;
+export type RecordSeries = Array;
+export type PointSeries = Array>>;
+export type DataSeries = Array>;
-export function getPoints(recordSeries: RecordSeries, series: keyof DataRecord): PointSeries
-{
- return recordSeries.map(p => ({time: p.time, value: isDefined(p.value) ? p.value[series] : undefined}))
+export function getPoints(
+ recordSeries: RecordSeries,
+ series: keyof DataRecord
+): PointSeries {
+ return recordSeries.map((p) => ({
+ time: p.time,
+ value: isDefined(p.value) ? p.value[series] : undefined,
+ }));
}
-export function getData(recordSeries: RecordSeries, series: keyof DataRecord): DataSeries
-{
- return recordSeries.map(p => (isDefined(p.value) ? p.value[series] : undefined))
+export function getData(
+ recordSeries: RecordSeries,
+ series: keyof DataRecord
+): DataSeries {
+ return recordSeries.map((p) =>
+ isDefined(p.value) ? p.value[series] : undefined
+ );
}
-
diff --git a/typescript/Frontend/src/util/graph.util.tsx b/typescript/Frontend/src/util/graph.util.tsx
index 6a4e2882b..8a9686483 100644
--- a/typescript/Frontend/src/util/graph.util.tsx
+++ b/typescript/Frontend/src/util/graph.util.tsx
@@ -55,7 +55,7 @@ export const extractTopologyValues = (
const values = topologyValues[topologyKey].map(
(topologyPath) => timeSeriesValue[topologyPath]
);
- console.log("values", values);
+ console.log("values", topologyValues);
return {
...acc,
[topologyKey]: [
@@ -64,7 +64,7 @@ export const extractTopologyValues = (
topologyKey === "gridToAcIn"
? [values.reduce((acc, curr) => Number(acc) + Number(curr))]
: values,
- label: topologyKey.split("/").pop(),
+ label: topologyValues[topologyKey][0].split("/").pop(),
unit: "V",
} as BoxData,
],
@@ -93,6 +93,14 @@ export const topologyValues: { [key: string]: string[] } = {
battery: ["/Battery/Soc", "/Battery/Dc/Voltage"],
};
+export interface CsvEntry {
+ value: string | number;
+ unit: string;
+}
+export interface Csv {
+ [key: string]: CsvEntry;
+}
+
export const parseCsv = (text: string) => {
console.log("split", text.split(/\r?\n/));
const y = text