Add radix cwl graph visualization
[arvados-workbench2.git] / src / lib / cwl-svg / graph / template-parser.ts
diff --git a/src/lib/cwl-svg/graph/template-parser.ts b/src/lib/cwl-svg/graph/template-parser.ts
new file mode 100644 (file)
index 0000000..77f4183
--- /dev/null
@@ -0,0 +1,9 @@
+export class TemplateParser {
+
+    static parse(tpl: any) {
+        const ns = "http://www.w3.org/2000/svg";
+        const node = document.createElementNS(ns, "g");
+        node.innerHTML = tpl;
+        return node.firstElementChild;
+    }
+}