2023-09-14 16:53:38 +03:00
|
|
|
// Module: Selector maps
|
|
|
|
import { LayoutTypes } from 'reagraph';
|
|
|
|
|
2023-09-21 14:58:01 +03:00
|
|
|
import { Grammeme, IGramData } from '../models/language';
|
2023-09-14 16:53:38 +03:00
|
|
|
import { CstType } from '../models/rsform';
|
|
|
|
import { ColoringScheme } from '../pages/RSFormPage/EditorTermGraph';
|
2023-09-21 14:58:01 +03:00
|
|
|
import { labelGrammeme } from './labels';
|
|
|
|
import { labelCstType } from './labels';
|
2023-09-14 16:53:38 +03:00
|
|
|
|
|
|
|
|
2023-09-19 17:55:17 +03:00
|
|
|
export const SelectorGraphLayout: { value: LayoutTypes, label: string }[] = [
|
2023-09-14 16:53:38 +03:00
|
|
|
{ value: 'treeTd2d', label: 'Граф: ДеревоВ 2D' },
|
|
|
|
{ value: 'treeTd3d', label: 'Граф: ДеревоВ 3D' },
|
|
|
|
{ value: 'forceatlas2', label: 'Граф: Атлас 2D' },
|
|
|
|
{ value: 'forceDirected2d', label: 'Граф: Силы 2D' },
|
|
|
|
{ value: 'forceDirected3d', label: 'Граф: Силы 3D' },
|
|
|
|
{ value: 'treeLr2d', label: 'Граф: ДеревоГ 2D' },
|
|
|
|
{ value: 'treeLr3d', label: 'Граф: ДеревоГ 3D' },
|
|
|
|
{ value: 'radialOut2d', label: 'Граф: Радиальная 2D' },
|
|
|
|
{ value: 'radialOut3d', label: 'Граф: Радиальная 3D' },
|
|
|
|
// { value: 'circular2d', label: 'circular2d'},
|
|
|
|
// { value: 'nooverlap', label: 'nooverlap'},
|
|
|
|
// { value: 'hierarchicalTd', label: 'hierarchicalTd'},
|
|
|
|
// { value: 'hierarchicalLr', label: 'hierarchicalLr'}
|
|
|
|
];
|
|
|
|
|
2023-09-19 17:55:17 +03:00
|
|
|
export const SelectorGraphColoring: { value: ColoringScheme, label: string }[] = [
|
2023-09-14 16:53:38 +03:00
|
|
|
{ value: 'none', label: 'Цвет: моно' },
|
|
|
|
{ value: 'status', label: 'Цвет: статус' },
|
|
|
|
{ value: 'type', label: 'Цвет: класс' },
|
|
|
|
];
|
|
|
|
|
|
|
|
export const SelectorCstType = (
|
|
|
|
Object.values(CstType)).map(
|
2023-09-21 14:58:01 +03:00
|
|
|
typeStr => ({
|
|
|
|
value: typeStr as CstType,
|
|
|
|
label: labelCstType(typeStr as CstType)
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
2023-09-21 23:09:51 +03:00
|
|
|
export interface IGrammemeOption extends IGramData {
|
2023-09-21 14:58:01 +03:00
|
|
|
value: Grammeme
|
|
|
|
label: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const SelectorGrammems: IGrammemeOption[] =
|
|
|
|
[
|
|
|
|
Grammeme.NOUN, Grammeme.VERB,
|
|
|
|
|
|
|
|
Grammeme.sing, Grammeme.plur,
|
|
|
|
Grammeme.nomn, Grammeme.gent, Grammeme.datv,
|
|
|
|
Grammeme.accs, Grammeme.ablt, Grammeme.loct,
|
|
|
|
|
|
|
|
Grammeme.INFN, Grammeme.ADJF, Grammeme.PRTF,
|
|
|
|
Grammeme.ADJS, Grammeme.PRTS,
|
|
|
|
|
|
|
|
Grammeme.perf, Grammeme.impf,
|
|
|
|
Grammeme.tran, Grammeme.intr,
|
|
|
|
Grammeme.pres, Grammeme.past, Grammeme.futr,
|
|
|
|
Grammeme.per1, Grammeme.per2, Grammeme.per3,
|
|
|
|
Grammeme.impr, Grammeme.indc,
|
|
|
|
Grammeme.incl, Grammeme.excl,
|
|
|
|
Grammeme.pssv, Grammeme.actv,
|
|
|
|
].map(
|
|
|
|
gram => ({
|
2023-09-21 23:09:51 +03:00
|
|
|
type: gram,
|
|
|
|
data: gram as string,
|
2023-09-21 14:58:01 +03:00
|
|
|
value: gram,
|
|
|
|
label: labelGrammeme({type: gram, data: ''} as IGramData)
|
|
|
|
}));
|