Skip to content

Commit

Permalink
refactor: use constants when inserting edges
Browse files Browse the repository at this point in the history
Demonstrate that is possible to use "constants" in TypeScript application configured with isolatedModules set to true.
This is available as of maxGraph 0.9.0.
  • Loading branch information
tbouffard committed Aug 4, 2024
1 parent 16de19f commit b69fef0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions projects/_shared/src/generate-graph.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
constants,
Graph,
InternalEvent,
Perimeter,
Expand Down Expand Up @@ -55,10 +56,7 @@ export const initializeGraph = (container: HTMLElement) => {
);
// use the legacy insertEdge method
graph.insertEdge(parent, null, 'an orthogonal style edge', vertex01, vertex02, {
// TODO cannot use constants.EDGESTYLE.ORTHOGONAL
// TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.
// See https://github.com/maxGraph/maxGraph/issues/205
edgeStyle: 'orthogonalEdgeStyle',
edgeStyle: constants.EDGESTYLE.ORTHOGONAL,
rounded: true,
});

Expand Down

0 comments on commit b69fef0

Please sign in to comment.