mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Initial commit * Began defining functions * Added top level exported function, options interface and Graphviz object interface * Added more definitions * Added dom lib * Added more definitions * Updated config * Added required TS version * Updated some parameters to be optional * Updated definitions per API * Fixed selection extension methods * Added module declaration * Formatting * Updated names * Re-ordered to match the API with sections * Added Engine type * Added TypeNames type * Added KeyMode type * Added more definitions and comments * Updated to use generics matching other d3 libraries * Updated arrays to be fixed size * Added documentation * Updated return type * Added some tests * Made parameter optional * Updated DOT attributes * Updated callbacks * Linting fixes * Removed unnecessary generics * Updated callbacks
17 lines
507 B
TypeScript
17 lines
507 B
TypeScript
import { select, BaseType } from 'd3-selection';
|
|
import * as d3Graphviz from 'd3-graphviz';
|
|
|
|
let graphviz: d3Graphviz.Graphviz<BaseType, any, BaseType, any>;
|
|
|
|
// Can get a graphviz render using extension method on d3-select
|
|
graphviz = select('test').graphviz();
|
|
|
|
// Can use graphviz method as selector
|
|
graphviz = d3Graphviz.graphviz('test');
|
|
|
|
// Can get the options
|
|
const options: d3Graphviz.GraphvizOptions = d3Graphviz.graphviz('').options();
|
|
|
|
// Can set the options
|
|
graphviz = graphviz.options(options);
|