This commit is contained in:
parent
78556c6c98
commit
cef87ba4a5
@ -5,20 +5,13 @@
|
|||||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
* 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 { GraphLayouts } from '../enums/GraphLayouts';
|
||||||
import { Element } from './Element';
|
import { Element } from './Element';
|
||||||
import { Edge } from './Edge';
|
import { Edge } from './Edge';
|
||||||
import { Node } from './Node';
|
import { Node } from './Node';
|
||||||
import { Color } from './Color';
|
import { Color } from './Color';
|
||||||
|
|
||||||
interface NodeOptions {
|
|
||||||
name: string;
|
|
||||||
label: string;
|
|
||||||
style: NodeStyles;
|
|
||||||
color: Color;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Graph extends Element {
|
export class Graph extends Element {
|
||||||
public children: Array<Graph> = [];
|
public children: Array<Graph> = [];
|
||||||
public nodes: Array<Node> = [];
|
public nodes: Array<Node> = [];
|
||||||
|
@ -6,11 +6,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export type GraphLayouts =
|
export type GraphLayouts =
|
||||||
'neato'
|
'circo' | 'dot' | 'fdp' | 'neato' | 'osage' | 'patchwork' | 'sfdp' | 'twopi'
|
||||||
| 'dot'
|
|
||||||
| 'circo'
|
|
||||||
| 'fdp'
|
|
||||||
| 'sfdp'
|
|
||||||
| 'osage'
|
|
||||||
| 'twopi'
|
|
||||||
| 'patchwork'
|
|
||||||
|
@ -8,13 +8,7 @@
|
|||||||
/* eslint-disable line-comment-position */
|
/* eslint-disable line-comment-position */
|
||||||
/* eslint-disable no-inline-comments */
|
/* eslint-disable no-inline-comments */
|
||||||
type GraphStreamCommand =
|
type GraphStreamCommand =
|
||||||
'cn'|
|
'at' | 'cdg' | 'ce' | 'cn' | 'csg' | 'cug' | 'eg'
|
||||||
'cug'|
|
|
||||||
'cdg'|
|
|
||||||
'csg'|
|
|
||||||
'eg'|
|
|
||||||
'at'|
|
|
||||||
'ce'
|
|
||||||
|
|
||||||
function translate_command (cmd: GraphStreamCommand|''): string {
|
function translate_command (cmd: GraphStreamCommand|''): string {
|
||||||
const translations = {
|
const translations = {
|
||||||
|
@ -1,63 +1,14 @@
|
|||||||
type NodeShapes =
|
type NodeShapes =
|
||||||
''
|
'' | 'assembly' | 'box' | 'box3d' | 'cds' | 'circle' | 'component'
|
||||||
|'box'
|
| 'cylinder' | 'diamond' | 'doublecircle' | 'doubleoctagon' | 'egg'
|
||||||
|'polygon'
|
| 'ellipse' | 'fivepoverhang' | 'folder' | 'hexagon' | 'house'
|
||||||
|'ellipse'
|
| 'insulator' | 'invhouse' | 'invtrapezium' | 'invtriangle' | 'larrow'
|
||||||
|'oval'
|
| 'lpromoter' | 'Mcircle' | 'Mdiamond' | 'Msquare' | 'none' | 'note'
|
||||||
|'circle'
|
| 'noverhang' | 'octagon' | 'oval' | 'parallelogram' | 'pentagon'
|
||||||
|'point'
|
| 'plain' | 'plaintext' | 'point' | 'polygon' | 'primersite' | 'promoter'
|
||||||
|'egg'
|
| 'proteasesite' | 'proteinstab' | 'rarrow' | 'rect' | 'rectangle'
|
||||||
|'triangle'
|
| 'restrictionsite' | 'ribosite' | 'rnastab' | 'rpromoter' | 'septagon'
|
||||||
|'plaintext'
|
| 'signature' | 'square' | 'star' | 'tab' | 'terminator' | 'threepoverhang'
|
||||||
|'plain'
|
| 'trapezium' | 'triangle' | 'tripleoctagon' | 'underline' | 'utr'
|
||||||
|'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'
|
|
||||||
|
|
||||||
export {NodeShapes}
|
export { NodeShapes };
|
||||||
|
@ -10,7 +10,8 @@ type EdgeStyles =
|
|||||||
|
|
||||||
|
|
||||||
type NodeStyles =
|
type NodeStyles =
|
||||||
'' | 'bold' | 'dashed' | 'diagonals' | 'dotted' | 'filled' | 'invis' | 'rounded' | 'solid' | 'striped' | 'wedged'
|
'' | 'bold' | 'dashed' | 'diagonals' | 'dotted'
|
||||||
|
| 'filled' | 'invis' | 'rounded' | 'solid' | 'striped' | 'wedged'
|
||||||
|
|
||||||
|
|
||||||
type GraphStyles =
|
type GraphStyles =
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
import { Node, Color } from '../../lib';
|
import { Node, Color } from '../../lib';
|
||||||
|
|
||||||
const serialized_simple
|
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>
|
const serialized_table = `bar_foo [label=<<table>
|
||||||
<tr><td>foo</td><td>bar</td><td>baz</td></tr>
|
<tr><td>foo</td><td>bar</td><td>baz</td></tr>
|
||||||
<tr><td>bar</td><td>baz</td><td>foo</td></tr>
|
<tr><td>bar</td><td>baz</td><td>foo</td></tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user