graphviz-builder/lib/enums/GraphStreamCommand.ts

29 lines
591 B
TypeScript
Raw Normal View History

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 =
'cn'|
'en'|
'cug'|
'cdg'|
'csg'|
'eg'|
'at'|
'ce'
function translate_command (cmd: GraphStreamCommand|''): string {
const translations = {
cn: 'create node',
en: 'end 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 };