29 lines
591 B
TypeScript
29 lines
591 B
TypeScript
/* eslint-disable line-comment-position */
|
|
/* eslint-disable no-inline-comments */
|
|
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'
|
|
};
|
|
return `'${translations[cmd]}'`;
|
|
}
|
|
|
|
export { GraphStreamCommand, translate_command };
|