Timo Hocker
cef87ba4a5
All checks were successful
continuous-integration/drone/push Build is passing
28 lines
787 B
TypeScript
28 lines
787 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 =
|
|
'at' | 'cdg' | 'ce' | 'cn' | 'csg' | 'cug' | 'eg'
|
|
|
|
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 };
|