Consolidate all subproject package.json files into root package.json and migrate to unified Vite MPA build
Build and Deploy / build-and-deploy (push) Has been cancelled
Build and Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
import { GraphData, GraphNode } from "./graph";
|
||||
export interface RenderContext {
|
||||
data: GraphData;
|
||||
element: HTMLElement;
|
||||
onHover: (node?: GraphNode) => void;
|
||||
}
|
||||
export type Renderer = (context: RenderContext) => void;
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
export declare class Graph {
|
||||
private ids;
|
||||
private graph;
|
||||
addNode<T = any>(node: GraphNode<T>): GraphNode<any>;
|
||||
addLink<T = any>(link: GraphLink<T>): GraphLink<T>;
|
||||
toJSON(): GraphData<any, any>;
|
||||
}
|
||||
export interface GraphNode<T = any> {
|
||||
id: string;
|
||||
name?: string;
|
||||
group?: string;
|
||||
value?: T;
|
||||
}
|
||||
export interface GraphLink<T = any> {
|
||||
source: string;
|
||||
target: string;
|
||||
name?: string;
|
||||
value?: T;
|
||||
}
|
||||
export interface GraphData<A = any, B = any> {
|
||||
name?: string;
|
||||
description?: string;
|
||||
nodes: GraphNode<A>[];
|
||||
links: GraphLink<B>[];
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { LitElement } from "lit";
|
||||
import { Renderer } from "./classes/context";
|
||||
import { GraphData, GraphNode } from "./classes/graph";
|
||||
export declare const tagName = "lit-force-graph";
|
||||
export declare class LitForceGraph extends LitElement {
|
||||
static styles: import("lit").CSSResult;
|
||||
graph: HTMLElement;
|
||||
src: string;
|
||||
mode: string;
|
||||
data?: GraphData;
|
||||
hovered?: GraphNode;
|
||||
renderers: Map<string, Renderer>;
|
||||
render(): import("lit").TemplateResult<1>;
|
||||
firstUpdated(): Promise<void>;
|
||||
/**
|
||||
* Set the graph data and update the renderer
|
||||
*
|
||||
* @param data Graph JSON
|
||||
*/
|
||||
setData(data: GraphData): void;
|
||||
private refresh;
|
||||
private onChangeMode;
|
||||
private onDrop;
|
||||
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
||||
}
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"lit-force-graph": LitForceGraph;
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { RenderContext } from "../classes/context";
|
||||
export declare function render(context: RenderContext): void;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { RenderContext } from "../classes/context.js";
|
||||
export declare function render(context: RenderContext): void;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import "aframe";
|
||||
import "@ar-js-org/ar.js";
|
||||
import { RenderContext } from "../classes/context.js";
|
||||
export declare function renderAR(context: RenderContext): void;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { RenderContext } from "../classes/context.js";
|
||||
export declare function renderVR(context: RenderContext): void;
|
||||
Reference in New Issue
Block a user