diff src/elements/graph-view/GraphView.ts @ 139:cf642d395be4

new simpler Patch class; fancier 'hide' view config support
author drewp@bigasterisk.com
date Mon, 08 May 2023 13:05:20 -0700
parents 5a1a79f54779
children
line wrap: on
line diff
--- a/src/elements/graph-view/GraphView.ts	Sat May 06 15:35:11 2023 -0700
+++ b/src/elements/graph-view/GraphView.ts	Mon May 08 13:05:20 2023 -0700
@@ -33,12 +33,12 @@
   static styles = [pageStyle, graphViewStyle];
   update(changedProperties: PropertyValues) {
     if (changedProperties.has("graph") && this.graph) {
-      // const viewUri = new NamedNode(this.viewEl?.getAttribute('uri'))
-      const viewUri = new NamedNode(new URL("#view", document.baseURI).href);
+      const viewUri = new NamedNode(this.viewEl?.getAttribute('uri') || 'no-view')
+      // const viewUri = new NamedNode(new URL("#view", document.baseURI).href);
       this.viewConfig = new ViewConfig(this.graph, viewUri);
 
       // "when viewconfig is updated..."
-      setTimeout(()=>this.requestUpdate(), 1000)
+      // setTimeout(()=>this.requestUpdate(), 1000)
 
       this.graph.graphChanged.subscribe(this.onChange?.bind(this));
     }
@@ -67,14 +67,14 @@
     this._addLabelsForAllTerms(graph, labels);
     labels.planDisplayForNode(this.viewConfig.viewRoot); // todo shoudltn be needed
     this.nodeDisplay = new NodeDisplay(labels);
-    let viewTitle = html` (no view)`;
-    viewTitle = html` using view
+    let viewTitle = html``;
+    viewTitle = html`<h2>View 
       <a href="${this.viewConfig.viewRoot.value}"
-        >{this.nodeDisplay.render(this.viewConfig.viewRoot)}</a
+        >${this.nodeDisplay.render(this.viewConfig.viewRoot)}</a
       >`;
     return html`
       <section>
-        <h2>View: ${viewTitle}</h2>
+        ${viewTitle}
         <div>
           <!-- todo: graphs and provenance.
             These statements are all in the