Problem: the hexagonal refactor churns the backend tree for nine more phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper, compose/web image) must move to its own repo first so doc/layout rewrites land once on a backend-only tree. Change: - New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/ (updateURL repointed to oikos-web releases), compose/, own CI (web + desktop jobs), own deploy script (CI-green gate, TOCTOU guard, version-tagged images, prune-to-3), own webhook receiver on :9798 + launchd unit, own compose project publishing the same 8091:80. - Cutover executed on mac-mini in order: oikos stack's web service stopped+removed, oikos-web project brought up on 8091; outer Caddy untouched (targets the published port) — serving + Authentik flow + /wails 404 quirk verified post-cutover. - Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install targets, the compose web service, oikos-web from deploy.sh's fallback prune list; wails + go-keyring dropped from go.mod, vendor synced. - README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now point at the new repo; mbse + mascot design docs carry a path note. Risk: production SPA serving depends on the new pipeline now; rollback is versioned-image re-up of the old web service from a pre-split checkout (port 8091). Desktop builds installed before the split still check dtoro/oikos releases — one manual reinstall, noted in the oikos-web release notes. Verification: go vet, make test (race), make generate-check, golangci (no new findings; baseline down 400→365); post-cutover curls — localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
188 lines
6.3 KiB
TypeScript
188 lines
6.3 KiB
TypeScript
import Graph, { Attributes } from "graphology-types";
|
|
import Camera from "./core/camera.js";
|
|
import MouseCaptor from "./core/captors/mouse.js";
|
|
import TouchCaptor from "./core/captors/touch.js";
|
|
import { Settings } from "./settings.js";
|
|
import { CameraState, CoordinateConversionOverride, Coordinates, Dimensions, EdgeDisplayData, Extent, NodeDisplayData, PlainObject, RenderParams, SigmaEvents, TypedEventEmitter } from "./types.js";
|
|
export default class Sigma<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes> extends TypedEventEmitter<SigmaEvents> {
|
|
private settings;
|
|
private graph;
|
|
private mouseCaptor;
|
|
private touchCaptor;
|
|
private container;
|
|
private elements;
|
|
private canvasContexts;
|
|
private webGLContexts;
|
|
private pickingLayers;
|
|
private textures;
|
|
private frameBuffers;
|
|
private activeListeners;
|
|
private labelGrid;
|
|
private nodeDataCache;
|
|
private edgeDataCache;
|
|
private nodeProgramIndex;
|
|
private edgeProgramIndex;
|
|
private nodesWithForcedLabels;
|
|
private edgesWithForcedLabels;
|
|
private nodeExtent;
|
|
private nodeZExtent;
|
|
private edgeZExtent;
|
|
private matrix;
|
|
private invMatrix;
|
|
private correctionRatio;
|
|
private customBBox;
|
|
private normalizationFunction;
|
|
private graphToViewportRatio;
|
|
private itemIDsIndex;
|
|
private nodeIndices;
|
|
private edgeIndices;
|
|
private width;
|
|
private height;
|
|
private pixelRatio;
|
|
private pickingDownSizingRatio;
|
|
private displayedNodeLabels;
|
|
private displayedEdgeLabels;
|
|
private highlightedNodes;
|
|
private hoveredNode;
|
|
private hoveredEdge;
|
|
private renderFrame;
|
|
private renderHighlightedNodesFrame;
|
|
private needToProcess;
|
|
private checkEdgesEventsFrame;
|
|
private nodePrograms;
|
|
private nodeHoverPrograms;
|
|
private edgePrograms;
|
|
private camera;
|
|
constructor(graph: Graph<N, E, G>, container: HTMLElement, settings?: Partial<Settings<N, E, G>>);
|
|
private registerNodeProgram;
|
|
private registerEdgeProgram;
|
|
private unregisterNodeProgram;
|
|
private unregisterEdgeProgram;
|
|
private resetWebGLTexture;
|
|
private bindCameraHandlers;
|
|
private unbindCameraHandlers;
|
|
private getNodeAtPosition;
|
|
private bindEventHandlers;
|
|
private bindGraphHandlers;
|
|
private unbindGraphHandlers;
|
|
private getEdgeAtPoint;
|
|
private process;
|
|
private handleSettingsUpdate;
|
|
private cleanCameraState;
|
|
private renderLabels;
|
|
private renderEdgeLabels;
|
|
private renderHighlightedNodes;
|
|
private scheduleHighlightedNodesRender;
|
|
private render;
|
|
private addNode;
|
|
private updateNode;
|
|
private removeNode;
|
|
private addEdge;
|
|
private updateEdge;
|
|
private removeEdge;
|
|
private clearNodeIndices;
|
|
private clearEdgeIndices;
|
|
private clearIndices;
|
|
private clearNodeState;
|
|
private clearEdgeState;
|
|
private clearState;
|
|
private addNodeToProgram;
|
|
private addEdgeToProgram;
|
|
getRenderParams(): RenderParams;
|
|
getStagePadding(): number;
|
|
createLayer<T extends HTMLElement>(id: string, tag: string, options?: {
|
|
style?: Partial<CSSStyleDeclaration>;
|
|
} & ({
|
|
beforeLayer?: string;
|
|
} | {
|
|
afterLayer?: string;
|
|
})): T;
|
|
createCanvas(id: string, options?: {
|
|
style?: Partial<CSSStyleDeclaration>;
|
|
} & ({
|
|
beforeLayer?: string;
|
|
} | {
|
|
afterLayer?: string;
|
|
})): HTMLCanvasElement;
|
|
createCanvasContext(id: string, options?: {
|
|
style?: Partial<CSSStyleDeclaration>;
|
|
}): this;
|
|
createWebGLContext(id: string, options?: {
|
|
preserveDrawingBuffer?: boolean;
|
|
antialias?: boolean;
|
|
hidden?: boolean;
|
|
picking?: boolean;
|
|
} & ({
|
|
canvas?: HTMLCanvasElement;
|
|
style?: undefined;
|
|
} | {
|
|
style?: CSSStyleDeclaration;
|
|
canvas?: undefined;
|
|
})): WebGLRenderingContext;
|
|
killLayer(id: string): this;
|
|
getCamera(): Camera;
|
|
setCamera(camera: Camera): void;
|
|
getContainer(): HTMLElement;
|
|
getGraph(): Graph<N, E, G>;
|
|
setGraph(graph: Graph<N, E, G>): void;
|
|
getMouseCaptor(): MouseCaptor<N, E, G>;
|
|
getTouchCaptor(): TouchCaptor<N, E, G>;
|
|
getDimensions(): Dimensions;
|
|
getGraphDimensions(): Dimensions;
|
|
getNodeDisplayData(key: unknown): NodeDisplayData | undefined;
|
|
getEdgeDisplayData(key: unknown): EdgeDisplayData | undefined;
|
|
getNodeDisplayedLabels(): Set<string>;
|
|
getEdgeDisplayedLabels(): Set<string>;
|
|
getSettings(): Settings<N, E, G>;
|
|
getSetting<K extends keyof Settings<N, E, G>>(key: K): Settings<N, E, G>[K];
|
|
setSetting<K extends keyof Settings<N, E, G>>(key: K, value: Settings<N, E, G>[K]): this;
|
|
updateSetting<K extends keyof Settings<N, E, G>>(key: K, updater: (value: Settings<N, E, G>[K]) => Settings<N, E, G>[K]): this;
|
|
setSettings(settings: Partial<Settings<N, E, G>>): this;
|
|
resize(force?: boolean): this;
|
|
clear(): this;
|
|
refresh(opts?: {
|
|
partialGraph?: {
|
|
nodes?: string[];
|
|
edges?: string[];
|
|
};
|
|
schedule?: boolean;
|
|
skipIndexation?: boolean;
|
|
}): this;
|
|
scheduleRender(): this;
|
|
scheduleRefresh(opts?: {
|
|
partialGraph?: {
|
|
nodes?: string[];
|
|
edges?: string[];
|
|
};
|
|
layoutUnchange?: boolean;
|
|
}): this;
|
|
getViewportZoomedState(viewportTarget: Coordinates, newRatio: number): CameraState;
|
|
viewRectangle(): {
|
|
x1: number;
|
|
y1: number;
|
|
x2: number;
|
|
y2: number;
|
|
height: number;
|
|
};
|
|
framedGraphToViewport(coordinates: Coordinates, override?: CoordinateConversionOverride): Coordinates;
|
|
viewportToFramedGraph(coordinates: Coordinates, override?: CoordinateConversionOverride): Coordinates;
|
|
viewportToGraph(viewportPoint: Coordinates, override?: CoordinateConversionOverride): Coordinates;
|
|
graphToViewport(graphPoint: Coordinates, override?: CoordinateConversionOverride): Coordinates;
|
|
getGraphToViewportRatio(): number;
|
|
getBBox(): {
|
|
x: Extent;
|
|
y: Extent;
|
|
};
|
|
getCustomBBox(): {
|
|
x: Extent;
|
|
y: Extent;
|
|
} | null;
|
|
setCustomBBox(customBBox: {
|
|
x: Extent;
|
|
y: Extent;
|
|
} | null): this;
|
|
kill(): void;
|
|
scaleSize(size?: number, cameraRatio?: number): number;
|
|
getCanvases(): PlainObject<HTMLCanvasElement>;
|
|
}
|