Simple Graphviz library for TypeScript.
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] about 2 years ago
The modules around AST were integrated, and the functions for models stringing to DOT language, distributed in multiple locations, have been consolidated.
See #622
ts-graphviz/ast
ModuleIn this Pull Request, we have taken the @ts-graphviz/parser
package and integrated its functionality.
We provided AST-related processing such as parse
and stringify
functions as the ts-graphviz/ast
module.
We also made internal improvements for the extensibility of processing.
We have prepared type definitions for various attributes.
This allows for editorial assistance in specifying attributes and checks in TypeScript.
See #542
The structure of ASTs provided by @ts-graphviz/parser
is different from that offered by ts-graphviz/ast
.
There are few changes to the implementation of parser, and the modifications are aimed at unifying the naming across the package and commonality to the JavaScript ecosystem.
In integrating AST into the package, ambiguity in the naming conventions became a problem.
Accordingly, the following actions were taken
I
, such as ICluster
, and changed it so that the naming is the same overall as for the AST type.XxxModel
has been established.Claster
has been deprecated and renamed to XxxGraphModel
.As a result, the naming of v0 series and v1 series are mapped as follows.
INode
-> NodeModel
IEdge
-> EdgeModel
ICluster
-> GraphBaseModel
ISubgraph
-> SubgraphModel
IRootCluster
-> RootGraphModel
And we have also made the following improvements
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Published by github-actions[bot] over 3 years ago
Some Internal API braking changes.
Published by github-actions[bot] almost 4 years ago
Published by github-actions[bot] about 4 years ago
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
const root = new Digraph();
const [node1, node2, node3, node4] = Array(4)
.fill(true)
.map((_, i) => root.createNode(`node${i + 1}`));
const edge = new Edge([node1, [node2, node3], node4]);
root.addEdge(edge);
console.log(toDot(root));
digraph {
"node1" -> {"node2" "node3"} -> "node4";
}
Published by github-actions[bot] over 4 years ago
There are many changes to the flexibility of the API in this release.
IContext
interface was removed.
ICluster
's createEdge
method API was changed.
- createEdge(...targets: EdgeTarget[]): IEdge;
+ createEdge(targets: EdgeTarget[], attributes?: EdgeAttributesObject): IEdge;
toDot
method, use the toDot
function instead.import { digraph, toDot } from 'ts-graphviz';
const g = digraph();
const node1 = g.createNode('node1');
const node2 = g.createNode('node2');
g.createEdge([node1, node2]);
console.log(toDot(g));
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
Published by github-actions[bot] over 4 years ago
Thanks @laysent !
Published by github-actions[bot] almost 5 years ago
Published by github-actions[bot] almost 5 years ago
add
and remove
method from Cluster.Published by github-actions[bot] almost 5 years ago
Published by github-actions[bot] almost 5 years ago
Published by github-actions[bot] almost 5 years ago
Published by github-actions[bot] almost 5 years ago
Published by github-actions[bot] almost 5 years ago