fixes zoom px and disabledNodeDrag

This commit is contained in:
dhrubesh 2021-05-09 19:30:16 +05:30
parent 45375fbd53
commit 128d75a144
2 changed files with 3 additions and 2 deletions

View File

@ -52,7 +52,7 @@ const ServiceMap = (props: ServiceMapProps) => {
}
const zoomToService = (value: string) => {
fgRef && fgRef.current.zoomToFit(700, 350, (e) => e.id === value);
fgRef && fgRef.current.zoomToFit(700, 360, (e) => e.id === value);
};
const { nodes, links } = getGraphData(serviceMap);
@ -65,6 +65,7 @@ const ServiceMap = (props: ServiceMapProps) => {
/>
<ForceGraph2D
ref={fgRef}
enableNodeDrag={false}
cooldownTicks={100}
onEngineStop={() => fgRef.current.zoomToFit(100, 200)}
graphData={graphData}

View File

@ -2,7 +2,7 @@ import { uniqBy, uniq, maxBy, cloneDeep, find } from "lodash";
import { serviceMapStore } from "Src/store/actions";
import { graphDataType } from "./ServiceMap";
const MAX_WIDTH = 8;
const MAX_WIDTH = 12;
const MIN_WIDTH = 5;
const MAX_FONT_SIZE = 8;
const MIN_FONT_SIZE = 5;