@reltio/components 1.4.1852 → 1.4.1854
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
- package/cjs/ConnectionEditor/ConnectionEditor.d.ts +3 -3
- package/cjs/ConnectionEditor/ConnectionEditor.test.js +2 -2
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
- package/cjs/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -20
- package/cjs/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
- package/cjs/DependentLookupEditor/DependentLookupEditor.js +3 -21
- package/cjs/DropDownEditor/DropDownEditor.d.ts +14 -15
- package/cjs/DropDownEditor/DropDownEditor.js +0 -6
- package/cjs/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
- package/cjs/EditModeAttributesList/EditModeAttributesList.js +0 -20
- package/cjs/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
- package/cjs/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
- package/cjs/EditModeAttributesPager/types.d.ts +7 -6
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
- package/cjs/EditModeComplexAttribute/EditModeComplexAttribute.js +6 -17
- package/cjs/EditModeComplexAttribute/index.d.ts +1 -0
- package/cjs/EntitySelector/EntitySelector.d.ts +19 -31
- package/cjs/EntitySelector/EntitySelector.js +0 -14
- package/cjs/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
- package/cjs/EntitySelector/components/EntityOption/EntityOption.js +0 -18
- package/cjs/ErrorWrapper/ErrorWrapper.d.ts +2 -2
- package/cjs/FilterEditor/FilterEditor.d.ts +16 -23
- package/cjs/FilterEditor/FilterEditor.js +2 -14
- package/cjs/FilterValueEditor/FilterValueEditor.d.ts +14 -24
- package/cjs/FilterValueEditor/FilterValueEditor.js +0 -9
- package/cjs/HOCs/withFilter/ColumnFilter.js +1 -1
- package/cjs/LookupEditor/LookupEditor.d.ts +11 -33
- package/cjs/LookupEditor/LookupEditor.js +1 -14
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
- package/cjs/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
- package/cjs/NestedAttribute/NestedAttribute.d.ts +4 -124
- package/cjs/NestedAttribute/NestedAttribute.js +0 -1
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
- package/cjs/NestedAttributeEditor/NestedAttributeEditor.js +0 -1
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
- package/cjs/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +0 -12
- package/cjs/ReadOnlyComplexAttribute/index.d.ts +1 -0
- package/cjs/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
- package/cjs/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
- package/cjs/ReferenceAttributeEditor/ReferenceAttributeEditor.js +2 -3
- package/cjs/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
- package/cjs/RelationTypeSelector/RelationTypeSelector.js +2 -14
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
- package/cjs/SimpleAttributeEditor/SimpleAttributeEditor.js +0 -17
- package/cjs/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
- package/cjs/components/ImageDetailsView/helpers/index.d.ts +5 -2
- package/cjs/components/ImportButton/ImportButton.d.ts +2 -1
- package/cjs/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
- package/cjs/components/MultipliableSelect/MultipliableSelect.js +0 -15
- package/cjs/components/ProfileBand/styles.d.ts +1 -1
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
- package/cjs/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
- package/cjs/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
- package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
- package/cjs/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
- package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
- package/cjs/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -51
- package/cjs/components/ReactSelect/AsyncSelect.d.ts +0 -45
- package/cjs/components/ReactSelect/CreatableSelect.d.ts +0 -45
- package/cjs/components/ReactSelect/Select.d.ts +0 -45
- package/cjs/components/ReactSelect/withMuiSkin.d.ts +3 -48
- package/cjs/components/ReactSelect/withMuiSkin.js +0 -50
- package/cjs/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
- package/cjs/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
- package/cjs/components/SearchInput/SearchInput.d.ts +1 -1
- package/cjs/components/SelectionPopup/SelectionPopup.d.ts +1 -1
- package/cjs/constants/index.d.ts +1 -1
- package/cjs/constants/index.js +1 -4
- package/cjs/constants/prop-types.d.ts +0 -81
- package/cjs/constants/prop-types.js +17 -46
- package/cjs/constants/textField.d.ts +2 -2
- package/cjs/contexts/ScrollToElementContext/index.d.ts +1 -1
- package/cjs/features/graph/DataModelGraph/DataModelGraph.d.ts +6 -5
- package/cjs/features/graph/DataModelGraph/DataModelGraph.js +4 -3
- package/cjs/features/graph/DataModelGraph/DataModelGraph.test.js +3 -8
- package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.d.ts → DataModelCircleLayout.d.ts} +2 -2
- package/cjs/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.js → DataModelCircleLayout.js} +5 -7
- package/cjs/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +4 -2
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +6 -5
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +43 -13
- package/cjs/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +39 -17
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +4 -3
- package/cjs/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +3 -3
- package/cjs/features/graph/index.d.ts +1 -1
- package/cjs/features/graph/rendering/canvas/label.js +1 -1
- package/cjs/features/graph/types/graphDataTypes.d.ts +2 -1
- package/cjs/helpers/basicTable.d.ts +2 -7
- package/cjs/hooks/useRelationTypeSelector.d.ts +12 -8
- package/cjs/hooks/useRelationTypeSelector.js +3 -1
- package/cjs/types/index.d.ts +19 -2
- package/esm/AttributesFiltersBuilder/AttributesFiltersBuilder.js +1 -1
- package/esm/ConnectionEditor/ConnectionEditor.d.ts +3 -3
- package/esm/ConnectionEditor/ConnectionEditor.test.js +2 -2
- package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.d.ts +14 -34
- package/esm/ConnectionRelationTypeSelector/ConnectionRelationTypeSelector.js +1 -17
- package/esm/DependentLookupEditor/DependentLookupEditor.d.ts +27 -44
- package/esm/DependentLookupEditor/DependentLookupEditor.js +4 -22
- package/esm/DropDownEditor/DropDownEditor.d.ts +14 -15
- package/esm/DropDownEditor/DropDownEditor.js +0 -6
- package/esm/EditModeAttributesList/EditModeAttributesList.d.ts +14 -3
- package/esm/EditModeAttributesList/EditModeAttributesList.js +1 -21
- package/esm/EditModeAttributesPager/EditModeAttributesPager.d.ts +3 -2
- package/esm/EditModeAttributesPager/components/AttributeRenderer/AttributeRenderer.d.ts +2 -3
- package/esm/EditModeAttributesPager/types.d.ts +7 -6
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.d.ts +41 -4
- package/esm/EditModeComplexAttribute/EditModeComplexAttribute.js +7 -18
- package/esm/EditModeComplexAttribute/index.d.ts +1 -0
- package/esm/EntitySelector/EntitySelector.d.ts +19 -31
- package/esm/EntitySelector/EntitySelector.js +1 -15
- package/esm/EntitySelector/components/EntityOption/EntityOption.d.ts +17 -22
- package/esm/EntitySelector/components/EntityOption/EntityOption.js +0 -18
- package/esm/ErrorWrapper/ErrorWrapper.d.ts +2 -2
- package/esm/FilterEditor/FilterEditor.d.ts +16 -23
- package/esm/FilterEditor/FilterEditor.js +3 -15
- package/esm/FilterValueEditor/FilterValueEditor.d.ts +14 -24
- package/esm/FilterValueEditor/FilterValueEditor.js +1 -10
- package/esm/HOCs/withFilter/ColumnFilter.js +1 -1
- package/esm/LookupEditor/LookupEditor.d.ts +11 -33
- package/esm/LookupEditor/LookupEditor.js +1 -11
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.d.ts +11 -21
- package/esm/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.js +0 -7
- package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.d.ts +9 -2
- package/esm/LookupEditor/components/GroupedDropDownEditor/helpers.js +7 -7
- package/esm/LookupEditor/components/GroupedDropDownEditor/styles.d.ts +1 -1
- package/esm/NestedAttribute/NestedAttribute.d.ts +4 -124
- package/esm/NestedAttribute/NestedAttribute.js +1 -2
- package/esm/NestedAttributeEditor/NestedAttributeEditor.d.ts +5 -1
- package/esm/NestedAttributeEditor/NestedAttributeEditor.js +1 -2
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.d.ts +14 -44
- package/esm/ReadOnlyComplexAttribute/ReadOnlyComplexAttribute.js +1 -13
- package/esm/ReadOnlyComplexAttribute/index.d.ts +1 -0
- package/esm/ReferenceAttribute/ReferenceAttribute.d.ts +3 -24
- package/esm/ReferenceAttribute/ReferenceAttribute.test.js +2 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.d.ts +5 -2
- package/esm/ReferenceAttributeEditor/ReferenceAttributeEditor.js +3 -4
- package/esm/RelationTypeSelector/RelationTypeSelector.d.ts +9 -26
- package/esm/RelationTypeSelector/RelationTypeSelector.js +2 -14
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.d.ts +39 -16
- package/esm/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -18
- package/esm/SimpleAttributeEditor/useAttributeValuePermissions.d.ts +1 -1
- package/esm/components/ImageDetailsView/helpers/index.d.ts +5 -2
- package/esm/components/ImportButton/ImportButton.d.ts +2 -1
- package/esm/components/MultipliableSelect/MultipliableSelect.d.ts +20 -30
- package/esm/components/MultipliableSelect/MultipliableSelect.js +0 -15
- package/esm/components/ProfileBand/styles.d.ts +1 -1
- package/esm/components/QueryBuilderRow/QueryBuilderRow.d.ts +43 -107
- package/esm/components/QueryBuilderRow/QueryBuilderRow.js +0 -25
- package/esm/components/QueryBuilderRow/components/ReadOnlyFilter.d.ts +4 -3
- package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.d.ts +4 -10
- package/esm/components/QueryBuilderRow/components/ReadOnlyLogicOperator.js +1 -6
- package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.d.ts +33 -64
- package/esm/components/QueryBuilderRowsGroup/QueryBuilderRowsGroup.js +3 -28
- package/esm/components/ReactSelect/AsyncSelect.d.ts +0 -45
- package/esm/components/ReactSelect/CreatableSelect.d.ts +0 -45
- package/esm/components/ReactSelect/Select.d.ts +0 -45
- package/esm/components/ReactSelect/withMuiSkin.d.ts +3 -48
- package/esm/components/ReactSelect/withMuiSkin.js +0 -50
- package/esm/components/ReactSortableTree/node-renderer-default.d.ts +2 -2
- package/esm/components/ReadableSearchQuery/ReadableSearchQuery.d.ts +2 -4
- package/esm/components/SearchInput/SearchInput.d.ts +1 -1
- package/esm/components/SelectionPopup/SelectionPopup.d.ts +1 -1
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/constants/prop-types.d.ts +0 -81
- package/esm/constants/prop-types.js +17 -38
- package/esm/constants/textField.d.ts +2 -2
- package/esm/contexts/ScrollToElementContext/index.d.ts +1 -1
- package/esm/features/graph/DataModelGraph/DataModelGraph.d.ts +6 -5
- package/esm/features/graph/DataModelGraph/DataModelGraph.js +4 -3
- package/esm/features/graph/DataModelGraph/DataModelGraph.test.js +3 -8
- package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.d.ts → DataModelCircleLayout.d.ts} +2 -2
- package/esm/features/graph/DataModelGraph/components/DataModelCircleLayout/{DataModelCircleLayuot.js → DataModelCircleLayout.js} +3 -5
- package/esm/features/graph/DataModelGraph/hooks/defaultGraph.test-data.js +4 -2
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.d.ts +6 -5
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.js +44 -14
- package/esm/features/graph/DataModelGraph/hooks/useDataModelGraphAppearance.test.js +40 -18
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.js +4 -3
- package/esm/features/graph/DataModelGraph/hooks/useEdgeLabelsRenderer.test.js +3 -3
- package/esm/features/graph/index.d.ts +1 -1
- package/esm/features/graph/rendering/canvas/label.js +1 -1
- package/esm/features/graph/types/graphDataTypes.d.ts +2 -1
- package/esm/helpers/basicTable.d.ts +2 -7
- package/esm/hooks/useRelationTypeSelector.d.ts +12 -8
- package/esm/hooks/useRelationTypeSelector.js +3 -1
- package/esm/types/index.d.ts +19 -2
- package/package.json +2 -2
|
@@ -21,7 +21,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import PropTypes from 'prop-types';
|
|
25
24
|
import skinComponents from './commonComponents';
|
|
26
25
|
import useStyles from './styles';
|
|
27
26
|
import { mergeClasses } from '../../core/utils';
|
|
@@ -38,54 +37,5 @@ export default function withMuiSkin(SelectComponent) {
|
|
|
38
37
|
components: {},
|
|
39
38
|
classes: {}
|
|
40
39
|
};
|
|
41
|
-
WrappedSelectComponent.propTypes = {
|
|
42
|
-
/* You could redefine any of these components */
|
|
43
|
-
components: PropTypes.shape({
|
|
44
|
-
ClearIndicator: PropTypes.func,
|
|
45
|
-
Control: PropTypes.func,
|
|
46
|
-
DropdownIndicator: PropTypes.func,
|
|
47
|
-
DownChevron: PropTypes.func,
|
|
48
|
-
CrossIcon: PropTypes.func,
|
|
49
|
-
Group: PropTypes.func,
|
|
50
|
-
GroupHeading: PropTypes.func,
|
|
51
|
-
IndicatorsContainer: PropTypes.func,
|
|
52
|
-
IndicatorSeparator: PropTypes.func,
|
|
53
|
-
Input: PropTypes.func,
|
|
54
|
-
LoadingIndicator: PropTypes.func,
|
|
55
|
-
Menu: PropTypes.func,
|
|
56
|
-
MenuList: PropTypes.func,
|
|
57
|
-
MenuPortal: PropTypes.func,
|
|
58
|
-
LoadingMessage: PropTypes.func,
|
|
59
|
-
NoOptionsMessage: PropTypes.func,
|
|
60
|
-
MultiValue: PropTypes.func,
|
|
61
|
-
MultiValueContainer: PropTypes.func,
|
|
62
|
-
MultiValueLabel: PropTypes.func,
|
|
63
|
-
MultiValueRemove: PropTypes.func,
|
|
64
|
-
Option: PropTypes.func,
|
|
65
|
-
Placeholder: PropTypes.func,
|
|
66
|
-
SelectContainer: PropTypes.func,
|
|
67
|
-
SingleValue: PropTypes.func,
|
|
68
|
-
ValueContainer: PropTypes.func
|
|
69
|
-
}),
|
|
70
|
-
/* Classes are passed to mui skin components. Provided classes will be merged with existing ones. */
|
|
71
|
-
classes: PropTypes.shape({
|
|
72
|
-
control: PropTypes.string,
|
|
73
|
-
valueContainer: PropTypes.string,
|
|
74
|
-
multiValue: PropTypes.string,
|
|
75
|
-
noOptionsMessage: PropTypes.string,
|
|
76
|
-
singleValue: PropTypes.string,
|
|
77
|
-
placeholder: PropTypes.string,
|
|
78
|
-
menu: PropTypes.string,
|
|
79
|
-
clearIndicator: PropTypes.string,
|
|
80
|
-
dropdownIndicator: PropTypes.string,
|
|
81
|
-
option: PropTypes.string,
|
|
82
|
-
'option--selected': PropTypes.string
|
|
83
|
-
}),
|
|
84
|
-
/* Props from https://material-ui.com/api/text-field/ */
|
|
85
|
-
TextFieldProps: PropTypes.object,
|
|
86
|
-
error: PropTypes.bool,
|
|
87
|
-
/* Plus all necessary props for wrapped react-select component. See docs on https://react-select.com */
|
|
88
|
-
innerRef: PropTypes.object
|
|
89
|
-
};
|
|
90
40
|
return WrappedSelectComponent;
|
|
91
41
|
}
|
|
@@ -43,9 +43,9 @@ declare namespace NodeRendererDefault {
|
|
|
43
43
|
}
|
|
44
44
|
namespace propTypes {
|
|
45
45
|
export let node: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
46
|
-
let title_1: PropTypes.Requireable<NonNullable<((...args: any[]) => any)
|
|
46
|
+
let title_1: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
47
47
|
export { title_1 as title };
|
|
48
|
-
let subtitle_1: PropTypes.Requireable<NonNullable<((...args: any[]) => any)
|
|
48
|
+
let subtitle_1: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
49
49
|
export { subtitle_1 as subtitle };
|
|
50
50
|
export let path: PropTypes.Validator<NonNullable<string | number>[]>;
|
|
51
51
|
export let treeIndex: PropTypes.Validator<number>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReadableQueryPrimitive } from '@reltio/mdm-sdk';
|
|
3
|
-
|
|
3
|
+
declare const ReadableSearchQuery: React.ForwardRefExoticComponent<{
|
|
4
4
|
readableQuery?: ReadableQueryPrimitive[];
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
declare const ReadableSearchQuery: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
5
|
+
} & React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLElement>>;
|
|
8
6
|
export default ReadableSearchQuery;
|
|
@@ -3,7 +3,7 @@ import { InputProps } from '@mui/material/Input';
|
|
|
3
3
|
export type SearchInputProps = InputProps & {
|
|
4
4
|
value?: string;
|
|
5
5
|
autofocus?: boolean;
|
|
6
|
-
onSearch
|
|
6
|
+
onSearch?: (value?: string) => void;
|
|
7
7
|
rootRef?: React.MutableRefObject<HTMLInputElement>;
|
|
8
8
|
height: number;
|
|
9
9
|
placeholder?: string;
|
|
@@ -7,7 +7,7 @@ type Props = {
|
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
PaperProps?: Record<string, unknown>;
|
|
9
9
|
searchInputOnKeyDown: (event: React.KeyboardEvent) => void;
|
|
10
|
-
onSearch
|
|
10
|
+
onSearch?: (value?: string) => void;
|
|
11
11
|
className?: string;
|
|
12
12
|
hideTitle?: boolean;
|
|
13
13
|
hideSearchInput?: boolean;
|
package/esm/constants/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SortingType,
|
|
1
|
+
export { SortingType, QueryBuilderAttributeType } from './prop-types';
|
|
2
2
|
export { COMMENTS_CONTAINER_VISIBILITY_AREA } from './classnames';
|
|
3
3
|
export { ALWAYS_VISIBLE_TYPE_URIS } from './attributes';
|
|
4
4
|
export { MAP_DRAWING_MODES, DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from './map';
|
package/esm/constants/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SortingType,
|
|
1
|
+
export { SortingType, QueryBuilderAttributeType } from './prop-types';
|
|
2
2
|
export { COMMENTS_CONTAINER_VISIBILITY_AREA } from './classnames';
|
|
3
3
|
export { ALWAYS_VISIBLE_TYPE_URIS } from './attributes';
|
|
4
4
|
export { MAP_DRAWING_MODES, DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from './map';
|
|
@@ -1,88 +1,7 @@
|
|
|
1
|
-
export const SelectValueType: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
2
|
-
export const DropDownEntryType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
3
|
-
value: PropTypes.Validator<NonNullable<NonNullable<string | number | object>>>;
|
|
4
|
-
label: PropTypes.Requireable<string>;
|
|
5
|
-
}>>;
|
|
6
|
-
export const DropDownGroupEntryType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
|
-
label: PropTypes.Validator<string>;
|
|
8
|
-
values: PropTypes.Validator<object[]>;
|
|
9
|
-
}>>;
|
|
10
|
-
export const ColumnDataType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
-
id: PropTypes.Requireable<string>;
|
|
12
|
-
label: PropTypes.Requireable<string>;
|
|
13
|
-
dataTypeDefinition: PropTypes.Requireable<object>;
|
|
14
|
-
resizable: PropTypes.Requireable<boolean>;
|
|
15
|
-
sortable: PropTypes.Requireable<boolean>;
|
|
16
|
-
filterable: PropTypes.Requireable<boolean>;
|
|
17
|
-
headCellRenderer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
rowCellValueRenderer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
-
nestedPath: PropTypes.Requireable<string[]>;
|
|
20
|
-
}>>;
|
|
21
1
|
export const SortingType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
22
2
|
field: PropTypes.Requireable<string>;
|
|
23
3
|
order: PropTypes.Requireable<string>;
|
|
24
4
|
}>>;
|
|
25
|
-
export const ColumnFilterType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
26
|
-
value: PropTypes.Requireable<NonNullable<NonNullable<NonNullable<string | number | boolean | PropTypes.InferProps<{
|
|
27
|
-
value: PropTypes.Requireable<string>;
|
|
28
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
29
|
-
}>> | NonNullable<string | number | boolean | PropTypes.InferProps<{
|
|
30
|
-
value: PropTypes.Requireable<string>;
|
|
31
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
32
|
-
}>>[]> | NonNullable<NonNullable<string | number | boolean | PropTypes.InferProps<{
|
|
33
|
-
value: PropTypes.Requireable<string>;
|
|
34
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
35
|
-
}>> | NonNullable<string | number | boolean | PropTypes.InferProps<{
|
|
36
|
-
value: PropTypes.Requireable<string>;
|
|
37
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
38
|
-
}>>[]>[]>>;
|
|
39
|
-
filter: PropTypes.Requireable<string>;
|
|
40
|
-
}>>;
|
|
41
|
-
export const ColumnsDataType: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
42
|
-
id: PropTypes.Requireable<string>;
|
|
43
|
-
label: PropTypes.Requireable<string>;
|
|
44
|
-
dataTypeDefinition: PropTypes.Requireable<object>;
|
|
45
|
-
}>[] | PropTypes.InferProps<{
|
|
46
|
-
id: PropTypes.Requireable<string>;
|
|
47
|
-
label: PropTypes.Requireable<string>;
|
|
48
|
-
columns: PropTypes.Requireable<PropTypes.InferProps<{
|
|
49
|
-
id: PropTypes.Requireable<string>;
|
|
50
|
-
label: PropTypes.Requireable<string>;
|
|
51
|
-
dataTypeDefinition: PropTypes.Requireable<object>;
|
|
52
|
-
}>[]>;
|
|
53
|
-
}>[]>>;
|
|
54
|
-
export const GroupedColumnsDataType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
55
|
-
id: PropTypes.Requireable<string>;
|
|
56
|
-
label: PropTypes.Requireable<string>;
|
|
57
|
-
columns: PropTypes.Requireable<PropTypes.InferProps<{
|
|
58
|
-
id: PropTypes.Requireable<string>;
|
|
59
|
-
label: PropTypes.Requireable<string>;
|
|
60
|
-
dataTypeDefinition: PropTypes.Requireable<object>;
|
|
61
|
-
}>[]>;
|
|
62
|
-
}>[]>;
|
|
63
|
-
export const QueryBuilderAttributeDataType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
64
|
-
title: PropTypes.Requireable<string>;
|
|
65
|
-
pathToTitle: PropTypes.Requireable<string[]>;
|
|
66
|
-
fieldName: PropTypes.Requireable<string>;
|
|
67
|
-
entityTypeUri: PropTypes.Requireable<string>;
|
|
68
|
-
attrType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
69
|
-
label: PropTypes.Requireable<string>;
|
|
70
|
-
name: PropTypes.Requireable<string>;
|
|
71
|
-
description: PropTypes.Requireable<string>;
|
|
72
|
-
type: PropTypes.Requireable<string>;
|
|
73
|
-
hidden: PropTypes.Requireable<boolean>;
|
|
74
|
-
faceted: PropTypes.Requireable<boolean>;
|
|
75
|
-
searchable: PropTypes.Requireable<boolean>;
|
|
76
|
-
uri: PropTypes.Requireable<string>;
|
|
77
|
-
access: PropTypes.Requireable<string[]>;
|
|
78
|
-
cardinality: PropTypes.Requireable<PropTypes.InferProps<{
|
|
79
|
-
minValue: PropTypes.Requireable<number>;
|
|
80
|
-
maxValue: PropTypes.Requireable<number>;
|
|
81
|
-
}>>;
|
|
82
|
-
}>>;
|
|
83
|
-
uri: PropTypes.Requireable<string>;
|
|
84
|
-
groupName: PropTypes.Requireable<string>;
|
|
85
|
-
}>>;
|
|
86
5
|
export const QueryBuilderAttributeType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
87
6
|
id: PropTypes.Requireable<NonNullable<string | number>>;
|
|
88
7
|
values: PropTypes.Requireable<any[]>;
|
|
@@ -1,50 +1,29 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { AttributeTypeType, FilterValueType, SortOrderType } from '@reltio/mdm-sdk';
|
|
3
|
-
var SelectValueType = PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]);
|
|
4
|
-
var DropDownEntryType = PropTypes.shape({
|
|
5
|
-
value: SelectValueType.isRequired,
|
|
6
|
-
label: PropTypes.string
|
|
7
|
-
});
|
|
8
|
-
var DropDownGroupEntryType = PropTypes.shape({
|
|
9
|
-
label: PropTypes.string.isRequired,
|
|
10
|
-
values: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
11
|
-
});
|
|
12
|
-
var ColumnDataType = PropTypes.shape({
|
|
13
|
-
id: PropTypes.string,
|
|
14
|
-
label: PropTypes.string,
|
|
15
|
-
dataTypeDefinition: PropTypes.object,
|
|
16
|
-
resizable: PropTypes.bool,
|
|
17
|
-
sortable: PropTypes.bool,
|
|
18
|
-
filterable: PropTypes.bool,
|
|
19
|
-
headCellRenderer: PropTypes.func,
|
|
20
|
-
rowCellValueRenderer: PropTypes.func,
|
|
21
|
-
nestedPath: PropTypes.arrayOf(PropTypes.string)
|
|
22
|
-
});
|
|
23
2
|
var SortingType = PropTypes.shape({
|
|
24
3
|
field: PropTypes.string,
|
|
25
|
-
order:
|
|
4
|
+
order: PropTypes.oneOf(['asc', 'desc'])
|
|
26
5
|
});
|
|
27
|
-
var
|
|
28
|
-
value: PropTypes.oneOfType([FilterValueType, PropTypes.arrayOf(FilterValueType)]),
|
|
29
|
-
filter: PropTypes.string
|
|
30
|
-
});
|
|
31
|
-
var PlainColumnsDataType = PropTypes.arrayOf(PropTypes.shape({
|
|
32
|
-
id: PropTypes.string,
|
|
33
|
-
label: PropTypes.string,
|
|
34
|
-
dataTypeDefinition: PropTypes.object
|
|
35
|
-
}));
|
|
36
|
-
var GroupedColumnsDataType = PropTypes.arrayOf(PropTypes.shape({
|
|
37
|
-
id: PropTypes.string,
|
|
6
|
+
var AttrType = PropTypes.shape({
|
|
38
7
|
label: PropTypes.string,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
8
|
+
name: PropTypes.string,
|
|
9
|
+
description: PropTypes.string,
|
|
10
|
+
type: PropTypes.string,
|
|
11
|
+
hidden: PropTypes.bool,
|
|
12
|
+
faceted: PropTypes.bool,
|
|
13
|
+
searchable: PropTypes.bool,
|
|
14
|
+
uri: PropTypes.string,
|
|
15
|
+
access: PropTypes.arrayOf(PropTypes.string),
|
|
16
|
+
cardinality: PropTypes.shape({
|
|
17
|
+
minValue: PropTypes.number,
|
|
18
|
+
maxValue: PropTypes.number
|
|
19
|
+
})
|
|
20
|
+
});
|
|
42
21
|
var QueryBuilderAttributeDataType = PropTypes.shape({
|
|
43
22
|
title: PropTypes.string,
|
|
44
23
|
pathToTitle: PropTypes.arrayOf(PropTypes.string),
|
|
45
24
|
fieldName: PropTypes.string,
|
|
46
25
|
entityTypeUri: PropTypes.string,
|
|
47
|
-
attrType:
|
|
26
|
+
attrType: AttrType,
|
|
48
27
|
uri: PropTypes.string,
|
|
49
28
|
groupName: PropTypes.string
|
|
50
29
|
});
|
|
@@ -55,4 +34,4 @@ var QueryBuilderAttributeType = PropTypes.shape({
|
|
|
55
34
|
filter: PropTypes.string,
|
|
56
35
|
operator: PropTypes.string
|
|
57
36
|
});
|
|
58
|
-
export {
|
|
37
|
+
export { SortingType, QueryBuilderAttributeType };
|
|
@@ -6,7 +6,7 @@ export declare enum ScrollType {
|
|
|
6
6
|
NewView = "NewView"
|
|
7
7
|
}
|
|
8
8
|
type ScrollToElementContextProps = {
|
|
9
|
-
element:
|
|
9
|
+
element: AttributeError | AttributeType | string;
|
|
10
10
|
type: ScrollType;
|
|
11
11
|
highlightError?: (element: AttributeError) => void;
|
|
12
12
|
highlightAttribute?: (element: AttributeType) => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Graph from 'graphology';
|
|
3
|
+
import { DataModelGraphEdgeAttributes, DataModelGraphNodeAttributes } from '../types/graphDataTypes';
|
|
3
4
|
type Props = {
|
|
4
|
-
graph
|
|
5
|
+
graph: Graph<Partial<DataModelGraphNodeAttributes>, Partial<DataModelGraphEdgeAttributes>>;
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
selectedNode?: string;
|
|
7
|
-
onNodeClick
|
|
8
|
-
|
|
9
|
-
onEdgeLabelClick
|
|
8
|
+
onNodeClick?: (nodeId: string) => void;
|
|
9
|
+
selectedEdges?: string[];
|
|
10
|
+
onEdgeLabelClick?: (edgeId: string, event: MouseEvent) => void;
|
|
10
11
|
hideInteractionTypes?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const DataModelGraph: ({ graph, children, selectedNode, onNodeClick,
|
|
13
|
+
export declare const DataModelGraph: ({ graph, children, selectedNode, onNodeClick, selectedEdges, onEdgeLabelClick, hideInteractionTypes }: Props) => JSX.Element;
|
|
13
14
|
export default DataModelGraph;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { noop } from '../../../core';
|
|
2
3
|
import { SigmaGraphContainer } from '../SigmaGraphContainer/SigmaGraphContainer';
|
|
3
|
-
import {
|
|
4
|
+
import { DataModelCircleLayout } from './components/DataModelCircleLayout/DataModelCircleLayout';
|
|
4
5
|
import { ZoomSlider } from '../ZoomSlider';
|
|
5
6
|
import { useStyles } from './styles';
|
|
6
7
|
var settings = {
|
|
@@ -8,12 +9,12 @@ var settings = {
|
|
|
8
9
|
zIndex: true
|
|
9
10
|
};
|
|
10
11
|
export var DataModelGraph = function (_a) {
|
|
11
|
-
var graph = _a.graph, children = _a.children, selectedNode = _a.selectedNode,
|
|
12
|
+
var graph = _a.graph, children = _a.children, selectedNode = _a.selectedNode, _b = _a.onNodeClick, onNodeClick = _b === void 0 ? noop : _b, selectedEdges = _a.selectedEdges, _c = _a.onEdgeLabelClick, onEdgeLabelClick = _c === void 0 ? noop : _c, hideInteractionTypes = _a.hideInteractionTypes;
|
|
12
13
|
var styles = useStyles();
|
|
13
14
|
return (React.createElement("div", { className: styles.wrapper },
|
|
14
15
|
React.createElement("div", { className: styles.graph }, graph && (React.createElement(SigmaGraphContainer, { initialSettings: settings },
|
|
15
16
|
React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement(
|
|
17
|
+
React.createElement(DataModelCircleLayout, { graph: graph, selectedNode: selectedNode, onNodeClick: onNodeClick, selectedEdges: selectedEdges, onEdgeLabelClick: onEdgeLabelClick, hideInteractionTypes: hideInteractionTypes }),
|
|
17
18
|
React.createElement("div", { className: styles.rightBottomControls },
|
|
18
19
|
React.createElement(ZoomSlider, { className: styles.zoomSlider, min: 30, max: 300 })))))),
|
|
19
20
|
children));
|
|
@@ -3,7 +3,6 @@ import Graph from 'graphology';
|
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
4
|
import { DataModelGraph } from '../DataModelGraph';
|
|
5
5
|
import { useDataModelGraphAppearance } from './hooks/useDataModelGraphAppearance';
|
|
6
|
-
import { useFakeCenterNode } from './hooks/useFakeCenterNode';
|
|
7
6
|
import { useCircleLayout } from '../hooks/useCircleLayout';
|
|
8
7
|
jest.mock('@react-sigma/core', function () { return ({
|
|
9
8
|
SigmaContainer: function (_a) {
|
|
@@ -24,9 +23,6 @@ jest.mock('../hooks/useSigmaCustomRenderers', function () { return ({
|
|
|
24
23
|
jest.mock('./hooks/useDataModelGraphAppearance', function () { return ({
|
|
25
24
|
useDataModelGraphAppearance: jest.fn()
|
|
26
25
|
}); });
|
|
27
|
-
jest.mock('./hooks/useFakeCenterNode', function () { return ({
|
|
28
|
-
useFakeCenterNode: jest.fn()
|
|
29
|
-
}); });
|
|
30
26
|
jest.mock('../ZoomSlider', function () { return ({
|
|
31
27
|
ZoomSlider: function () { return React.createElement("div", null, "ZoomSlider"); }
|
|
32
28
|
}); });
|
|
@@ -34,10 +30,10 @@ describe('DataModelGraph tests', function () {
|
|
|
34
30
|
var graph = new Graph();
|
|
35
31
|
var selectedNode = 'node1';
|
|
36
32
|
var onNodeClick = jest.fn();
|
|
37
|
-
var
|
|
33
|
+
var selectedEdges = ['edge1'];
|
|
38
34
|
var onEdgeLabelClick = jest.fn();
|
|
39
35
|
var setUp = function () {
|
|
40
|
-
render(React.createElement(DataModelGraph, { graph: graph, selectedNode: selectedNode, onNodeClick: onNodeClick,
|
|
36
|
+
render(React.createElement(DataModelGraph, { graph: graph, selectedNode: selectedNode, onNodeClick: onNodeClick, selectedEdges: selectedEdges, onEdgeLabelClick: onEdgeLabelClick, hideInteractionTypes: false }));
|
|
41
37
|
};
|
|
42
38
|
afterEach(function () {
|
|
43
39
|
jest.clearAllMocks();
|
|
@@ -47,11 +43,10 @@ describe('DataModelGraph tests', function () {
|
|
|
47
43
|
expect(useDataModelGraphAppearance).toHaveBeenCalledWith(expect.objectContaining({
|
|
48
44
|
graph: graph,
|
|
49
45
|
selectedNode: selectedNode,
|
|
50
|
-
|
|
46
|
+
selectedEdges: selectedEdges,
|
|
51
47
|
onNodeClick: onNodeClick,
|
|
52
48
|
onEdgeLabelClick: onEdgeLabelClick
|
|
53
49
|
}));
|
|
54
|
-
expect(useFakeCenterNode).toHaveBeenCalledWith(expect.objectContaining({ graph: graph, timeout: 3100 }));
|
|
55
50
|
expect(useCircleLayout).toHaveBeenCalledWith(expect.objectContaining({ graph: graph, animationDuration: 3000 }));
|
|
56
51
|
expect(screen.getByText('ZoomSlider')).toBeInTheDocument();
|
|
57
52
|
});
|
|
@@ -3,10 +3,10 @@ type Props = {
|
|
|
3
3
|
graph: Graph;
|
|
4
4
|
selectedNode?: string;
|
|
5
5
|
onNodeClick: (nodeId: string) => void;
|
|
6
|
-
|
|
6
|
+
selectedEdges?: string[];
|
|
7
7
|
onEdgeLabelClick: (edgeId: string, event: MouseEvent) => void;
|
|
8
8
|
hideInteractionTypes?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const LAYOUT_ANIMATION_DURATION = 3000;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const DataModelCircleLayout: ({ graph, selectedNode, onNodeClick, selectedEdges, onEdgeLabelClick, hideInteractionTypes }: Props) => any;
|
|
12
12
|
export {};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { useCircleLayout } from '../../../hooks/useCircleLayout';
|
|
2
|
-
import { useFakeCenterNode } from '../../hooks/useFakeCenterNode';
|
|
3
2
|
import { useDataModelGraphAppearance } from '../../hooks/useDataModelGraphAppearance';
|
|
4
3
|
export var LAYOUT_ANIMATION_DURATION = 3000;
|
|
5
|
-
export var
|
|
6
|
-
var graph = _a.graph, selectedNode = _a.selectedNode, onNodeClick = _a.onNodeClick,
|
|
7
|
-
useFakeCenterNode({ graph: graph, timeout: LAYOUT_ANIMATION_DURATION + 100 });
|
|
4
|
+
export var DataModelCircleLayout = function (_a) {
|
|
5
|
+
var graph = _a.graph, selectedNode = _a.selectedNode, onNodeClick = _a.onNodeClick, selectedEdges = _a.selectedEdges, onEdgeLabelClick = _a.onEdgeLabelClick, hideInteractionTypes = _a.hideInteractionTypes;
|
|
8
6
|
useCircleLayout({ graph: graph, animationDuration: LAYOUT_ANIMATION_DURATION });
|
|
9
7
|
useDataModelGraphAppearance({
|
|
10
8
|
graph: graph,
|
|
11
9
|
selectedNode: selectedNode,
|
|
12
|
-
|
|
10
|
+
selectedEdges: selectedEdges,
|
|
13
11
|
onNodeClick: onNodeClick,
|
|
14
12
|
onEdgeLabelClick: onEdgeLabelClick,
|
|
15
13
|
hideInteractionTypes: hideInteractionTypes
|
|
@@ -33,10 +33,12 @@ export var createDefaultGraph = function () {
|
|
|
33
33
|
y: 200
|
|
34
34
|
});
|
|
35
35
|
graph.addEdgeWithKey('hcp->hca', 'hcp', 'hca', {
|
|
36
|
-
label: '1'
|
|
36
|
+
label: '1',
|
|
37
|
+
relationTypes: [{ uri: 'relType1' }]
|
|
37
38
|
});
|
|
38
39
|
graph.addEdgeWithKey('hca->gpo', 'hca', 'gpo', {
|
|
39
|
-
label: '2'
|
|
40
|
+
label: '2',
|
|
41
|
+
relationTypes: [{ uri: 'relType2' }]
|
|
40
42
|
});
|
|
41
43
|
graph.addEdgeWithKey('hcp->prescriptions', 'hcp', 'prescriptions', {
|
|
42
44
|
type: 'dashed'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Graph from 'graphology';
|
|
2
|
-
export declare const EDGE_COLOR = "rgba(
|
|
3
|
-
export declare const DASHED_EDGE_COLOR = "rgba(
|
|
2
|
+
export declare const EDGE_COLOR = "rgba(0, 0, 0, 0.2)";
|
|
3
|
+
export declare const DASHED_EDGE_COLOR = "rgba(0, 0, 0, 0.2)";
|
|
4
4
|
export declare const INACTIVE_EDGE_COLOR = "rgba(224, 224, 224, 1)";
|
|
5
5
|
export declare const SELECTED_EDGE_COLOR = "rgba(79, 79, 79, 1)";
|
|
6
6
|
export declare const RELATED_EDGE_COLOR = "rgba(130, 130, 130, 1)";
|
|
@@ -8,11 +8,12 @@ export declare const RELATED_DASHED_EDGE_COLOR = "rgba(79, 79, 79, 1)";
|
|
|
8
8
|
export declare const INACTIVE_LABEL_COLOR = "rgba(0, 0, 0, 0.38)";
|
|
9
9
|
type Props = {
|
|
10
10
|
graph: Graph;
|
|
11
|
-
selectedNode
|
|
12
|
-
|
|
11
|
+
selectedNode?: string;
|
|
12
|
+
selectedEdges?: string[];
|
|
13
13
|
onNodeClick: (node: string) => void;
|
|
14
14
|
onEdgeLabelClick: (edgeId: string, event: MouseEvent) => void;
|
|
15
15
|
hideInteractionTypes?: boolean;
|
|
16
|
+
relationEdgesLabelsAmountThreshold?: number;
|
|
16
17
|
};
|
|
17
|
-
export declare const useDataModelGraphAppearance: ({ graph, selectedNode,
|
|
18
|
+
export declare const useDataModelGraphAppearance: ({ graph, selectedNode, selectedEdges, onNodeClick, onEdgeLabelClick, hideInteractionTypes, relationEdgesLabelsAmountThreshold }: Props) => void;
|
|
18
19
|
export {};
|
|
@@ -18,7 +18,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
18
18
|
}
|
|
19
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
20
|
};
|
|
21
|
-
import { useEffect, useState } from 'react';
|
|
21
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
22
22
|
import { useSigmaContext } from '@react-sigma/core';
|
|
23
23
|
import { useRegisterEvents, useSetSettings, useSigma } from '@react-sigma/core';
|
|
24
24
|
import { svg2Url } from '@reltio/mdm-sdk';
|
|
@@ -33,25 +33,35 @@ var DEFAULT_NODE_STYLE = {
|
|
|
33
33
|
color: 'rgba(55, 71, 79, 1)'
|
|
34
34
|
};
|
|
35
35
|
var DEFAULT_EDGE_STYLE = {
|
|
36
|
-
size:
|
|
36
|
+
size: 1
|
|
37
37
|
};
|
|
38
|
-
export var EDGE_COLOR = 'rgba(
|
|
39
|
-
export var DASHED_EDGE_COLOR = 'rgba(
|
|
38
|
+
export var EDGE_COLOR = 'rgba(0, 0, 0, 0.2)';
|
|
39
|
+
export var DASHED_EDGE_COLOR = 'rgba(0, 0, 0, 0.2)';
|
|
40
40
|
export var INACTIVE_EDGE_COLOR = 'rgba(224, 224, 224, 1)';
|
|
41
41
|
export var SELECTED_EDGE_COLOR = 'rgba(79, 79, 79, 1)';
|
|
42
42
|
export var RELATED_EDGE_COLOR = 'rgba(130, 130, 130, 1)';
|
|
43
43
|
export var RELATED_DASHED_EDGE_COLOR = 'rgba(79, 79, 79, 1)';
|
|
44
44
|
export var INACTIVE_LABEL_COLOR = 'rgba(0, 0, 0, 0.38)';
|
|
45
|
+
var RELATION_EDGES_LABELS_AMOUNT_THRESHOLD = 29;
|
|
45
46
|
export var useDataModelGraphAppearance = function (_a) {
|
|
46
|
-
var graph = _a.graph, selectedNode = _a.selectedNode,
|
|
47
|
+
var graph = _a.graph, selectedNode = _a.selectedNode, selectedEdges = _a.selectedEdges, onNodeClick = _a.onNodeClick, onEdgeLabelClick = _a.onEdgeLabelClick, hideInteractionTypes = _a.hideInteractionTypes, _b = _a.relationEdgesLabelsAmountThreshold, relationEdgesLabelsAmountThreshold = _b === void 0 ? RELATION_EDGES_LABELS_AMOUNT_THRESHOLD : _b;
|
|
47
48
|
var sigma = useSigma();
|
|
48
49
|
var container = useSigmaContext().container;
|
|
49
|
-
var
|
|
50
|
+
var _c = useState(null), hoveredNode = _c[0], setHoveredNode = _c[1];
|
|
50
51
|
var registerEvents = useRegisterEvents();
|
|
51
52
|
var setSettings = useSetSettings();
|
|
52
53
|
useLoopRenderer(graph);
|
|
53
54
|
var hoveredEdge = useEdgeLabelsRenderer({ graph: graph, onEdgeLabelClick: onEdgeLabelClick });
|
|
54
55
|
useSelectedNodeRenderer(graph);
|
|
56
|
+
var relationsEdgesAmount = useMemo(function () {
|
|
57
|
+
return graph.reduceEdges(function (count, _edgeId, edgeData) {
|
|
58
|
+
var _a;
|
|
59
|
+
if (((_a = edgeData.relationTypes) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
60
|
+
return count + 1;
|
|
61
|
+
}
|
|
62
|
+
return count;
|
|
63
|
+
}, 0);
|
|
64
|
+
}, [graph]);
|
|
55
65
|
useEffect(function () {
|
|
56
66
|
registerEvents({
|
|
57
67
|
enterNode: function (_a) {
|
|
@@ -85,7 +95,8 @@ export var useDataModelGraphAppearance = function (_a) {
|
|
|
85
95
|
var isInactiveNode = (selectedNode &&
|
|
86
96
|
selectedNodeNeighbours &&
|
|
87
97
|
__spreadArray(__spreadArray([], selectedNodeNeighbours, true), [selectedNode], false).every(function (n) { return n !== node; })) ||
|
|
88
|
-
(
|
|
98
|
+
((selectedEdges === null || selectedEdges === void 0 ? void 0 : selectedEdges.length) > 0 &&
|
|
99
|
+
selectedEdges.every(function (selectedEdge) { return !graph.hasExtremity(selectedEdge, node); })) ||
|
|
89
100
|
false;
|
|
90
101
|
var newData = __assign(__assign({}, DEFAULT_NODE_STYLE), data);
|
|
91
102
|
if (data.nodeType === DataModelGraphNodeType.interactionType) {
|
|
@@ -112,9 +123,9 @@ export var useDataModelGraphAppearance = function (_a) {
|
|
|
112
123
|
edgeReducer: function (edge, data) {
|
|
113
124
|
var isDashedLine = data.type === 'dashed';
|
|
114
125
|
var newData = __assign(__assign({}, DEFAULT_EDGE_STYLE), data);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
126
|
+
var isSelected = selectedEdges === null || selectedEdges === void 0 ? void 0 : selectedEdges.includes(edge);
|
|
127
|
+
newData.selected = isSelected;
|
|
128
|
+
var showOnlyRelatedEdgesLabels = relationsEdgesAmount > relationEdgesLabelsAmountThreshold;
|
|
118
129
|
if (selectedNode) {
|
|
119
130
|
if (graph.hasExtremity(edge, selectedNode)) {
|
|
120
131
|
newData.color = isDashedLine ? RELATED_DASHED_EDGE_COLOR : RELATED_EDGE_COLOR;
|
|
@@ -122,17 +133,36 @@ export var useDataModelGraphAppearance = function (_a) {
|
|
|
122
133
|
else {
|
|
123
134
|
newData.color = INACTIVE_EDGE_COLOR;
|
|
124
135
|
newData.labelColor = INACTIVE_LABEL_COLOR;
|
|
136
|
+
if (showOnlyRelatedEdgesLabels) {
|
|
137
|
+
delete newData.label;
|
|
138
|
+
}
|
|
125
139
|
}
|
|
126
140
|
}
|
|
127
|
-
else if (
|
|
128
|
-
newData.color =
|
|
129
|
-
newData.labelColor =
|
|
141
|
+
else if (selectedEdges === null || selectedEdges === void 0 ? void 0 : selectedEdges.length) {
|
|
142
|
+
newData.color = isSelected ? SELECTED_EDGE_COLOR : INACTIVE_EDGE_COLOR;
|
|
143
|
+
newData.labelColor = isSelected ? undefined : INACTIVE_LABEL_COLOR;
|
|
144
|
+
if (showOnlyRelatedEdgesLabels && !isSelected) {
|
|
145
|
+
delete newData.label;
|
|
146
|
+
}
|
|
130
147
|
}
|
|
131
148
|
else {
|
|
132
149
|
newData.color = isDashedLine ? DASHED_EDGE_COLOR : EDGE_COLOR;
|
|
150
|
+
if (showOnlyRelatedEdgesLabels) {
|
|
151
|
+
delete newData.label;
|
|
152
|
+
}
|
|
133
153
|
}
|
|
134
154
|
return newData;
|
|
135
155
|
}
|
|
136
156
|
});
|
|
137
|
-
}, [
|
|
157
|
+
}, [
|
|
158
|
+
sigma,
|
|
159
|
+
setSettings,
|
|
160
|
+
selectedNode,
|
|
161
|
+
selectedEdges,
|
|
162
|
+
hoveredEdge,
|
|
163
|
+
hoveredNode,
|
|
164
|
+
relationsEdgesAmount,
|
|
165
|
+
relationEdgesLabelsAmountThreshold,
|
|
166
|
+
hideInteractionTypes
|
|
167
|
+
]);
|
|
138
168
|
};
|