From 07006e24ac88cfe3e5244ec36e1e2c522b87ba17 Mon Sep 17 00:00:00 2001 From: baigner <benedikt.aigner@rwth-aachen.de> Date: Mon, 16 Apr 2018 16:27:42 +0200 Subject: [PATCH] New data structure try 3: Started interpretation of new tree data in the html file (Not finished yet!!!) Former-commit-id: e6f38ab671ffa26c5c809fda58e625808250e510 --- kadmos/vistoms/templates/VISTOMS.html | 23 ++++++++++++++++------- kadmos/vistoms/vistoms.py | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/kadmos/vistoms/templates/VISTOMS.html b/kadmos/vistoms/templates/VISTOMS.html index fd410d991..cd87f3e9a 100644 --- a/kadmos/vistoms/templates/VISTOMS.html +++ b/kadmos/vistoms/templates/VISTOMS.html @@ -21451,9 +21451,7 @@ function maketreeLayout(pipeData, layout, svg, div, aName, aVarCategory) { var schema = currentGraph.variableSchemes[aVarCategory]; - - console.log("schema") - console.log(schema) + var treeData = (JSON.parse(JSON.stringify(schema))); //aigner: Here, the minimalized tree is created! @@ -21463,21 +21461,32 @@ //3) xPathList --> Array of actually used pipeLine data //aigner:HIER WEITER!! - - - function appendElement(anElement) + function appendElement(anElement, xPath_list) { + if (xPath_list.length > 1) + { + anElement.children = []; + var numberOfChildren = anElement.children.length; + var newChild = {}; + anElement.children.append(newChild); + anElement.children.forEach(function(aChild) + } + { + + } } function buildTree(elements) { elements.forEach(function(element) { - var xPath_split = element.xPath.split("/"); + var xPath_split = element.xpath.split("/"); var index = xPath_split.indexOf(""); if (index > -1) {xPath_split.splice(index, 1);} + console.log(element) console.log(xPath_split) + appendElement(element, xPath_split) }) } buildTree(treeData) diff --git a/kadmos/vistoms/vistoms.py b/kadmos/vistoms/vistoms.py index 09bfd0655..bf220906c 100644 --- a/kadmos/vistoms/vistoms.py +++ b/kadmos/vistoms/vistoms.py @@ -1541,7 +1541,7 @@ if __name__ == '__main__': args = sys.argv # Check if folder is given in args if '-folder' in args: - folder = args[args.index('-folder') + 1] + folder = os.path.join(args[args.index('-folder') + 1],'') assert isinstance(folder, basestring), 'Folder should be a string.' else: folder = None -- GitLab