This commit is contained in:
parent
78556c6c98
commit
cef87ba4a5
@ -5,20 +5,13 @@
|
||||
* Created by Timo Hocker <timo@scode.ovh>, 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<Graph> = [];
|
||||
public nodes: Array<Node> = [];
|
||||
|
@ -6,11 +6,4 @@
|
||||
*/
|
||||
|
||||
export type GraphLayouts =
|
||||
'neato'
|
||||
| 'dot'
|
||||
| 'circo'
|
||||
| 'fdp'
|
||||
| 'sfdp'
|
||||
| 'osage'
|
||||
| 'twopi'
|
||||
| 'patchwork'
|
||||
'circo' | 'dot' | 'fdp' | 'neato' | 'osage' | 'patchwork' | 'sfdp' | 'twopi'
|
||||
|
@ -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 = {
|
||||
|
@ -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}
|
||||
export { NodeShapes };
|
||||
|
@ -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 =
|
||||
|
@ -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=<<table>
|
||||
<tr><td>foo</td><td>bar</td><td>baz</td></tr>
|
||||
<tr><td>bar</td><td>baz</td><td>foo</td></tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user