Mercurial > code > home > repos > streamed-graph
annotate src/graph_view.ts @ 84:067d66a45a51
enable more code. factor out setGraphView
author | drewp@bigasterisk.com |
---|---|
date | Wed, 17 Nov 2021 16:45:10 -0800 |
parents | 0c188ed3bcd8 |
children | ac7ad087d474 |
rev | line source |
---|---|
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
1 import { html, TemplateResult } from 'lit'; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
2 import { DataFactory, Literal, Store, NamedNode, Quad, Quad_Object, Term, Util } from 'n3'; |
76 | 3 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
4 import { SuffixLabels } from './suffixLabels'; |
76 | 5 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
6 const { namedNode } = DataFactory; |
20
9ec3cbc8791a
build is running, but no tests, and lots of code is disabled
drewp@bigasterisk.com
parents:
15
diff
changeset
|
7 |
79
0c188ed3bcd8
starting lit upgrade. total mess right now
drewp@bigasterisk.com
parents:
76
diff
changeset
|
8 // // import ns from 'n3/src/IRIs'; |
0c188ed3bcd8
starting lit upgrade. total mess right now
drewp@bigasterisk.com
parents:
76
diff
changeset
|
9 // // const { rdf } = ns; |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
10 const rdf = { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
11 type: namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
12 }; |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
13 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
14 type TypeToSubjs = Map<NamedNode, Set<NamedNode>>; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
15 // When there are multiple types, an arbitrary one is used. |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
16 function groupByRdfType( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
17 graph: Store |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
18 ): { byType: TypeToSubjs; untyped: Set<NamedNode> } { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
19 const rdfType = rdf.type; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
20 const byType: TypeToSubjs = new Map(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
21 const untyped: Set<NamedNode> = new Set(); // subjs |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
22 const internSubjs = new Map<string, NamedNode>(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
23 graph.forEach( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
24 q => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
25 if (!Util.isNamedNode(q.subject)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
26 throw new Error("unsupported " + q.subject.value); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
27 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
28 const subj = q.subject as NamedNode; |
49 | 29 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
30 let subjType: NamedNode | null = null; |
28
c751380b70c5
uniqueness problem with NamedNodes in set
drewp@bigasterisk.com
parents:
22
diff
changeset
|
31 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
32 graph.forObjects( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
33 (o: Quad_Object) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
34 subjType = o as NamedNode; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
35 }, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
36 subj, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
37 rdfType, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
38 null |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
39 ); |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
40 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
41 if (subjType !== null) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
42 // (subj, rdf:type, subjType) in graph |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
43 if (!byType.has(subjType)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
44 byType.set(subjType, new Set()); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
45 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
46 (byType.get(subjType) as Set<NamedNode>).add(subj); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
47 } else { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
48 // no rdf:type stmt in graph |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
49 if (!internSubjs.has(subj.value)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
50 internSubjs.set(subj.value, subj); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
51 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
52 const intSubj: NamedNode = internSubjs.get( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
53 subj.value as string |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
54 ) as NamedNode; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
55 untyped.add(intSubj); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
56 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
57 }, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
58 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
59 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
60 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
61 null |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
62 ); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
63 return { byType: byType, untyped: untyped }; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
64 } |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
65 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
66 class NodeDisplay { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
67 labels: SuffixLabels; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
68 constructor(labels: SuffixLabels) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
69 this.labels = labels; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
70 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
71 getHtml(n: Term | NamedNode): TemplateResult { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
72 if (Util.isLiteral(n)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
73 n = n as Literal; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
74 let dtPart: any = ""; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
75 if (n.datatype) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
76 dtPart = html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
77 ^^<span class="literalType"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
78 ${this.getHtml(n.datatype)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
79 </span> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
80 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
81 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
82 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
83 <span class="literal">${n.value}${dtPart}</span> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
84 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
85 } |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
86 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
87 if (Util.isNamedNode(n)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
88 n = n as NamedNode; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
89 let shortened = false; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
90 let uriValue: string = n.value; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
91 for (let [long, short] of [ |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
92 ["http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf:"], |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
93 ["http://www.w3.org/2000/01/rdf-schema#", "rdfs:"], |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
94 ["http://purl.org/dc/elements/1.1/", "dc:"], |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
95 ["http://www.w3.org/2001/XMLSchema#", "xsd:"] |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
96 ]) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
97 if (uriValue.startsWith(long)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
98 uriValue = short + uriValue.substr(long.length); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
99 shortened = true; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
100 break; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
101 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
102 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
103 if (!shortened) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
104 let dn: string | undefined = this.labels.getLabelForNode(uriValue); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
105 if (dn === undefined) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
106 throw new Error(`dn=${dn}`); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
107 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
108 uriValue = dn; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
109 } |
28
c751380b70c5
uniqueness problem with NamedNodes in set
drewp@bigasterisk.com
parents:
22
diff
changeset
|
110 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
111 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
112 <a class="graphUri" href="${n.value}">${uriValue}</a> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
113 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
114 } |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
115 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
116 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
117 [${n.termType} ${n.value}] |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
118 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
119 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
120 } |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
121 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
122 export class GraphView { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
123 url: string; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
124 graph: Store; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
125 nodeDisplay: NodeDisplay; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
126 constructor(url: string, graph: Store) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
127 this.url = url; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
128 this.graph = graph; |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
129 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
130 const labels = new SuffixLabels(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
131 this._addLabelsForAllTerms(labels); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
132 this.nodeDisplay = new NodeDisplay(labels); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
133 } |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
134 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
135 _addLabelsForAllTerms(labels: SuffixLabels) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
136 return this.graph.forEach( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
137 (q: Quad) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
138 if (q.subject.termType === "NamedNode") { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
139 labels.planDisplayForNode(q.subject); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
140 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
141 if (q.predicate.termType === "NamedNode") { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
142 labels.planDisplayForNode(q.predicate); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
143 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
144 if (q.object.termType === "NamedNode") { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
145 labels.planDisplayForNode(q.object); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
146 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
147 if (q.object.termType === "Literal" && q.object.datatype) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
148 labels.planDisplayForNode(q.object.datatype); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
149 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
150 }, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
151 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
152 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
153 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
154 null |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
155 ); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
156 } |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
157 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
158 _subjBlock(subj: NamedNode) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
159 const predsSet: Set<NamedNode> = new Set(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
160 this.graph.forEach( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
161 (q: Quad) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
162 predsSet.add(q.predicate as NamedNode); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
163 }, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
164 subj, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
165 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
166 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
167 null |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
168 ); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
169 const preds = Array.from(predsSet.values()); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
170 preds.sort(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
171 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
172 <div class="subject"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
173 ${this.nodeDisplay.getHtml(subj)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
174 <!-- todo: special section for uri/type-and-icon/label/comment --> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
175 <div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
176 ${preds.map(p => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
177 return this._predBlock(subj, p); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
178 })} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
179 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
180 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
181 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
182 } |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
183 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
184 _objBlock(obj: Term) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
185 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
186 <div class="object"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
187 ${this.nodeDisplay.getHtml(obj)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
188 <!-- indicate what source or graph said this stmt --> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
189 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
190 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
191 } |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
192 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
193 _predBlock(subj: NamedNode, pred: NamedNode) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
194 const objsSet = new Set<Term>(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
195 this.graph.forEach( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
196 (q: Quad) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
197 objsSet.add(q.object); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
198 }, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
199 subj, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
200 pred, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
201 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
202 null |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
203 ); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
204 const objs = Array.from(objsSet.values()); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
205 objs.sort(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
206 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
207 <div class="predicate"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
208 ${this.nodeDisplay.getHtml(pred)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
209 <div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
210 ${objs.map(this._objBlock.bind(this))} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
211 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
212 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
213 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
214 } |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
215 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
216 byTypeBlock(byType: TypeToSubjs, typeUri: NamedNode) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
217 const subjSet = byType.get(typeUri); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
218 const subjs: Array<NamedNode> = subjSet ? Array.from(subjSet) : []; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
219 subjs.sort(); |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
220 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
221 const graphCells = new Map<string, Set<Term>>(); // [subj, pred] : objs |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
222 const makeCellKey = (subj: NamedNode, pred: NamedNode) => |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
223 subj.value + "|||" + pred.value; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
224 const preds = new Set<NamedNode>(); |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
225 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
226 subjs.forEach((subj: NamedNode) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
227 this.graph.forEach( |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
228 (q: Quad) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
229 if (!Util.isNamedNode(q.predicate)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
230 throw new Error(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
231 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
232 preds.add(q.predicate as NamedNode); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
233 const cellKey = makeCellKey(subj, q.predicate as NamedNode); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
234 if (!graphCells.has(cellKey)) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
235 graphCells.set(cellKey, new Set<Term>()); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
236 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
237 graphCells.get(cellKey)!.add(q.object); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
238 }, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
239 subj, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
240 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
241 null, |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
242 null |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
243 ); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
244 }); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
245 const predsList = Array.from(preds); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
246 predsList.splice(predsList.indexOf(rdf.type), 1); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
247 // also pull out label, which should be used on 1st column |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
248 predsList.sort(); |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
249 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
250 const thead = () => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
251 const predColumnHead = (pred: NamedNode) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
252 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
253 <th>${this.nodeDisplay.getHtml(pred)}</th> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
254 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
255 }; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
256 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
257 <thead> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
258 <tr> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
259 <th></th> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
260 ${predsList.map(predColumnHead)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
261 </tr> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
262 </thead> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
263 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
264 }; |
49 | 265 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
266 const instanceRow = (subj: NamedNode) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
267 const cell = (pred: NamedNode) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
268 const objs = graphCells.get(subj + "|||" + pred); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
269 if (!objs) { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
270 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
271 <td></td> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
272 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
273 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
274 const objsList = Array.from(objs); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
275 objsList.sort(); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
276 const draw = (obj: Term) => { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
277 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
278 <div>${this.nodeDisplay.getHtml(obj)}</div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
279 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
280 }; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
281 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
282 <td>${objsList.map(draw)}</td> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
283 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
284 }; |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
285 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
286 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
287 <tr> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
288 <td>${this.nodeDisplay.getHtml(subj)}</td> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
289 ${predsList.map(cell)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
290 </tr> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
291 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
292 }; |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
293 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
294 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
295 <div>[icon] ${this.nodeDisplay.getHtml(typeUri)} resources</div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
296 <div class="typeBlockScroll"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
297 <table class="typeBlock"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
298 ${thead()} ${subjs.map(instanceRow)} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
299 </table> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
300 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
301 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
302 } |
49 | 303 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
304 makeTemplate(): TemplateResult { |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
305 const { byType, untyped } = groupByRdfType(this.graph); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
306 const typedSubjs = Array.from(byType.keys()); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
307 typedSubjs.sort(); |
15
7ca4ff2088c3
managed to use a newer ts or something, so this includes a bunch of type fixes too
drewp@bigasterisk.com
parents:
9
diff
changeset
|
308 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
309 const untypedSubjs = Array.from(untyped.values()); |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
310 untypedSubjs.sort(); |
8
6fefd287aff9
closer- element now holds a changing graph, but can't draw it yet
drewp@bigasterisk.com
parents:
diff
changeset
|
311 |
84
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
312 return html` |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
313 <section> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
314 <h2>Current graph (<a href="${this.url}">${this.url}</a>)</h2> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
315 <div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
316 <!-- todo: graphs and provenance. |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
317 These statements are all in the |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
318 <span data-bind="html: $root.createCurie(graphUri())">...</span> graph.--> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
319 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
320 ${typedSubjs.map((t: NamedNode) => this.byTypeBlock(byType, t))} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
321 <div class="spoGrid"> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
322 ${untypedSubjs.map(this._subjBlock.bind(this))} |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
323 </div> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
324 </section> |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
325 `; |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
326 } |
067d66a45a51
enable more code. factor out setGraphView
drewp@bigasterisk.com
parents:
79
diff
changeset
|
327 } |