From 9944b47b9bb7b2ba757dfb77de7e74b8ceedfc1b Mon Sep 17 00:00:00 2001 From: Philipp Schaad Date: Wed, 30 Oct 2024 11:43:19 +0100 Subject: [PATCH] Fix arrays not showing up in sidebar Closes #156 --- src/sdfv_ui.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/sdfv_ui.ts b/src/sdfv_ui.ts index c642846..febd9e3 100644 --- a/src/sdfv_ui.ts +++ b/src/sdfv_ui.ts @@ -6,6 +6,7 @@ import { Edge, Memlet, NestedSDFG, + SDFG, SDFGElement, } from './renderer/renderer_elements'; import type { DagreGraph, SDFGRenderer } from './renderer/renderer'; @@ -235,6 +236,10 @@ export class SDFVWebUI implements ISDFVUserInterface { switch (attr[0]) { case 'layout': case 'sdfg': + case '_arrays': + case 'orig_sdfg': + case 'transformation_hist': + case 'position': continue; default: contents.append($('', { @@ -250,6 +255,34 @@ export class SDFVWebUI implements ISDFVUserInterface { } } } + + // For SDFGs and nested SDFGs, add information about the SDFG's data + // descriptors. + let descriptors = undefined; + if (elem instanceof SDFG) + descriptors = elem.attributes()._arrays; + else if (elem instanceof NestedSDFG) + descriptors = elem.attributes().sdfg.attributes._arrays; + + if (descriptors) { + contents.append($('
')); + contents.append($('', { + html: 'Data containers:  ', + })); + contents.append($('
')); + for (const desc in descriptors) { + contents.append($('', { + html: desc + ':  ', + })); + contents.append($('', { + html: sdfg_property_to_string( + descriptors[desc], renderer.view_settings() + ), + })); + contents.append($('
')); + } + contents.append($('
')); + } } }