From f0e6e793642043ffe753b98e6d8f9cc93bc25664 Mon Sep 17 00:00:00 2001 From: Vasek Sraier Date: Thu, 1 Oct 2020 21:57:13 +0200 Subject: [PATCH] code cleanup --- frontend/src/App.svelte | 2 - frontend/src/Graph.svelte | 1 - frontend/src/sigma.d.ts | 313 -------------------------------------- 3 files changed, 316 deletions(-) delete mode 100644 frontend/src/sigma.d.ts diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 4255a8a..efdf563 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -6,8 +6,6 @@ import TaskPanel from "./TaskPanel.svelte"; import Editor from "./Editor.svelte"; import Modal from "svelte-simple-modal"; -import GraphEdge from "./GraphEdge.svelte"; -import TaskDetailEditor from "./TaskDetailEditor.svelte"; const tasksPromise: Promise = loadTasks(); diff --git a/frontend/src/Graph.svelte b/frontend/src/Graph.svelte index 43777cf..f47abe5 100644 --- a/frontend/src/Graph.svelte +++ b/frontend/src/Graph.svelte @@ -26,7 +26,6 @@ let [nodes, edges] = createNodesAndEdges(tasks); function hack() { [nodes, edges] = createNodesAndEdges(tasks, nodes, edges); - //runSimulation(); } $: { tasks; diff --git a/frontend/src/sigma.d.ts b/frontend/src/sigma.d.ts deleted file mode 100644 index ee9a995..0000000 --- a/frontend/src/sigma.d.ts +++ /dev/null @@ -1,313 +0,0 @@ -// Type definitions for sigma.js v1.0.3 -// Project: https://github.com/jacomyal/sigma.js -// Definitions by: Qinfeng Chen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace SigmaJs{ - interface Animation { - camera(camera: Camera, target: { [index: string]: any }, options: { [index: string]: any }): number; - } - - interface Camera { - angle: number; - cameraPosition(x: number, y:number): {x: number; y: number}; - goTo(settings: { [index: string]: any }): void; - graphPosition(x: number, y:number): {x: number; y: number}; - ratio: number; - readPrefix: string; - settings(setting: string) : any; - x: number; - y: number; - } - - interface Canvas { - edges: {[renderType: string]: (edge: Edge, source: Node, target: Node, ...a:any[]) => void}; - labels: {[renderType: string]: (node: Node, ...a:any[]) => void}; - nodes: {[renderType: string]: (node: Node, ...a:any[]) => void}; - } - - interface Classes { - configurable: Configurable; - graph: Graph; - } - - interface Configurable { - new(setting: Settings): Configurable; - new(settings: Settings[]): Configurable; - (key: string): string; - } - - interface CustomShapes { - init(sigma: Sigma): void; - } - - interface DragNodes { - (sigma: Sigma, renderer: Renderer): DragNodes; - } - - interface Edge { - [key : string] : any; - color?: string; - id: string; - size?: number; - source: string; - target: string; - } - - interface JsonParser { - (target: string, sigma: Sigma, callback: (graph: Sigma) => void): void; - } - - interface GexfParser { - (target: string, sigma: Sigma, callback: (graph: Sigma) => void): void; - } - - interface Graph { - addEdge(edge: Edge): Graph; - addNode(node: Node): Graph; - addMethod(name: string, method: (input: any) => any): void; - clear(): Graph; - degree(id: string): number; - degree(id: string, type: string): number; - degree(ids: string[]): number[]; - degree(ids: string[], type: string): number[]; - dropEdge(id: string): Graph; - dropNode(id: string): Graph; - edges(): Edge[]; - edges(id: string): Edge; - edges(ids: string[]): Edge[]; - kill(): Graph; - nodes(): Node[]; - nodes(id: string): Node; - nodes(ids: string[]): Node[]; - } - - interface GraphData { - edges: Edge[]; - nodes: Node[]; - } - - interface Image { - clip?: number; - scale?: number; - url?: string; - x?: number; - y?: number; - } - - interface Miscellaneous { - animation: Animation; - } - - interface Node { - [key : string] : any; - color?: string; - id: string; - image?: any; - label?: string; - size?: number; - type?: string; - x?: number; - y?: number; - } - - interface Parsers { - json: JsonParser; - gexf: GexfParser; - } - - interface Plugins { - dragNodes: DragNodes; - } - - interface Renderer { - container: HTMLElement; - refresh(): Sigma; - render(): Sigma; - resize(): Sigma; - settings(settings: Settings): void; - } - - interface RendererConfigs{ - container?: Element; - id?: string; - type?: string; - } - - interface ShapeLibrary { - enumerate(): any; - } - - interface Sigma { - addRenderer(): Renderer; - addRenderer(configs: RendererConfigs): Renderer; - bind(event: string, callback: (e: any) => void): void; - cameras: Camera[]; - graph: Graph; - killRenderer(renderer: string): Sigma; - killRenderer(renderer: Renderer): Sigma; - kill(): void; - refresh(): void; - renderers: Renderer[]; - settings(key: string): any; - settings(settings: Settings): void; - - // forceAtlas2 layout - configForceAtlas2(configs: { [key: string]: any }): void; - isForceAtlas2Running(): boolean; - killForceAtlas2(): void; - startForceAtlas2(): void; - startForceAtlas2(configs: { [key: string]: any }): void; - stopForceAtlas2(): void; - } - - interface SigmaConfigs { - container?: Element; - graph?: GraphData; - id?: string; - renderers?: Renderer[]; - settings?: { [index: string]: any }; - } - - interface SigmaFactory { - new(): Sigma; - new(container: string): Sigma; - new(container: Element): Sigma; - new(configuration: SigmaConfigs): Sigma; - canvas: Canvas; - classes:Classes; - misc: Miscellaneous; - parsers: Parsers; - plugins: Plugins; - svg: SVG; - } - - interface Settings { - // Graph settings - clone?: boolean; - immutable?: boolean; - verbose?: boolean; - - // Renderers settings - defaultNodeType?: string; - defaultEdgeType?: string; - defaultLabelColor?: string; - defaultEdgeColor?: string; - defaultNodeColor?: string; - defaultLabelSize?: string; - edgeColor?: string; - minArrowSize?: number; - font?: string; - fontStyle?: string; - labelAlignment?: string; - labelColor?: string; - labelSize?: string; - labelSizeRatio?: string; - labelThreshold?: number; - webglOversamplingRatio?: number; - - // hovered node customizations - borderSize?: number; - defaultNodeBorderColor?: string; - hoverFont?: number; - hoverFontStyle?: string; - labelHoverShadow?: string; - labelHoverShadowColor?: string; - nodeHoverColor?: string; - defaultNodeHoverColor?: string; - labelHoverBGColor?: string; - defaultHoverLabelBGColor?: string; - labelHoverColor?: string; - defaultLabelHoverColor?: string; - singleHover?: boolean; - - // hovered edge customizations - edgeHoverColor?: string; - edgeHoverSizeRatio?: number; - defaultEdgeHoverColor?: string; - edgeHoverExtremities?: boolean; - - // Draw settings for labels, edges, and nodes - drawLabels?: boolean; - drawEdges?: boolean; - drawNodes?: boolean; - - // Batch edge drawing - batchEdgesDrawing?: boolean; - hideEdgesOnMove?: boolean; - canvasEdgesBatchSize?: number; - webglEdgesBatchSize?: number; - - // Rescale settings - scalingMode?: string; - sideMargin?: number; - - // max/min node and edge size - minEdgeSize?: number; - maxEdgeSize?: number; - minNodeSize?: number; - maxNodeSize?: number; - - // Captor settings - touchEnabled?: boolean; - mouseEnabled?: boolean; - mouseWheelEnabled?: boolean; - doubleClickEnabled?: boolean; - eventsEnabled?: boolean; - zoomingRatio?: number; - doubleClickZoomingRatio?: number; - zoomMin?: number; - zoomMax?: number; - mouseZoomDuration?: number; - doubleClickZoomDuration?: number; - mouseInertiaDuration?: number; - mouseInertiaRatio?: number; - touchInertiaDuration?: number; - touchInertiaRatio?: number; - doubleClickTimeout?: number; - doubleTapTimeout?: number; - dragTimeout?: number; - - // Global settings - autoResize?: boolean; - autoRescale?: any; - enableCamera?: boolean; - enableHovering?: boolean; - enableEdgeHovering?: boolean; - edgeHoverPrecision?: number; - rescaleIgnoreSize?: boolean; - skipErrors?: boolean; - - // Camera settings - nodesPowRatio?: number; - edgesPowRatio?: number; - - // Animation settings - animationsTime?: number; - } - - interface SVG { - edges: { - labels: SVGEdgeLabels; - [renderType: string]: SVGObject | SVGEdgeLabels; - }; - labels: {[renderType: string]: SVGObject}; - nodes: {[renderType: string]: SVGObject}; - } - - interface SVGEdgeLabels { - [renderType: string]: SVGObject; - } - - interface SVGObject { - create: (object: T, ...a:any[]) => Element; - update: (object: T, ...a:any[]) => void; - } -} - -declare module 'sigma' { - declare var sigma: SigmaJs.SigmaFactory; - declare var CustomShapes: SigmaJs.CustomShapes; - declare var ShapeLibrary: SigmaJs.CustomShapes; -} -