ydb-embedded-ui 12.10.0 → 12.11.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/dist/components/EntityStatus/EntityStatus.js +1 -0
- package/dist/components/EntityStatus/EntityStatus.js.map +1 -1
- package/dist/components/Graph/Graph.d.ts +12 -0
- package/dist/components/Graph/Graph.js +42 -0
- package/dist/components/Graph/Graph.js.map +1 -0
- package/dist/containers/AppWithClusters/utils/useAdditionalTenantsProps.js +2 -1
- package/dist/containers/AppWithClusters/utils/useAdditionalTenantsProps.js.map +1 -1
- package/dist/containers/Storage/utils/index.d.ts +1 -1
- package/dist/containers/Tenant/Query/QueryResult/components/Graph/Graph.js +3 -3
- package/dist/containers/Tenant/Query/QueryResult/components/Graph/Graph.js.map +1 -1
- package/dist/containers/Tenant/Query/QueryResult/components/Graph/Graph.scss +0 -2
- package/dist/store/reducers/clusters/utils.js +2 -1
- package/dist/store/reducers/clusters/utils.js.map +1 -1
- package/dist/store/reducers/query/preparePlanData.js.map +1 -1
- package/dist/store/reducers/query/types.d.ts +1 -38
- package/dist/uiFactory/types.d.ts +1 -0
- package/dist/utils/generateEvaluator.d.ts +1 -1
- package/dist/utils/hooks/useNodeDeveloperUIHref.js +2 -1
- package/dist/utils/hooks/useNodeDeveloperUIHref.js.map +1 -1
- package/dist/utils/prepareQueryExplain.d.ts +2 -1
- package/dist/utils/prepareQueryExplain.js.map +1 -1
- package/package.json +3 -4
- package/dist/components/Graph/BlockComponents/ConnectionBlockComponent.d.ts +0 -7
- package/dist/components/Graph/BlockComponents/ConnectionBlockComponent.js +0 -30
- package/dist/components/Graph/BlockComponents/ConnectionBlockComponent.js.map +0 -1
- package/dist/components/Graph/BlockComponents/QueryBlockComponent.d.ts +0 -5
- package/dist/components/Graph/BlockComponents/QueryBlockComponent.js +0 -5
- package/dist/components/Graph/BlockComponents/QueryBlockComponent.js.map +0 -1
- package/dist/components/Graph/BlockComponents/ResultBlockComponent.d.ts +0 -7
- package/dist/components/Graph/BlockComponents/ResultBlockComponent.js +0 -5
- package/dist/components/Graph/BlockComponents/ResultBlockComponent.js.map +0 -1
- package/dist/components/Graph/BlockComponents/StageBlockComponent.d.ts +0 -7
- package/dist/components/Graph/BlockComponents/StageBlockComponent.js +0 -15
- package/dist/components/Graph/BlockComponents/StageBlockComponent.js.map +0 -1
- package/dist/components/Graph/GraphControls.d.ts +0 -6
- package/dist/components/Graph/GraphControls.js +0 -23
- package/dist/components/Graph/GraphControls.js.map +0 -1
- package/dist/components/Graph/GravityGraph.d.ts +0 -8
- package/dist/components/Graph/GravityGraph.js +0 -76
- package/dist/components/Graph/GravityGraph.js.map +0 -1
- package/dist/components/Graph/GravityGraph.scss +0 -124
- package/dist/components/Graph/NonSelectableConnection.d.ts +0 -9
- package/dist/components/Graph/NonSelectableConnection.js +0 -17
- package/dist/components/Graph/NonSelectableConnection.js.map +0 -1
- package/dist/components/Graph/TooltipComponent.d.ts +0 -8
- package/dist/components/Graph/TooltipComponent.js +0 -29
- package/dist/components/Graph/TooltipComponent.js.map +0 -1
- package/dist/components/Graph/colorsConfig.d.ts +0 -19
- package/dist/components/Graph/colorsConfig.js +0 -20
- package/dist/components/Graph/colorsConfig.js.map +0 -1
- package/dist/components/Graph/i18n/en.json +0 -3
- package/dist/components/Graph/i18n/index.d.ts +0 -2
- package/dist/components/Graph/i18n/index.js +0 -5
- package/dist/components/Graph/i18n/index.js.map +0 -1
- package/dist/components/Graph/treeLayout.worker.d.ts +0 -13
- package/dist/components/Graph/treeLayout.worker.js +0 -285
- package/dist/components/Graph/treeLayout.worker.js.map +0 -1
- package/dist/components/Graph/types.d.ts +0 -33
- package/dist/components/Graph/types.js +0 -2
- package/dist/components/Graph/types.js.map +0 -1
- package/dist/components/Graph/utils.d.ts +0 -6
- package/dist/components/Graph/utils.js +0 -87
- package/dist/components/Graph/utils.js.map +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
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
|
-
&__block-content.connection {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 4px;
|
|
57
|
-
|
|
58
|
-
color: var(--g-color-text-info-heavy);
|
|
59
|
-
border: 1px solid var(--g-color-line-info);
|
|
60
|
-
border-radius: 6px;
|
|
61
|
-
background: var(--g-color-base-info-light);
|
|
62
|
-
box-shadow: none;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&__tooltip-content {
|
|
66
|
-
overflow: auto;
|
|
67
|
-
|
|
68
|
-
width: 300px;
|
|
69
|
-
max-height: 90vh;
|
|
70
|
-
padding: 0 8px 8px;
|
|
71
|
-
|
|
72
|
-
font-family: var(--g-font-family);
|
|
73
|
-
font-size: var(--g-text-body-short-font-size);
|
|
74
|
-
line-height: var(--g-text-body-short-line-height);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&__tooltip-tabs {
|
|
78
|
-
margin-bottom: 8px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&__tooltip-stat-row {
|
|
82
|
-
display: grid;
|
|
83
|
-
grid-template-columns: 100px auto;
|
|
84
|
-
gap: 8px;
|
|
85
|
-
|
|
86
|
-
margin: 4px 0 0;
|
|
87
|
-
|
|
88
|
-
span {
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
|
|
91
|
-
text-overflow: ellipsis;
|
|
92
|
-
}
|
|
93
|
-
span:nth-child(1) {
|
|
94
|
-
color: var(--g-color-text-secondary);
|
|
95
|
-
}
|
|
96
|
-
span:nth-child(2) {
|
|
97
|
-
word-wrap: break-word;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&__tooltip-stat-group {
|
|
102
|
-
margin-top: 8px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&__tooltip-stat-group + &__tooltip-stat-group {
|
|
106
|
-
padding-top: 8px;
|
|
107
|
-
|
|
108
|
-
border-top: 1px dotted var(--g-color-line-generic);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&__tooltip-stat-group-name {
|
|
112
|
-
font-weight: bold;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&__zoom-controls {
|
|
116
|
-
position: absolute;
|
|
117
|
-
z-index: 999;
|
|
118
|
-
top: 8px;
|
|
119
|
-
right: 50px;
|
|
120
|
-
|
|
121
|
-
display: flex;
|
|
122
|
-
gap: 2px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
//eslint-disable @typescript-eslint/explicit-member-accessibility
|
|
10
|
-
this.cursor = 'pointer';
|
|
11
|
-
}
|
|
12
|
-
// Переопределяем метод для предотвращения выделения при клике
|
|
13
|
-
handleEvent(event) {
|
|
14
|
-
event.stopPropagation();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=NonSelectableConnection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;;QACI,iEAAiE;QACxD,WAAM,GAAc,SAAS,CAAC;IAM3C,CAAC;IAJG,8DAA8D;IAC3C,WAAW,CAAC,KAAY;QACvC,KAAK,CAAC,eAAe,EAAE,CAAC;IAC5B,CAAC;CACJ"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtendedTBlock } from './types';
|
|
3
|
-
type Props = {
|
|
4
|
-
block: ExtendedTBlock;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
export declare const TooltipComponent: ({ block, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useState } 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;
|
|
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] = useState(firstTab);
|
|
17
|
-
return useMemo(() => {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
return (_jsxs(TabProvider, { value: activeTab, 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) => {
|
|
20
|
-
var _a;
|
|
21
|
-
return (_jsx(TabPanel, { value: item.group, children: (_a = item.stats) === null || _a === void 0 ? void 0 : _a.map(getStatsContent) }, item.group));
|
|
22
|
-
})] }));
|
|
23
|
-
}, [block === null || block === void 0 ? void 0 : block.stats, activeTab]);
|
|
24
|
-
};
|
|
25
|
-
export const TooltipComponent = ({ block, children }) => {
|
|
26
|
-
const content = useTooltipContent(block);
|
|
27
|
-
return (_jsx(Popover, { content: content, hasArrow: true, trigger: "click", placement: "right-start", className: "ydb-gravity-graph__tooltip-content", disablePortal: true, strategy: "fixed", children: children }));
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=TooltipComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipComponent.js","sourceRoot":"","sources":["../../../src/components/Graph/TooltipComponent.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE/C,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,CAAC,CAAC;AAMlC,MAAM,eAAe,GAAG,CAAC,IAA8D,EAAE,EAAE;;IACvF,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,CACH,aAAG,SAAS,EAAE,CAAC,CAAC,kBAAkB,CAAC,aAC/B,2BAAO,IAAI,CA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AAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,0CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;;oBAAC,OAAA,CACzB,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,YACtB,MAAA,IAAI,CAAC,KAAK,0CAAE,GAAG,CAAC,eAAe,CAAC,IADH,IAAI,CAAC,KAAK,CAEjC,CACd,CAAA;iBAAA,CAAC,IACQ,CACjB,CAAA;KAAA,EACD,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,EAAE,SAAS,CAAC,CAC5B,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAQ,EAAE,EAAE;IACzD,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEzC,OAAO,CACH,KAAC,OAAO,IACJ,OAAO,EAAE,OAAO,EAChB,QAAQ,QACR,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,aAAa,EACvB,SAAS,EAAC,oCAAoC,EAC9C,aAAa,QACb,QAAQ,EAAC,OAAO,YAEf,QAA8B,GACzB,CACb,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type AbstractGraphColorsConfig = Partial<Record<string, Partial<Record<string, string>>>>;
|
|
2
|
-
export declare const graphColorsConfig: {
|
|
3
|
-
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
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ExtendedTBlock } from './types';
|
|
2
|
-
export declare function calculateLayout(nodes: any[], links: any[]): {
|
|
3
|
-
layout: ExtendedTBlock[];
|
|
4
|
-
edges: {
|
|
5
|
-
connectionId: string | undefined;
|
|
6
|
-
sourceBlockId: string | number;
|
|
7
|
-
targetBlockId: string | number;
|
|
8
|
-
points: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
}[];
|
|
12
|
-
}[];
|
|
13
|
-
};
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { prepareBlocks, prepareConnections } from './utils';
|
|
2
|
-
class TreeLayoutEngine {
|
|
3
|
-
constructor(blocks, connections, options = {}) {
|
|
4
|
-
this.blocks = new Map(blocks.map((block) => [block.id, { ...block }]));
|
|
5
|
-
this.connections = connections;
|
|
6
|
-
// Layout settings
|
|
7
|
-
this.options = {
|
|
8
|
-
horizontalSpacing: options.horizontalSpacing || 40, // horizontal distance between blocks
|
|
9
|
-
verticalSpacing: options.verticalSpacing || 20, // vertical distance between levels
|
|
10
|
-
...options,
|
|
11
|
-
};
|
|
12
|
-
this.tree = null;
|
|
13
|
-
this.levels = [];
|
|
14
|
-
}
|
|
15
|
-
// Building a tree structure
|
|
16
|
-
buildTree() {
|
|
17
|
-
const childrenMap = new Map();
|
|
18
|
-
const parentMap = new Map();
|
|
19
|
-
for (const block of this.blocks.values()) {
|
|
20
|
-
childrenMap.set(block.id, []);
|
|
21
|
-
}
|
|
22
|
-
// Setting connections
|
|
23
|
-
for (const connection of this.connections) {
|
|
24
|
-
const parent = connection.sourceBlockId;
|
|
25
|
-
const child = connection.targetBlockId;
|
|
26
|
-
childrenMap.get(parent).push(child);
|
|
27
|
-
parentMap.set(child, parent);
|
|
28
|
-
}
|
|
29
|
-
// Find root (a node without a parent)
|
|
30
|
-
const rootId = Array.from(this.blocks.keys()).find((id) => !parentMap.has(id));
|
|
31
|
-
if (!rootId) {
|
|
32
|
-
throw new Error('Root node not found');
|
|
33
|
-
}
|
|
34
|
-
// Recursively building a tree
|
|
35
|
-
const buildNode = (nodeId, level = 0) => {
|
|
36
|
-
const block = this.blocks.get(nodeId);
|
|
37
|
-
const children = childrenMap
|
|
38
|
-
.get(nodeId)
|
|
39
|
-
.map((childId) => buildNode(childId, level + 1));
|
|
40
|
-
return {
|
|
41
|
-
id: nodeId,
|
|
42
|
-
block: block,
|
|
43
|
-
children: children,
|
|
44
|
-
level: level,
|
|
45
|
-
x: 0,
|
|
46
|
-
y: 0,
|
|
47
|
-
subtreeWidth: 0,
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
this.tree = buildNode(rootId);
|
|
51
|
-
return this.tree;
|
|
52
|
-
}
|
|
53
|
-
// Grouping nodes by levels
|
|
54
|
-
groupByLevels(node = this.tree, levels = []) {
|
|
55
|
-
if (!node) {
|
|
56
|
-
return levels;
|
|
57
|
-
}
|
|
58
|
-
if (!levels[node.level]) {
|
|
59
|
-
levels[node.level] = [];
|
|
60
|
-
}
|
|
61
|
-
levels[node.level].push(node);
|
|
62
|
-
for (const child of node.children) {
|
|
63
|
-
this.groupByLevels(child, levels);
|
|
64
|
-
}
|
|
65
|
-
this.levels = levels;
|
|
66
|
-
return levels;
|
|
67
|
-
}
|
|
68
|
-
// Calculating the width of the subtree for each node
|
|
69
|
-
calculateSubtreeWidths(node = this.tree) {
|
|
70
|
-
if (node.children.length === 0) {
|
|
71
|
-
// Leaf node - width is equal to the width of the block
|
|
72
|
-
node.subtreeWidth = node.block.width;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// Recursively calculating the width for children
|
|
76
|
-
for (const child of node.children) {
|
|
77
|
-
this.calculateSubtreeWidths(child);
|
|
78
|
-
}
|
|
79
|
-
// Subtree width = sum of the widths of the children's subtrees + the margins between them
|
|
80
|
-
const childrenWidth = node.children.reduce((sum, child) => sum + child.subtreeWidth, 0);
|
|
81
|
-
const spacingWidth = (node.children.length - 1) * this.options.horizontalSpacing;
|
|
82
|
-
const totalChildrenWidth = childrenWidth + spacingWidth;
|
|
83
|
-
// Subtree width = the maximum of the width of the node itself and the total width of the children
|
|
84
|
-
node.subtreeWidth = Math.max(node.block.width, totalChildrenWidth);
|
|
85
|
-
}
|
|
86
|
-
return node.subtreeWidth;
|
|
87
|
-
}
|
|
88
|
-
// Placement of nodes by position
|
|
89
|
-
positionNodes() {
|
|
90
|
-
if (!this.tree) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
// Calculating the Y coordinates for each level
|
|
94
|
-
let currentY = 0;
|
|
95
|
-
const levelY = [];
|
|
96
|
-
for (let level = 0; level < this.levels.length; level++) {
|
|
97
|
-
levelY[level] = currentY;
|
|
98
|
-
// We find the maximum height of the blocks at this level
|
|
99
|
-
const maxHeight = Math.max(...this.levels[level].map((node) => node.block.height));
|
|
100
|
-
currentY += maxHeight + this.options.verticalSpacing;
|
|
101
|
-
}
|
|
102
|
-
// Recursively placing nodes
|
|
103
|
-
const positionNode = (node, leftX) => {
|
|
104
|
-
// Setting the Y coordinate
|
|
105
|
-
node.y = levelY[node.level];
|
|
106
|
-
if (node.children.length === 0) {
|
|
107
|
-
// The leaf node is placed in the current position.
|
|
108
|
-
node.x = leftX;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
// Place children
|
|
112
|
-
let childX = leftX;
|
|
113
|
-
// If the node width is greater than the total width of the children, add an indentation.
|
|
114
|
-
const childrenWidth = node.children.reduce((sum, child) => sum + child.subtreeWidth, 0);
|
|
115
|
-
const spacingWidth = (node.children.length - 1) * this.options.horizontalSpacing;
|
|
116
|
-
const totalChildrenWidth = childrenWidth + spacingWidth;
|
|
117
|
-
if (node.block.width > totalChildrenWidth) {
|
|
118
|
-
const extraSpace = (node.block.width - totalChildrenWidth) / 2;
|
|
119
|
-
childX += extraSpace;
|
|
120
|
-
}
|
|
121
|
-
// Place each child
|
|
122
|
-
for (const child of node.children) {
|
|
123
|
-
positionNode(child, childX);
|
|
124
|
-
childX += child.subtreeWidth + this.options.horizontalSpacing;
|
|
125
|
-
}
|
|
126
|
-
// Center the parent node relative to the children
|
|
127
|
-
const firstChild = node.children[0];
|
|
128
|
-
const lastChild = node.children[node.children.length - 1];
|
|
129
|
-
const childrenCenter = (firstChild.x + lastChild.x + lastChild.block.width) / 2;
|
|
130
|
-
node.x = childrenCenter - node.block.width / 2;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
positionNode(this.tree, 0);
|
|
134
|
-
}
|
|
135
|
-
// Normalization of coordinates (so that the minimum coordinates are >= 0)
|
|
136
|
-
normalizeCoordinates() {
|
|
137
|
-
if (!this.tree) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const allNodes = [];
|
|
141
|
-
const collectNodes = (node) => {
|
|
142
|
-
allNodes.push(node);
|
|
143
|
-
for (const child of node.children) {
|
|
144
|
-
collectNodes(child);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
collectNodes(this.tree);
|
|
148
|
-
const minX = Math.min(...allNodes.map((node) => node.x));
|
|
149
|
-
const minY = Math.min(...allNodes.map((node) => node.y));
|
|
150
|
-
// Shift all coordinates so that the minimum ones are equal to 0
|
|
151
|
-
const offsetX = minX < 0 ? -minX : 0;
|
|
152
|
-
const offsetY = minY < 0 ? -minY : 0;
|
|
153
|
-
for (const node of allNodes) {
|
|
154
|
-
node.x += offsetX;
|
|
155
|
-
node.y += offsetY;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// Main method of composition
|
|
159
|
-
layout() {
|
|
160
|
-
this.buildTree();
|
|
161
|
-
this.groupByLevels();
|
|
162
|
-
this.calculateSubtreeWidths();
|
|
163
|
-
this.positionNodes();
|
|
164
|
-
this.normalizeCoordinates();
|
|
165
|
-
return this.getLayoutResult();
|
|
166
|
-
}
|
|
167
|
-
// Getting the result of composition
|
|
168
|
-
getLayoutResult() {
|
|
169
|
-
if (!this.tree) {
|
|
170
|
-
return [];
|
|
171
|
-
}
|
|
172
|
-
const result = [];
|
|
173
|
-
const collectResults = (node) => {
|
|
174
|
-
result.push({
|
|
175
|
-
id: node.id,
|
|
176
|
-
x: node.x,
|
|
177
|
-
y: node.y,
|
|
178
|
-
width: node.block.width,
|
|
179
|
-
height: node.block.height,
|
|
180
|
-
level: node.level,
|
|
181
|
-
...node.block,
|
|
182
|
-
});
|
|
183
|
-
for (const child of node.children) {
|
|
184
|
-
collectResults(child);
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
collectResults(this.tree);
|
|
188
|
-
return result;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
// Function for using the algorithm
|
|
192
|
-
function calculateTreeLayout(blocks, connections, options = {}) {
|
|
193
|
-
const engine = new TreeLayoutEngine(blocks, connections, options);
|
|
194
|
-
return engine.layout();
|
|
195
|
-
}
|
|
196
|
-
function calculateTreeEdges(layoutResult, connections) {
|
|
197
|
-
// Create a position map for convenience of search
|
|
198
|
-
const positionMap = new Map(layoutResult.map((item) => [item.id, item]));
|
|
199
|
-
// Group connections by parent block
|
|
200
|
-
const connectionsByParent = new Map();
|
|
201
|
-
for (const connection of connections) {
|
|
202
|
-
const parentId = connection.sourceBlockId;
|
|
203
|
-
if (!connectionsByParent.has(parentId)) {
|
|
204
|
-
connectionsByParent.set(parentId, []);
|
|
205
|
-
}
|
|
206
|
-
connectionsByParent.get(parentId).push(connection);
|
|
207
|
-
}
|
|
208
|
-
const connectionPaths = [];
|
|
209
|
-
// For each parent block, we calculate the paths to the children
|
|
210
|
-
for (const [parentId, parentConnections] of connectionsByParent) {
|
|
211
|
-
const parent = positionMap.get(parentId);
|
|
212
|
-
if (!parent) {
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
// Coordinates of the initial point (center of the lower part of the parent)
|
|
216
|
-
const startX = parent.x + parent.width / 2;
|
|
217
|
-
const startY = parent.y + parent.height;
|
|
218
|
-
if (parentConnections.length === 1) {
|
|
219
|
-
// One child block - simple straight line
|
|
220
|
-
const connection = parentConnections[0];
|
|
221
|
-
const child = positionMap.get(connection.targetBlockId);
|
|
222
|
-
if (child) {
|
|
223
|
-
const endX = child.x + child.width / 2;
|
|
224
|
-
const endY = child.y;
|
|
225
|
-
connectionPaths.push({
|
|
226
|
-
connectionId: connection.id,
|
|
227
|
-
sourceBlockId: connection.sourceBlockId,
|
|
228
|
-
targetBlockId: connection.targetBlockId,
|
|
229
|
-
points: [
|
|
230
|
-
{ x: startX, y: startY },
|
|
231
|
-
{ x: endX, y: endY },
|
|
232
|
-
],
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
// Several child blocks - broken lines
|
|
238
|
-
// We find the vertical distance between the parent and the nearest child
|
|
239
|
-
const children = parentConnections
|
|
240
|
-
.map((conn) => positionMap.get(conn.targetBlockId))
|
|
241
|
-
.filter((child) => child !== undefined);
|
|
242
|
-
if (children.length === 0) {
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
// We find the minimum distance to the children by Y
|
|
246
|
-
const minChildY = Math.min(...children.map((child) => child.y));
|
|
247
|
-
// The point of branching - in the middle between the parent and the children
|
|
248
|
-
const branchY = startY + (minChildY - startY) / 2;
|
|
249
|
-
// For each child block, we create a broken line
|
|
250
|
-
for (const connection of parentConnections) {
|
|
251
|
-
const child = positionMap.get(connection.targetBlockId);
|
|
252
|
-
if (!child) {
|
|
253
|
-
continue;
|
|
254
|
-
}
|
|
255
|
-
const endX = child.x + child.width / 2;
|
|
256
|
-
const endY = child.y;
|
|
257
|
-
const points = [
|
|
258
|
-
{ x: startX, y: startY }, // Start - center of the lower part of the parent
|
|
259
|
-
{ x: startX, y: branchY }, // Vertically down to the point of branching
|
|
260
|
-
{ x: endX, y: branchY }, // Horizontally to the center of the child block
|
|
261
|
-
{ x: endX, y: endY }, // Vertically down to the center of the upper part of the child block
|
|
262
|
-
];
|
|
263
|
-
connectionPaths.push({
|
|
264
|
-
connectionId: connection.id,
|
|
265
|
-
sourceBlockId: connection.sourceBlockId,
|
|
266
|
-
targetBlockId: connection.targetBlockId,
|
|
267
|
-
points: points,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return connectionPaths;
|
|
273
|
-
}
|
|
274
|
-
// Export function for workerize-loader
|
|
275
|
-
export function calculateLayout(nodes, links) {
|
|
276
|
-
const blocks = prepareBlocks(nodes);
|
|
277
|
-
const connections = prepareConnections(links);
|
|
278
|
-
const layout = calculateTreeLayout(blocks, connections);
|
|
279
|
-
const edges = calculateTreeEdges(layout, connections);
|
|
280
|
-
return {
|
|
281
|
-
layout,
|
|
282
|
-
edges,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
//# sourceMappingURL=treeLayout.worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"treeLayout.worker.js","sourceRoot":"","sources":["../../../src/components/Graph/treeLayout.worker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAE1D,MAAM,gBAAgB;IAOlB,YAAY,MAAa,EAAE,WAA0B,EAAE,UAAyB,EAAE;QAC9E,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,EAAC,G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;gBAEF,eAAe,CAAC,IAAI,CAAC;oBACjB,YAAY,EAAE,UAAU,CAAC,EAAE;oBAC3B,aAAa,EAAE,UAAU,CAAC,aAAa;oBACvC,aAAa,EAAE,UAAU,CAAC,aAAa;oBACvC,MAAM,EAAE,MAAM;iBACjB,CAAC,CAAC;YACP,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,eAAe,CAAC,KAAY,EAAE,KAAY;IACtD,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,kBAAkB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAEtD,OAAO;QACH,MAAM;QACN,KAAK;KACR,CAAC;AACN,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { TBlock } from '@gravity-ui/graph';
|
|
2
|
-
import type { GraphNode, Link, TopologyNodeDataStats } from '../../store/reducers/query/types';
|
|
3
|
-
export interface ExtendedTBlock extends TBlock {
|
|
4
|
-
stats?: TopologyNodeDataStats[];
|
|
5
|
-
operators?: string[];
|
|
6
|
-
tables?: string[];
|
|
7
|
-
}
|
|
8
|
-
export type LinkType = 'arrow' | 'line';
|
|
9
|
-
export interface Data<TData = any> {
|
|
10
|
-
links: Link[];
|
|
11
|
-
nodes: GraphNode<TData>[];
|
|
12
|
-
}
|
|
13
|
-
export interface LayoutOptions {
|
|
14
|
-
horizontalSpacing?: number;
|
|
15
|
-
verticalSpacing?: number;
|
|
16
|
-
}
|
|
17
|
-
export interface TreeNode {
|
|
18
|
-
id: string;
|
|
19
|
-
level: number;
|
|
20
|
-
block: any;
|
|
21
|
-
children: TreeNode[];
|
|
22
|
-
subtreeWidth: number;
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
}
|
|
26
|
-
export interface EdgeResult {
|
|
27
|
-
points: Array<{
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
|
-
}>;
|
|
31
|
-
sourceBlockId: string;
|
|
32
|
-
targetBlockId: string;
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/Graph/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TBlock, TConnection } from '@gravity-ui/graph';
|
|
2
|
-
import type { AbstractGraphColorsConfig } from './colorsConfig';
|
|
3
|
-
import type { Data } from './types';
|
|
4
|
-
export declare const prepareBlocks: (nodes: Data["nodes"]) => TBlock[];
|
|
5
|
-
export declare const prepareConnections: (links: Data["links"]) => TConnection[];
|
|
6
|
-
export declare function parseCustomPropertyValue<T extends AbstractGraphColorsConfig>(colors: T, block?: HTMLElement): T;
|