diff --git a/lib/classes/Graph.ts b/lib/classes/Graph.ts index 3c9da1a..b0f0eef 100644 --- a/lib/classes/Graph.ts +++ b/lib/classes/Graph.ts @@ -5,20 +5,13 @@ * Created by Timo Hocker , May 2020 */ -import { GraphStyles, NodeStyles } from '../enums/Styles'; +import { GraphStyles } from '../enums/Styles'; import { GraphLayouts } from '../enums/GraphLayouts'; import { Element } from './Element'; import { Edge } from './Edge'; import { Node } from './Node'; import { Color } from './Color'; -interface NodeOptions { - name: string; - label: string; - style: NodeStyles; - color: Color; -} - export class Graph extends Element { public children: Array = []; public nodes: Array = []; diff --git a/lib/enums/GraphLayouts.ts b/lib/enums/GraphLayouts.ts index 0fc03b9..49fef5a 100644 --- a/lib/enums/GraphLayouts.ts +++ b/lib/enums/GraphLayouts.ts @@ -6,11 +6,4 @@ */ export type GraphLayouts = - 'neato' - | 'dot' - | 'circo' - | 'fdp' - | 'sfdp' - | 'osage' - | 'twopi' - | 'patchwork' + 'circo' | 'dot' | 'fdp' | 'neato' | 'osage' | 'patchwork' | 'sfdp' | 'twopi' diff --git a/lib/enums/GraphStreamCommand.ts b/lib/enums/GraphStreamCommand.ts index 66e2450..c3c9f3c 100644 --- a/lib/enums/GraphStreamCommand.ts +++ b/lib/enums/GraphStreamCommand.ts @@ -8,13 +8,7 @@ /* eslint-disable line-comment-position */ /* eslint-disable no-inline-comments */ type GraphStreamCommand = - 'cn'| - 'cug'| - 'cdg'| - 'csg'| - 'eg'| - 'at'| - 'ce' + 'at' | 'cdg' | 'ce' | 'cn' | 'csg' | 'cug' | 'eg' function translate_command (cmd: GraphStreamCommand|''): string { const translations = { diff --git a/lib/enums/Shapes.ts b/lib/enums/Shapes.ts index 1419bac..53f19ac 100644 --- a/lib/enums/Shapes.ts +++ b/lib/enums/Shapes.ts @@ -1,63 +1,14 @@ -type NodeShapes = - '' - |'box' - |'polygon' - |'ellipse' - |'oval' - |'circle' - |'point' - |'egg' - |'triangle' - |'plaintext' - |'plain' - |'diamond' - |'trapezium' - |'parallelogram' - |'house' - |'pentagon' - |'hexagon' - |'septagon' - |'octagon' - |'doublecircle' - |'doubleoctagon' - |'tripleoctagon' - |'invtriangle' - |'invtrapezium' - |'invhouse' - |'Mdiamond' - |'Msquare' - |'Mcircle' - |'rect' - |'rectangle' - |'square' - |'star' - |'none' - |'underline' - |'cylinder' - |'note' - |'tab' - |'folder' - |'box3d' - |'component' - |'promoter' - |'cds' - |'terminator' - |'utr' - |'primersite' - |'restrictionsite' - |'fivepoverhang' - |'threepoverhang' - |'noverhang' - |'assembly' - |'signature' - |'insulator' - |'ribosite' - |'rnastab' - |'proteasesite' - |'proteinstab' - |'rpromoter' - |'rarrow' - |'larrow' - |'lpromoter' +type NodeShapes = + '' | 'assembly' | 'box' | 'box3d' | 'cds' | 'circle' | 'component' + | 'cylinder' | 'diamond' | 'doublecircle' | 'doubleoctagon' | 'egg' + | 'ellipse' | 'fivepoverhang' | 'folder' | 'hexagon' | 'house' + | 'insulator' | 'invhouse' | 'invtrapezium' | 'invtriangle' | 'larrow' + | 'lpromoter' | 'Mcircle' | 'Mdiamond' | 'Msquare' | 'none' | 'note' + | 'noverhang' | 'octagon' | 'oval' | 'parallelogram' | 'pentagon' + | 'plain' | 'plaintext' | 'point' | 'polygon' | 'primersite' | 'promoter' + | 'proteasesite' | 'proteinstab' | 'rarrow' | 'rect' | 'rectangle' + | 'restrictionsite' | 'ribosite' | 'rnastab' | 'rpromoter' | 'septagon' + | 'signature' | 'square' | 'star' | 'tab' | 'terminator' | 'threepoverhang' + | 'trapezium' | 'triangle' | 'tripleoctagon' | 'underline' | 'utr' -export {NodeShapes} \ No newline at end of file +export { NodeShapes }; diff --git a/lib/enums/Styles.ts b/lib/enums/Styles.ts index b40191a..d4d79d6 100644 --- a/lib/enums/Styles.ts +++ b/lib/enums/Styles.ts @@ -10,7 +10,8 @@ type EdgeStyles = type NodeStyles = - '' | 'bold' | 'dashed' | 'diagonals' | 'dotted' | 'filled' | 'invis' | 'rounded' | 'solid' | 'striped' | 'wedged' + '' | 'bold' | 'dashed' | 'diagonals' | 'dotted' + | 'filled' | 'invis' | 'rounded' | 'solid' | 'striped' | 'wedged' type GraphStyles = diff --git a/test/spec/Node.ts b/test/spec/Node.ts index f2fefbd..7e0a135 100644 --- a/test/spec/Node.ts +++ b/test/spec/Node.ts @@ -8,7 +8,8 @@ import { Node, Color } from '../../lib'; const serialized_simple -= 'bar_foo [label="baz", style="dashed", shape="tripleoctagon", color="#00ff00"]'; += 'bar_foo [label="baz", style="dashed",' ++ ' shape="tripleoctagon", color="#00ff00"]'; const serialized_table = `bar_foo [label=<
foobarbaz
barbazfoo