diff --git a/web/script.ts b/web/script.ts index 28abb8dd..7b60811b 100644 --- a/web/script.ts +++ b/web/script.ts @@ -18,8 +18,8 @@ import Graph from "graphology" import { parse } from "graphology-gexf/browser" +import { random } from "graphology-layout" import forceAtlas2, { inferSettings } from "graphology-layout-forceatlas2" -import random from "graphology-layout/random" import { Sigma } from "sigma" function getElementByIdOrFail(id: string): HTMLElement { @@ -72,20 +72,21 @@ fetch("/gexf?q=enola:/inline") // TODO "enola.gexf" for easy Dev mode?! Nah, let // Bind zoom manipulation buttons zoomInBtn.addEventListener("click", () => { - camera.animatedZoom({ duration: 600 }) + void camera.animatedZoom({ duration: 600 }) }) zoomOutBtn.addEventListener("click", () => { - camera.animatedUnzoom({ duration: 600 }) + void camera.animatedUnzoom({ duration: 600 }) }) zoomResetBtn.addEventListener("click", () => { - camera.animatedReset({ duration: 600 }) + void camera.animatedReset({ duration: 600 }) }) // Bind labels threshold to range input labelsThresholdRange.addEventListener("input", () => { - renderer?.setSetting("labelRenderedSizeThreshold", +labelsThresholdRange.value) + renderer.setSetting("labelRenderedSizeThreshold", +labelsThresholdRange.value) }) // Set proper range initial value: - labelsThresholdRange.value = renderer.getSetting("labelRenderedSizeThreshold") + "" + labelsThresholdRange.value = renderer.getSetting("labelRenderedSizeThreshold").toString() }) + .catch(console.error) diff --git a/web/src/string2long.test.ts b/web/src/string2long.test.ts index dc7614b0..008b4460 100644 --- a/web/src/string2long.test.ts +++ b/web/src/string2long.test.ts @@ -1,5 +1,5 @@ import { expect } from "@jest/globals" -import { StringToLongBiMap } from "./string2long" +import { StringToLongBiMap } from "./string2long.js" describe("StringToLongBiMap", () => { it("should add and retrieve symbols correctly", () => { diff --git a/web/src/string2long.ts b/web/src/string2long.ts index adad1725..574086ef 100644 --- a/web/src/string2long.ts +++ b/web/src/string2long.ts @@ -34,7 +34,7 @@ export class StringToLongBiMap { if (id >= 0 && id < this.symbolsList.length) { return this.symbolsList[id] } else { - throw new Error(`ID not found: ${id}`) + throw new Error(`ID not found: ${id.toString()}`) } }