2020-05-17 17:17:39 +02:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2020-05-06 20:24:37 +02:00
|
|
|
/* eslint-disable line-comment-position */
|
|
|
|
/* eslint-disable no-inline-comments */
|
2020-05-08 09:44:37 +02:00
|
|
|
type GraphStreamCommand =
|
2023-03-25 14:17:58 +01:00
|
|
|
'at' | 'cdg' | 'ce' | 'cn' | 'csg' | 'cug' | 'eg'
|
2020-05-08 09:44:37 +02:00
|
|
|
|
|
|
|
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'
|
|
|
|
};
|
2020-05-08 10:03:50 +02:00
|
|
|
return `'${translations[cmd]}'`;
|
2020-05-08 09:44:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export { GraphStreamCommand, translate_command };
|