# HG changeset patch # User drewp@bigasterisk.com # Date 1647630033 25200 # Node ID cbcd82d2135630c4bde9ee852765a93d636774f6 # Parent 5e6840229a05b55edd767fd8d034a8dc3ddcd49b cleanup diff -r 5e6840229a05 -r cbcd82d21356 src/layout/Layout.test.ts --- a/src/layout/Layout.test.ts Fri Mar 18 11:57:38 2022 -0700 +++ b/src/layout/Layout.test.ts Fri Mar 18 12:00:33 2022 -0700 @@ -48,8 +48,14 @@ sections: [ { subjRows: [ - { subj: EX("a0"), predRows: [{ pred: EX("b0"), objs: [EX("c0")] }] }, - { subj: EX("d0"), predRows: [{ pred: EX("e0"), objs: [EX("f0")] }] }, + { + subj: EX("a0"), + predRows: [{ pred: EX("b0"), objs: [EX("c0")] }], + }, + { + subj: EX("d0"), + predRows: [{ pred: EX("e0"), objs: [EX("f0")] }], + }, ], }, ], diff -r 5e6840229a05 -r cbcd82d21356 src/layout/rdf_value.ts --- a/src/layout/rdf_value.ts Fri Mar 18 11:57:38 2022 -0700 +++ b/src/layout/rdf_value.ts Fri Mar 18 12:00:33 2022 -0700 @@ -1,4 +1,4 @@ -import { Store, Term, NamedNode } from "n3"; +import { NamedNode, Store, Term } from "n3"; import { RDFS } from "./namespaces"; function _singleValue(g: Store, s: Term, p: Term): Term { @@ -45,7 +45,9 @@ return ret; } -export function uniqueSortedTerms(terms: Iterable): T[] { +export function uniqueSortedTerms( + terms: Iterable +): T[] { const uniques: T[] = []; const seen = new Set(); for (let o of terms) { @@ -54,6 +56,8 @@ uniques.push(o); } } - uniques.sort((a,b)=>{return a.id.localeCompare(b.id)}); + uniques.sort((a, b) => { + return a.id.localeCompare(b.id); + }); return uniques; } diff -r 5e6840229a05 -r cbcd82d21356 src/render/GraphView.ts --- a/src/render/GraphView.ts Fri Mar 18 11:57:38 2022 -0700 +++ b/src/render/GraphView.ts Fri Mar 18 12:00:33 2022 -0700 @@ -1,23 +1,13 @@ import Immutable from "immutable"; import { html, TemplateResult } from "lit"; -import { DataFactory, Literal, NamedNode, Quad, Store, Term } from "n3"; -import { NodeDisplay } from "./NodeDisplay"; -import { SuffixLabels } from "../layout/suffixLabels"; +import { NamedNode, Quad, Store, Term } from "n3"; import { AlignedTable, FreeStatements, Layout, PredRow, SubjRow } from "../layout/Layout"; -import { TableDesc, ViewConfig } from "../layout/ViewConfig"; -import { uniqueSortedTerms } from "../layout/rdf_value"; - -const { namedNode } = DataFactory; +import { SuffixLabels } from "../layout/suffixLabels"; +import { ViewConfig } from "../layout/ViewConfig"; +import { NodeDisplay } from "./NodeDisplay"; type UriSet = Immutable.Set; -const emptyUriSet = Immutable.Set(); -// https://github.com/rdfjs/N3.js/issues/265 -if ((Literal.prototype as any).hashCode === undefined) { - (Literal.prototype as any).hashCode = () => 0; -} -if ((NamedNode.prototype as any).hashCode === undefined) { - (NamedNode.prototype as any).hashCode = () => 0; -} + export class GraphView { nodeDisplay!: NodeDisplay; constructor( diff -r 5e6840229a05 -r cbcd82d21356 src/render/StreamedGraph.ts --- a/src/render/StreamedGraph.ts Fri Mar 18 11:57:38 2022 -0700 +++ b/src/render/StreamedGraph.ts Fri Mar 18 12:00:33 2022 -0700 @@ -1,14 +1,10 @@ -import { LitElement, html, render, TemplateResult } from "lit"; +import { html, LitElement, render, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators.js"; - import { Store } from "n3"; - +import { StreamedGraphClient } from "../layout/StreamedGraphClient"; +import { ViewConfig } from "../layout/ViewConfig"; import { GraphView } from "./GraphView"; -import { StreamedGraphClient } from "../layout/StreamedGraphClient"; -import { style, addFontToRootPage } from "./style"; -import { ViewConfig } from "../layout/ViewConfig"; - -// export * from "./graph_queries"; +import { addFontToRootPage, style } from "./style"; export interface VersionedGraph { version: number; @@ -72,7 +68,7 @@ redrawGraph() { this.graphViewDirty = true; - const rl: ()=>Promise = this._redrawLater.bind(this) + const rl: () => Promise = this._redrawLater.bind(this); requestAnimationFrame(rl); } @@ -108,8 +104,7 @@ if (!this.graphViewDirty) return; if ((this.graph as VersionedGraph).store && this.graph.store) { - - const vc = new ViewConfig() + const vc = new ViewConfig(); await this._graphAreaShowGraph( new GraphView([this.url], this.graph.store, vc)