node shape
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-03-25 14:12:10 +01:00
parent 019647b04a
commit 78556c6c98
7 changed files with 78 additions and 26 deletions

View File

@ -6,6 +6,7 @@
*/
import { NodeStyles } from '../enums/Styles';
import { NodeShapes } from '../enums/Shapes';
import { Element } from './Element';
import { Color } from './Color';
@ -15,6 +16,7 @@ export class Node extends Element {
public table_contents?: Array<Array<string>>;
public style?: NodeStyles;
public color?: Color;
public shape?: NodeShapes;
public constructor (name: string, parent: string, label?: string) {
super (name, parent);
@ -47,6 +49,8 @@ export class Node extends Element {
}
if (this.style)
attributes.push ({ name: 'style', value: this.style.toString () });
if (this.shape)
attributes.push ({ name: 'shape', value: this.shape.toString () });
if (this.color)
attributes.push ({ name: 'color', value: this.color.toString () });

63
lib/enums/Shapes.ts Normal file
View File

@ -0,0 +1,63 @@
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'
export {NodeShapes}

View File

@ -6,34 +6,14 @@
*/
type EdgeStyles =
''
|'solid'
|'dashed'
|'dotted'
|'bold'
'' | 'bold' | 'dashed' | 'dotted' | 'solid'
type NodeStyles =
''
|'solid'
|'dashed'
|'dotted'
|'bold'
|'rounded'
|'diagonals'
|'filled'
|'striped'
|'wedged'
|'invis'
'' | 'bold' | 'dashed' | 'diagonals' | 'dotted' | 'filled' | 'invis' | 'rounded' | 'solid' | 'striped' | 'wedged'
type GraphStyles =
'solid'
| 'dashed'
| 'dotted'
| 'bold'
| 'rounded'
| 'filled'
| 'striped'
'bold' | 'dashed' | 'dotted' | 'filled' | 'rounded' | 'solid' | 'striped'
export { EdgeStyles, NodeStyles, GraphStyles };