ydb-embedded-ui 20.5.0 → 21.1.0
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/README.md +41 -0
- package/dist/components/AutoRefreshControl/i18n/index.d.ts +1 -1
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js +10 -6
- package/dist/components/CriticalActionDialog/CriticalActionDialog.js.map +1 -1
- package/dist/components/CriticalActionDialog/i18n/en.json +1 -2
- package/dist/components/CriticalActionDialog/i18n/index.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/FullNodeViewer/i18n/index.d.ts +1 -1
- package/dist/components/Graph/BlockComponents/ConnectionBlockComponent.d.ts +7 -0
- package/dist/components/Graph/BlockComponents/ConnectionBlockComponent.js +30 -0
- package/dist/components/Graph/BlockComponents/ConnectionBlockComponent.js.map +1 -0
- package/dist/components/Graph/BlockComponents/QueryBlockComponent.d.ts +5 -0
- package/dist/components/Graph/BlockComponents/QueryBlockComponent.js +5 -0
- package/dist/components/Graph/BlockComponents/QueryBlockComponent.js.map +1 -0
- package/dist/components/Graph/BlockComponents/ResultBlockComponent.d.ts +7 -0
- package/dist/components/Graph/BlockComponents/ResultBlockComponent.js +5 -0
- package/dist/components/Graph/BlockComponents/ResultBlockComponent.js.map +1 -0
- package/dist/components/Graph/BlockComponents/StageBlockComponent.d.ts +7 -0
- package/dist/components/Graph/BlockComponents/StageBlockComponent.js +17 -0
- package/dist/components/Graph/BlockComponents/StageBlockComponent.js.map +1 -0
- package/dist/components/Graph/FullViewportBackground.d.ts +2 -0
- package/dist/components/Graph/FullViewportBackground.js +67 -0
- package/dist/components/Graph/FullViewportBackground.js.map +1 -0
- package/dist/components/Graph/GraphControls.d.ts +6 -0
- package/dist/components/Graph/GraphControls.js +24 -0
- package/dist/components/Graph/GraphControls.js.map +1 -0
- package/dist/components/Graph/GravityGraph.d.ts +9 -0
- package/dist/components/Graph/GravityGraph.js +122 -0
- package/dist/components/Graph/GravityGraph.js.map +1 -0
- package/dist/components/Graph/GravityGraph.scss +131 -0
- package/dist/components/Graph/NonSelectableConnection.d.ts +9 -0
- package/dist/components/Graph/NonSelectableConnection.js +16 -0
- package/dist/components/Graph/NonSelectableConnection.js.map +1 -0
- package/dist/components/Graph/TooltipComponent.d.ts +8 -0
- package/dist/components/Graph/TooltipComponent.js +63 -0
- package/dist/components/Graph/TooltipComponent.js.map +1 -0
- package/dist/components/Graph/colorsConfig.d.ts +19 -0
- package/dist/components/Graph/colorsConfig.js +20 -0
- package/dist/components/Graph/colorsConfig.js.map +1 -0
- package/dist/components/Graph/i18n/en.json +5 -0
- package/dist/components/Graph/i18n/index.d.ts +2 -0
- package/dist/components/Graph/i18n/index.js +5 -0
- package/dist/components/Graph/i18n/index.js.map +1 -0
- package/dist/components/Graph/runTreeLayout.d.ts +12 -0
- package/dist/components/Graph/runTreeLayout.js +75 -0
- package/dist/components/Graph/runTreeLayout.js.map +1 -0
- package/dist/components/Graph/treeLayout.d.ts +2 -0
- package/dist/components/Graph/treeLayout.js +284 -0
- package/dist/components/Graph/treeLayout.js.map +1 -0
- package/dist/components/Graph/types.d.ts +52 -0
- package/dist/components/Graph/types.js +2 -0
- package/dist/components/Graph/types.js.map +1 -0
- package/dist/components/Graph/utils.d.ts +6 -0
- package/dist/components/Graph/utils.js +88 -0
- package/dist/components/Graph/utils.js.map +1 -0
- package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
- package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
- package/dist/containers/Clusters/constants.d.ts +1 -1
- package/dist/containers/Header/HeaderActionsMenu.js +19 -3
- package/dist/containers/Header/HeaderActionsMenu.js.map +1 -1
- package/dist/containers/Header/hooks/useSharedDatabasePath.d.ts +4 -1
- package/dist/containers/Header/hooks/useSharedDatabasePath.js +14 -10
- package/dist/containers/Header/hooks/useSharedDatabasePath.js.map +1 -1
- package/dist/containers/Header/i18n/en.json +1 -0
- package/dist/containers/Header/i18n/index.d.ts +1 -1
- package/dist/containers/Nodes/i18n/index.d.ts +1 -1
- package/dist/containers/Operations/columns.js +2 -2
- package/dist/containers/Operations/columns.js.map +1 -1
- package/dist/containers/Operations/constants.d.ts +1 -1
- package/dist/containers/Operations/i18n/en.json +2 -2
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.js +1 -1
- package/dist/containers/PDiskPage/DecommissionButton/DecommissionButton.js.map +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js +1 -1
- package/dist/containers/PDiskPage/PDiskPage.js.map +1 -1
- package/dist/containers/PDiskPage/i18n/en.json +3 -3
- package/dist/containers/Storage/PDisks/PDisks.js +1 -1
- package/dist/containers/Storage/PDisks/PDisks.js.map +1 -1
- package/dist/containers/Tablet/components/TabletControls/TabletControls.js +1 -1
- package/dist/containers/Tablet/components/TabletControls/TabletControls.js.map +1 -1
- package/dist/containers/Tablet/i18n/en.json +3 -3
- package/dist/containers/Tablets/TabletsTable.js +1 -1
- package/dist/containers/Tablets/TabletsTable.js.map +1 -1
- package/dist/containers/Tablets/i18n/en.json +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TransferInfo/Credentials.d.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js +3 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js +2 -2
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js.map +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/useTenantStorageNewData.d.ts +2 -2
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js +10 -2
- package/dist/containers/Tenant/Healthcheck/components/HealthcheckDrawer.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryResult/components/Graph/Graph.js +9 -4
- package/dist/containers/Tenant/Query/QueryResult/components/Graph/Graph.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryResult/components/Graph/Graph.scss +2 -0
- package/dist/containers/Tenant/TenantNavigation/useTenantNavigation.d.ts +1 -1
- package/dist/graphLayout.worker.d.ts +1 -0
- package/dist/graphLayout.worker.js +17 -0
- package/dist/graphLayout.worker.js.map +1 -0
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/store/reducers/query/parsers/preparePlanData.js.map +1 -1
- package/dist/store/reducers/query/types.d.ts +38 -1
- package/dist/store/reducers/settings/utils.d.ts +2 -2
- package/dist/store/reducers/storage/utils.js +3 -3
- package/dist/store/reducers/storage/utils.js.map +1 -1
- package/dist/uiFactory/types.d.ts +9 -0
- package/dist/uiFactory/uiFactory.js +5 -2
- package/dist/uiFactory/uiFactory.js.map +1 -1
- package/dist/utils/disks/helpers.d.ts +2 -2
- package/dist/utils/hooks/useChangedQuerySettings.d.ts +2 -2
- package/dist/utils/hooks/useLastQueryExecutionSettings.d.ts +2 -2
- package/dist/utils/hooks/useQueryExecutionSettings.d.ts +2 -2
- package/dist/utils/prepareQueryExplain.d.ts +1 -2
- package/dist/utils/prepareQueryExplain.js +10 -2
- package/dist/utils/prepareQueryExplain.js.map +1 -1
- package/dist/utils/query.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/CriticalActionDialog/CriticalActionDialog.tsx +12 -25
- package/src/components/CriticalActionDialog/i18n/en.json +1 -2
- package/src/components/DropdownMenu/DropdownMenu.tsx +3 -2
- package/src/components/Graph/BlockComponents/ConnectionBlockComponent.tsx +49 -0
- package/src/components/Graph/BlockComponents/QueryBlockComponent.tsx +7 -0
- package/src/components/Graph/BlockComponents/ResultBlockComponent.tsx +10 -0
- package/src/components/Graph/BlockComponents/StageBlockComponent.tsx +35 -0
- package/src/components/Graph/FullViewportBackground.ts +122 -0
- package/src/components/Graph/GraphControls.tsx +49 -0
- package/src/components/Graph/GravityGraph.scss +131 -0
- package/src/components/Graph/GravityGraph.tsx +174 -0
- package/src/components/Graph/NonSelectableConnection.tsx +14 -0
- package/src/components/Graph/TooltipComponent.tsx +114 -0
- package/src/components/Graph/colorsConfig.ts +21 -0
- package/src/components/Graph/i18n/en.json +5 -0
- package/src/components/Graph/i18n/index.ts +7 -0
- package/src/components/Graph/runTreeLayout.ts +105 -0
- package/src/components/Graph/treeLayout.ts +378 -0
- package/src/components/Graph/types.ts +56 -0
- package/src/components/Graph/utils.ts +112 -0
- package/src/containers/Header/HeaderActionsMenu.tsx +22 -2
- package/src/containers/Header/hooks/useSharedDatabasePath.ts +33 -26
- package/src/containers/Header/i18n/en.json +1 -0
- package/src/containers/Operations/columns.tsx +4 -0
- package/src/containers/Operations/i18n/en.json +2 -2
- package/src/containers/PDiskPage/DecommissionButton/DecommissionButton.tsx +2 -0
- package/src/containers/PDiskPage/PDiskPage.tsx +3 -1
- package/src/containers/PDiskPage/i18n/en.json +3 -3
- package/src/containers/Storage/PDisks/PDisks.tsx +1 -1
- package/src/containers/Tablet/components/TabletControls/TabletControls.tsx +7 -1
- package/src/containers/Tablet/i18n/en.json +3 -3
- package/src/containers/Tablets/TabletsTable.tsx +3 -1
- package/src/containers/Tablets/i18n/en.json +1 -1
- package/src/containers/Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview.tsx +3 -1
- package/src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +2 -2
- package/src/containers/Tenant/Healthcheck/components/HealthcheckDrawer.tsx +16 -1
- package/src/containers/Tenant/Query/QueryResult/components/Graph/Graph.scss +2 -0
- package/src/containers/Tenant/Query/QueryResult/components/Graph/Graph.tsx +13 -7
- package/src/graphLayout.worker.ts +21 -0
- package/src/lib.ts +1 -0
- package/src/store/reducers/query/parsers/preparePlanData.ts +1 -3
- package/src/store/reducers/query/types.ts +42 -2
- package/src/store/reducers/storage/utils.ts +3 -3
- package/src/uiFactory/types.ts +10 -0
- package/src/uiFactory/uiFactory.ts +12 -2
- package/src/utils/prepareQueryExplain.ts +13 -5
- package/dist/components/Graph/Graph.d.ts +0 -12
- package/dist/components/Graph/Graph.js +0 -44
- package/dist/components/Graph/Graph.js.map +0 -1
- package/dist/components/Graph/colors.d.ts +0 -10
- package/dist/components/Graph/colors.js +0 -53
- package/dist/components/Graph/colors.js.map +0 -1
- package/src/components/Graph/Graph.tsx +0 -70
- package/src/components/Graph/colors.ts +0 -75
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.ydb-gravity-graph {
|
|
2
|
+
&__block {
|
|
3
|
+
cursor: auto;
|
|
4
|
+
|
|
5
|
+
border: none;
|
|
6
|
+
background: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&__block-content {
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 8px 12px;
|
|
12
|
+
|
|
13
|
+
font-family: var(--g-font-family);
|
|
14
|
+
font-size: var(--g-text-body-short-font-size);
|
|
15
|
+
line-height: var(--g-text-body-short-line-height);
|
|
16
|
+
|
|
17
|
+
border: 1px solid var(--g-color-line-generic);
|
|
18
|
+
background: var(--g-color-base-float);
|
|
19
|
+
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
|
|
20
|
+
|
|
21
|
+
&[aria-haspopup='dialog'] {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__block-id {
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 4px;
|
|
29
|
+
right: 4px;
|
|
30
|
+
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
line-height: 1;
|
|
33
|
+
|
|
34
|
+
color: var(--g-color-text-secondary);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__block-content.query {
|
|
38
|
+
height: 100%;
|
|
39
|
+
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__block-content.result {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__block-content.stage {
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__stage-table-row {
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__block-content.connection {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 4px;
|
|
64
|
+
|
|
65
|
+
color: var(--g-color-text-info-heavy);
|
|
66
|
+
border: 1px solid var(--g-color-line-info);
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
background: var(--g-color-base-info-light);
|
|
69
|
+
box-shadow: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__tooltip-content {
|
|
73
|
+
overflow: auto;
|
|
74
|
+
|
|
75
|
+
width: 300px;
|
|
76
|
+
max-height: 90vh;
|
|
77
|
+
padding: 0 8px 8px;
|
|
78
|
+
|
|
79
|
+
font-family: var(--g-font-family);
|
|
80
|
+
font-size: var(--g-text-body-short-font-size);
|
|
81
|
+
line-height: var(--g-text-body-short-line-height);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__tooltip-tabs {
|
|
85
|
+
margin-bottom: 8px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&__tooltip-stat-row {
|
|
89
|
+
display: grid;
|
|
90
|
+
grid-template-columns: 100px auto;
|
|
91
|
+
gap: 8px;
|
|
92
|
+
|
|
93
|
+
margin: 4px 0 0;
|
|
94
|
+
|
|
95
|
+
span {
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
|
|
98
|
+
text-overflow: ellipsis;
|
|
99
|
+
}
|
|
100
|
+
span:nth-child(1) {
|
|
101
|
+
color: var(--g-color-text-secondary);
|
|
102
|
+
}
|
|
103
|
+
span:nth-child(2) {
|
|
104
|
+
word-wrap: break-word;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__tooltip-stat-group {
|
|
109
|
+
margin-top: 8px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__tooltip-stat-group + &__tooltip-stat-group {
|
|
113
|
+
padding-top: 8px;
|
|
114
|
+
|
|
115
|
+
border-top: 1px dotted var(--g-color-line-generic);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__tooltip-stat-group-name {
|
|
119
|
+
font-weight: bold;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&__zoom-controls {
|
|
123
|
+
position: absolute;
|
|
124
|
+
z-index: 999;
|
|
125
|
+
top: 8px;
|
|
126
|
+
right: 50px;
|
|
127
|
+
|
|
128
|
+
display: flex;
|
|
129
|
+
gap: 2px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MultipointConnection } from '@gravity-ui/graph/react';
|
|
2
|
+
/**
|
|
3
|
+
* Кастомный класс соединения, который отключает визуальное выделение
|
|
4
|
+
* Наследуется от MultipointConnection и переопределяет поведение
|
|
5
|
+
*/
|
|
6
|
+
export declare class NonSelectableConnection extends MultipointConnection {
|
|
7
|
+
cursor: 'pointer';
|
|
8
|
+
protected handleEvent(event: Event): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MultipointConnection } from '@gravity-ui/graph/react';
|
|
2
|
+
/**
|
|
3
|
+
* Кастомный класс соединения, который отключает визуальное выделение
|
|
4
|
+
* Наследуется от MultipointConnection и переопределяет поведение
|
|
5
|
+
*/
|
|
6
|
+
export class NonSelectableConnection extends MultipointConnection {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.cursor = 'pointer';
|
|
10
|
+
}
|
|
11
|
+
// Переопределяем метод для предотвращения выделения при клике
|
|
12
|
+
handleEvent(event) {
|
|
13
|
+
event.stopPropagation();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=NonSelectableConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NonSelectableConnection.js","sourceRoot":"","sources":["../../../src/components/Graph/NonSelectableConnection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,yBAAyB,CAAC;AAE7D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oBAAoB;IAAjE;;QACa,WAAM,GAAc,SAAS,CAAC;IAM3C,CAAC;IAJG,8DAA8D;IAC3C,WAAW,CAAC,KAAY;QACvC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC5B,CAAC;CACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtendedTBlock } from './types';
|
|
3
|
+
type Props = {
|
|
4
|
+
block: ExtendedTBlock;
|
|
5
|
+
children: React.ReactElement<React.HTMLAttributes<HTMLElement>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const TooltipComponent: ({ block, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Popover, Tab, TabList, TabPanel, TabProvider } from '@gravity-ui/uikit';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
const b = cn('ydb-gravity-graph');
|
|
6
|
+
const getStatsContent = (stat) => {
|
|
7
|
+
var _a;
|
|
8
|
+
if ('value' in stat) {
|
|
9
|
+
return (_jsxs("p", { className: b('tooltip-stat-row'), children: [_jsxs("span", { children: [stat.name, ":"] }), _jsx("span", { children: stat.value })] }, stat.name));
|
|
10
|
+
}
|
|
11
|
+
return (_jsxs("section", { className: b('tooltip-stat-group'), children: [_jsxs("div", { className: b('tooltip-stat-group-name'), children: [stat.name, ":"] }), (_a = stat.items) === null || _a === void 0 ? void 0 : _a.map(({ name, value }) => (_jsxs("p", { className: b('tooltip-stat-row'), children: [_jsxs("span", { children: [name, ":"] }), _jsx("span", { children: value })] }, name)))] }, stat.name));
|
|
12
|
+
};
|
|
13
|
+
const useTooltipContent = (block) => {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
const firstTab = ((_b = (_a = block === null || block === void 0 ? void 0 : block.stats) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.group) || '';
|
|
16
|
+
const [activeTab, setActiveTab] = React.useState(firstTab);
|
|
17
|
+
const validatedActiveTab = ((_c = block.stats) === null || _c === void 0 ? void 0 : _c.some(({ group }) => group === activeTab))
|
|
18
|
+
? activeTab
|
|
19
|
+
: firstTab;
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (activeTab !== validatedActiveTab) {
|
|
22
|
+
setActiveTab(validatedActiveTab);
|
|
23
|
+
}
|
|
24
|
+
}, [activeTab, validatedActiveTab]);
|
|
25
|
+
return React.useMemo(() => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
return (_jsxs(TabProvider, { value: validatedActiveTab, onUpdate: setActiveTab, children: [_jsx(TabList, { className: b('tooltip-tabs'), children: (_a = block === null || block === void 0 ? void 0 : block.stats) === null || _a === void 0 ? void 0 : _a.map((item) => (_jsx(Tab, { value: item.group, children: item.group }, item.group))) }), (_b = block === null || block === void 0 ? void 0 : block.stats) === null || _b === void 0 ? void 0 : _b.map((item) => {
|
|
28
|
+
var _a;
|
|
29
|
+
return (_jsx(TabPanel, { value: item.group, children: (_a = item.stats) === null || _a === void 0 ? void 0 : _a.map(getStatsContent) }, item.group));
|
|
30
|
+
})] }));
|
|
31
|
+
}, [block === null || block === void 0 ? void 0 : block.stats, validatedActiveTab]);
|
|
32
|
+
};
|
|
33
|
+
export const TooltipComponent = ({ block, children }) => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const content = useTooltipContent(block);
|
|
36
|
+
const trigger = React.cloneElement(children, {
|
|
37
|
+
role: (_a = children.props.role) !== null && _a !== void 0 ? _a : 'button',
|
|
38
|
+
tabIndex: (_b = children.props.tabIndex) !== null && _b !== void 0 ? _b : 0,
|
|
39
|
+
onKeyDown: (event) => {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
(_b = (_a = children.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
42
|
+
if (event.defaultPrevented) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (event.key === 'Enter') {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
event.currentTarget.click();
|
|
48
|
+
}
|
|
49
|
+
else if (event.key === ' ') {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
onKeyUp: (event) => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
(_b = (_a = children.props).onKeyUp) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
56
|
+
if (!event.defaultPrevented && event.key === ' ') {
|
|
57
|
+
event.currentTarget.click();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return (_jsx(Popover, { content: content, hasArrow: true, trigger: "click", placement: "right-start", className: "ydb-gravity-graph__tooltip-content", strategy: "fixed", children: trigger }));
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=TooltipComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipComponent.js","sourceRoot":"","sources":["../../../src/components/Graph/TooltipComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAM/E,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAIlC,MAAM,CAAC,GAAG,EAAE,CAAC,mBAAmB,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
readonly canvas: {
|
|
4
|
+
readonly belowLayerBackground: "#0000";
|
|
5
|
+
readonly border: "#0000";
|
|
6
|
+
readonly dots: "var(--g-color-line-generic)";
|
|
7
|
+
readonly layerBackground: "var(--g-color-base-background)";
|
|
8
|
+
};
|
|
9
|
+
readonly block: {
|
|
10
|
+
readonly text: "var(--g-color-text-primary)";
|
|
11
|
+
readonly background: "var(--g-color-base-float)";
|
|
12
|
+
readonly border: "var(--g-color-line-generic-solid)";
|
|
13
|
+
};
|
|
14
|
+
readonly connection: {
|
|
15
|
+
readonly background: "var(--g-color-line-generic-solid)";
|
|
16
|
+
readonly hoverBackground: "var(--g-color-line-generic-solid)";
|
|
17
|
+
readonly selectedBackground: "var(--g-color-line-generic-solid)";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const graphColorsConfig = {
|
|
2
|
+
// Default @gravity-ui/graph colors
|
|
3
|
+
canvas: {
|
|
4
|
+
belowLayerBackground: '#0000',
|
|
5
|
+
border: '#0000',
|
|
6
|
+
dots: 'var(--g-color-line-generic)',
|
|
7
|
+
layerBackground: 'var(--g-color-base-background)',
|
|
8
|
+
},
|
|
9
|
+
block: {
|
|
10
|
+
text: 'var(--g-color-text-primary)',
|
|
11
|
+
background: 'var(--g-color-base-float)',
|
|
12
|
+
border: 'var(--g-color-line-generic-solid)',
|
|
13
|
+
},
|
|
14
|
+
connection: {
|
|
15
|
+
background: 'var(--g-color-line-generic-solid)',
|
|
16
|
+
hoverBackground: 'var(--g-color-line-generic-solid)',
|
|
17
|
+
selectedBackground: 'var(--g-color-line-generic-solid)',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=colorsConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorsConfig.js","sourceRoot":"","sources":["../../../src/components/Graph/colorsConfig.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,mCAAmC;IACnC,MAAM,EAAE;QACJ,oBAAoB,EAAE,OAAO;QAC7B,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,6BAA6B;QACnC,eAAe,EAAE,gCAAgC;KACpD;IACD,KAAK,EAAE;QACH,IAAI,EAAE,6BAA6B;QACnC,UAAU,EAAE,2BAA2B;QACvC,MAAM,EAAE,mCAAmC;KAC9C;IACD,UAAU,EAAE;QACR,UAAU,EAAE,mCAAmC;QAC/C,eAAe,EAAE,mCAAmC;QACpD,kBAAkB,EAAE,mCAAmC;KAC1D;CACyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Graph/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAEtC,eAAe,eAAe,CAAC,SAAS,EAAE,EAAC,EAAE,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TreeLayoutRequest, TreeLayoutResult } from './types';
|
|
2
|
+
type Schedule = (callback: () => void) => () => void;
|
|
3
|
+
interface RunTreeLayoutOptions {
|
|
4
|
+
request: TreeLayoutRequest;
|
|
5
|
+
createWorker: () => Worker;
|
|
6
|
+
calculateLayout?: () => TreeLayoutResult;
|
|
7
|
+
onResult: (result: TreeLayoutResult) => void;
|
|
8
|
+
onError: (error: Error) => void;
|
|
9
|
+
schedule?: Schedule;
|
|
10
|
+
}
|
|
11
|
+
export declare function runTreeLayout({ request, createWorker, calculateLayout, onResult, onError, schedule, }: RunTreeLayoutOptions): () => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { prepareTreeLayout } from './treeLayout';
|
|
2
|
+
const scheduleOnMainThread = (callback) => {
|
|
3
|
+
const timeoutId = globalThis.setTimeout(callback, 0);
|
|
4
|
+
return () => globalThis.clearTimeout(timeoutId);
|
|
5
|
+
};
|
|
6
|
+
const normalizeError = (error) => {
|
|
7
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
8
|
+
};
|
|
9
|
+
export function runTreeLayout({ request, createWorker, calculateLayout = () => prepareTreeLayout(request), onResult, onError, schedule = scheduleOnMainThread, }) {
|
|
10
|
+
let worker;
|
|
11
|
+
let cancelFallback;
|
|
12
|
+
let cancelled = false;
|
|
13
|
+
let settled = false;
|
|
14
|
+
const terminateWorker = () => {
|
|
15
|
+
worker === null || worker === void 0 ? void 0 : worker.terminate();
|
|
16
|
+
worker = undefined;
|
|
17
|
+
};
|
|
18
|
+
const reportError = (error) => {
|
|
19
|
+
if (cancelled || settled) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
settled = true;
|
|
23
|
+
terminateWorker();
|
|
24
|
+
onError(normalizeError(error));
|
|
25
|
+
};
|
|
26
|
+
const complete = (result) => {
|
|
27
|
+
if (cancelled || settled) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
settled = true;
|
|
31
|
+
terminateWorker();
|
|
32
|
+
onResult(result);
|
|
33
|
+
};
|
|
34
|
+
const scheduleFallback = () => {
|
|
35
|
+
if (cancelled || settled || cancelFallback) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
terminateWorker();
|
|
39
|
+
cancelFallback = schedule(() => {
|
|
40
|
+
cancelFallback = undefined;
|
|
41
|
+
if (cancelled || settled) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
complete(calculateLayout());
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
reportError(error);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
try {
|
|
53
|
+
worker = createWorker();
|
|
54
|
+
worker.onmessage = ({ data }) => {
|
|
55
|
+
if (data.type === 'success') {
|
|
56
|
+
complete(data.result);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
reportError(new Error(data.error));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
worker.onerror = scheduleFallback;
|
|
63
|
+
worker.onmessageerror = scheduleFallback;
|
|
64
|
+
worker.postMessage(request);
|
|
65
|
+
}
|
|
66
|
+
catch (_a) {
|
|
67
|
+
scheduleFallback();
|
|
68
|
+
}
|
|
69
|
+
return () => {
|
|
70
|
+
cancelled = true;
|
|
71
|
+
cancelFallback === null || cancelFallback === void 0 ? void 0 : cancelFallback();
|
|
72
|
+
terminateWorker();
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=runTreeLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runTreeLayout.js","sourceRoot":"","sources":["../../../src/components/Graph/runTreeLayout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAc/C,MAAM,oBAAoB,GAAa,CAAC,QAAQ,EAAE,EAAE;IAChD,MAAM,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAErD,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAc,EAAE,EAAE;IACtC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,EAC1B,OAAO,EACP,YAAY,EACZ,eAAe,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAClD,QAAQ,EACR,OAAO,EACP,QAAQ,GAAG,oBAAoB,GACZ;IACnB,IAAI,MAA0B,CAAC;IAC/B,IAAI,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