34 lines
793 B
TypeScript
34 lines
793 B
TypeScript
/*
|
|
* Copyright (C) Sapphirecode - All Rights Reserved
|
|
* This file is part of graphviz-builder which is released under MIT.
|
|
* See file 'LICENSE' for full license details.
|
|
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
|
*/
|
|
|
|
/* eslint-disable line-comment-position */
|
|
/* eslint-disable no-inline-comments */
|
|
type GraphStreamCommand =
|
|
'cn'|
|
|
'cug'|
|
|
'cdg'|
|
|
'csg'|
|
|
'eg'|
|
|
'at'|
|
|
'ce'
|
|
|
|
function translate_command (cmd: GraphStreamCommand|''): string {
|
|
const translations = {
|
|
cn: 'create node',
|
|
cug: 'create unordered graph',
|
|
cdg: 'create directional graph',
|
|
csg: 'create subgraph',
|
|
eg: 'end graph',
|
|
at: 'attributes',
|
|
ce: 'create edge',
|
|
'': 'start'
|
|
};
|
|
return `'${translations[cmd]}'`;
|
|
}
|
|
|
|
export { GraphStreamCommand, translate_command };
|