Closed abchakra closed 2 months ago
I am trying to replicate the JS example into a Typescript example but I am stuck with this error below
https://codesandbox.io/p/sandbox/dagre-d3-ts-9dm98n?file=%2Fsrc%2FTree.tsx%3A194%2C17-194%2C22
'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.ts(7009) (alias) function render(): { (svg: any, g: any): void; createNodes(value: any, ...args: any[]): (selection: any, g: any, shapes: any) => any; createClusters(value: any, ...args: any[]): (selection: any, g: any) => any; createEdgeLabels(value: any, ...args: any[]): (selection: any, g: any) => any; createEdgePaths(value: any, ...args: any[]): (selection: any, g: any, arrows: any) => any; shapes(value: any, ...args: any[]): any; arrows(value: any, ...args: any[]): any;
you can do something like var render = new (dagreD3 as any).render(); until we move to typescript.
var render = new (dagreD3 as any).render();
See https://github.com/tbo47/dagre-es-example/
I am trying to replicate the JS example into a Typescript example but I am stuck with this error below
https://codesandbox.io/p/sandbox/dagre-d3-ts-9dm98n?file=%2Fsrc%2FTree.tsx%3A194%2C17-194%2C22
'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.ts(7009) (alias) function render(): { (svg: any, g: any): void; createNodes(value: any, ...args: any[]): (selection: any, g: any, shapes: any) => any; createClusters(value: any, ...args: any[]): (selection: any, g: any) => any; createEdgeLabels(value: any, ...args: any[]): (selection: any, g: any) => any; createEdgePaths(value: any, ...args: any[]): (selection: any, g: any, arrows: any) => any; shapes(value: any, ...args: any[]): any; arrows(value: any, ...args: any[]): any;