diff src/graph_view.ts @ 94:a5f53d397526

view: pick types to show at top-level
author drewp@bigasterisk.com
date Wed, 12 Jan 2022 22:09:20 -0800
parents 955cde1550c3
children 4d19759d0d9a
line wrap: on
line diff
--- a/src/graph_view.ts	Wed Jan 12 20:26:57 2022 -0800
+++ b/src/graph_view.ts	Wed Jan 12 22:09:20 2022 -0800
@@ -211,11 +211,12 @@
 
   async makeTemplate(): Promise<TemplateResult> {
     await this.view.ready;
-    const { byType, typedSubjs, untypedSubjs } = groupByRdfType(this.graph);
+    const { byType, typesPresent, untypedSubjs } = groupByRdfType(this.graph);
     let viewTitle = html` (no view)`;
     if (this.view.url) {
       viewTitle = html` using view <a href="${this.view.url}">${this.view.label()}</a>`;
     }
+    const typesToShow = this.view.typesToShow(typesPresent);
     return html`
       <section>
         <h2>
@@ -226,7 +227,7 @@
             These statements are all in the
             <span data-bind="html: $root.createCurie(graphUri())">...</span> graph.-->
         </div>
-        ${typedSubjs.map((t: NamedNode) =>
+        ${typesToShow.map((t: NamedNode) =>
           this._multiSubjsTypeBlock(byType, t)
         )}
         <div class="spoGrid">