1 # SPDX-License-Identifier: EPL-1.0
2 ##############################################################################
3 # Copyright (c) 2018 The Linux Foundation and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Eclipse Public License v1.0
7 # which accompanies this distribution, and is available at
8 # http://www.eclipse.org/legal/epl-v10.html
9 ##############################################################################
19 print(json.dumps(x, indent=4, sort_keys=False))
25 "gridData": {"h": None, "i": None, "w": None, "x": None, "y": None},
28 "type": "visualization",
34 def create(self, co_ords, id):
36 temp = copy.deepcopy(self.content)
37 temp["gridData"]["h"] = co_ords["h"]
38 temp["gridData"]["i"] = str(self.counter)
39 temp["gridData"]["w"] = co_ords["w"]
40 temp["gridData"]["x"] = co_ords["x"]
41 temp["gridData"]["y"] = co_ords["y"]
44 temp["panelIndex"] = str(self.counter)
49 def generate(viz_config):
51 viz = [dash.create(i["co_ords"], i["id"]) for _, i in viz_config.items()]
55 if __name__ == "__main__":
56 with open("dashboard.yaml", "r") as f:
57 config = yaml.safe_load(f)
58 p(generate(config["dashboard"]["viz"]))