diff --git a/types/force-graph/force-graph-tests.ts b/types/force-graph/force-graph-tests.ts index d128fb813d..37674b5fb7 100644 --- a/types/force-graph/force-graph-tests.ts +++ b/types/force-graph/force-graph-tests.ts @@ -32,9 +32,8 @@ graph .linkAutoColorBy((link) => link.type) .linkWidth(1) .linkWidth((link) => 1) - .linkCurvature(ForceGraph.LinkCurvatureType.Straight) .linkCurvature('curvature') - .linkCurvature((link) => ForceGraph.LinkCurvatureType.Straight) + .linkCurvature((link) => 0.5) .linkCanvasObject((link, ctx, scale) => {}) .linkDirectionalArrowLength(0) .linkDirectionalArrowLength('length') diff --git a/types/force-graph/index.d.ts b/types/force-graph/index.d.ts index 6ed52ad923..063aa12161 100644 --- a/types/force-graph/index.d.ts +++ b/types/force-graph/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for force-graph 1.15 +// Type definitions for force-graph 1.21 // Project: https://github.com/vasturiano/force-graph // Definitions by: Peter Kimberley +// Noah Santschi-Cooney // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function ForceGraph(): ForceGraph.ForceGraphInstance; @@ -16,12 +17,12 @@ declare namespace ForceGraph { } interface GraphEntity { - id: string; + id?: string; } interface GraphNode extends GraphEntity { - name: string; - val: any; + name?: string; + val?: any; } interface GraphNodeObject extends GraphNode { @@ -41,15 +42,6 @@ declare namespace ForceGraph { target: GraphNode; } - /** - * Enums - */ - - enum LinkCurvatureType { - Straight = 0, - HalfLineLength = 1 - } - /** * Types */ @@ -107,7 +99,7 @@ declare namespace ForceGraph { linkColor(color?: string | LinkAccessorFn): ForceGraphInstance & (string | LinkAccessorFn); linkAutoColorBy(attribute?: string | LinkAccessorFn): ForceGraphInstance & (string | LinkAccessorFn); linkWidth(width?: number | string | LinkAccessorFn): ForceGraphInstance & (number | string | LinkAccessorFn); - linkCurvature(curvature?: LinkCurvatureType | string | LinkAccessorFn): ForceGraphInstance; + linkCurvature(curvature?: number | string | LinkAccessorFn): ForceGraphInstance; linkCanvasObject(callback?: LinkCanvasCallbackFn): ForceGraphInstance & LinkCanvasCallbackFn; linkDirectionalArrowLength(length?: number | string | LinkAccessorFn): ForceGraphInstance & (number | string | LinkAccessorFn); linkDirectionalArrowColor(color?: string | LinkAccessorFn): ForceGraphInstance & (string | LinkAccessorFn);