Mercurial > code > home > repos > streamed-graph
changeset 113:4822d5621463
cleanup
author | drewp@bigasterisk.com |
---|---|
date | Sat, 19 Mar 2022 15:45:03 -0700 |
parents | f46b9dfa9b9c |
children | 4b33a479dc2f |
files | src/render/GraphView.ts |
diffstat | 1 files changed, 12 insertions(+), 55 deletions(-) [+] |
line wrap: on
line diff
--- a/src/render/GraphView.ts Fri Mar 18 23:45:17 2022 -0700 +++ b/src/render/GraphView.ts Sat Mar 19 15:45:03 2022 -0700 @@ -83,7 +83,9 @@ } _renderAlignedTable(section: AlignedTable): TemplateResult { + let anyType: NamedNode = new NamedNode(''); const heads = section.columnHeaders.map((ch) => { + anyType = ch.rdfType; return html`<th>${this.nodeDisplay.render(ch.pred)}</th>`; }); const cells = []; @@ -100,17 +102,17 @@ cells.push(html`<tr>${headerCol}${bodyCols}</tr>`); } return html` - <pre> {JSON.stringify(section.rows,null,' ')}</pre> + <div>[icon] Resources of type ${this.nodeDisplay.render(anyType)}</div> <div class="typeBlockScroll"> - <table class="typeBlock"> - <thead> - <th>Subject</th> - ${heads} - </thead> - <tbody> - ${cells} - </tbody> - </table> + <table class="typeBlock"> + <thead> + <th>Subject</th> + ${heads} + </thead> + <tbody> + ${cells} + </tbody> + </table> </div> `; } @@ -161,51 +163,6 @@ return html` <th>${this.nodeDisplay.render(pred)}</th> `; } - // _thead(layout: MultiSubjsTypeBlockLayout): TemplateResult { - // return html` - // <thead> - // <tr> - // <th></th> - // ${layout.preds.map(this._drawColumnHead.bind(this))} - // </tr> - // </thead> - // `; - // } - - // _msbCell(layout: MultiSubjsTypeBlockLayout, subj: NamedNode) { - // return (pred: NamedNode): TemplateResult => { - // const objs = layout.graphCells.get(layout.makeCellKey(subj, pred)); - // if (!objs || !objs.size) { - // return html` <td></td> `; - // } - // const objsList = Array.from(objs); - // objsList.sort(); - // return html` <td>${objsList.map(this._drawObj.bind(this))}</td> `; - // }; - // } - - // _instanceRow(layout: MultiSubjsTypeBlockLayout) { - // return (subj: NamedNode): TemplateResult => { - // return html` - // <tr> - // <td>${this.nodeDisplay.render(subj)}</td> - // ${layout.preds.map(this._msbCell(layout, subj))} - // </tr> - // `; - // }; - // } - - // _multiSubjsTypeBlock(byType: TypeToSubjs, table: TableDesc) { - // const layout = new MultiSubjsTypeBlockLayout(this.graph, byType, table); - - // let typeNames = [html`${this.nodeDisplay.render(table.primary)}`]; - // if (table.joins) { - // typeNames.push(html` joined with [`); - // for (let j of table.joins) { - // typeNames.push(html`${this.nodeDisplay.render(j)}`); - // } - // typeNames.push(html`]`); - // } // return html` // <div>[icon] Resources of type ${typeNames}</div>