Skip to content

Commit 50c237c

Browse files
committed
fix: fix blinking
1 parent 613fbe6 commit 50c237c

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/components/Graph/GravityGraph.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22

3-
import type {TGraphConfig} from '@gravity-ui/graph';
43
import {GraphState} from '@gravity-ui/graph';
4+
import type {HookGraphParams} from '@gravity-ui/graph/react';
55
import {GraphBlock, GraphCanvas, useGraph, useGraphEvent} from '@gravity-ui/graph/react';
66

77
import {cn} from '../../utils/cn';
@@ -25,7 +25,7 @@ interface Props<T> {
2525
theme?: string;
2626
}
2727

28-
const config: TGraphConfig = {
28+
const config: HookGraphParams = {
2929
settings: {
3030
connection: NonSelectableConnection,
3131
showConnectionArrows: false,
@@ -92,7 +92,7 @@ export function GravityGraph<T>({data, theme}: Props<T>) {
9292
}, [data.nodes, data.links, graph]);
9393

9494
React.useEffect(() => {
95-
graph.setColors(parseCustomPropertyValue(graphColorsConfig, graph.getGraphCanvas()));
95+
graph.setColors(parseCustomPropertyValue(graphColorsConfig));
9696
}, [graph, theme]);
9797

9898
useGraphEvent(graph, 'state-change', ({state}) => {

src/components/Graph/colorsConfig.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export const graphColorsConfig = {
88
dots: 'var(--g-color-line-generic)',
99
layerBackground: 'var(--g-color-base-background)',
1010
},
11+
block: {
12+
text: 'var(--g-color-text-primary)',
13+
background: 'var(--g-color-base-float)',
14+
border: 'var(--g-color-line-generic-solid)',
15+
},
1116
connection: {
1217
background: 'var(--g-color-line-generic-solid)',
1318
hoverBackground: 'var(--g-color-line-generic-solid)',

src/containers/Tenant/Query/QueryResult/components/Graph/Graph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function Graph({explain = {}, theme}: GraphProps) {
3030

3131
return (
3232
<div className={b('canvas-container')}>
33-
<GravityGraph data={data} theme={theme} key={theme} />
33+
<GravityGraph data={data} theme={theme} />
3434
</div>
3535
);
3636
}

0 commit comments

Comments
 (0)