Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

disable dynamic canvas size

AykutSaracafa6544d415a
diff --git a/src/containers/LiveEditor/index.tsx b/src/containers/LiveEditor/index.tsx
index 436d0ed3..e7ffde02 100644
--- a/src/containers/LiveEditor/index.tsx
+++ b/src/containers/LiveEditor/index.tsx
@@ -44,10 +44,6 @@ export const LiveEditor: React.FC = React.memo(function LiveEditor() {
nodes: [],
edges: [],
});
- const [canvasSize, setCanvasSize] = React.useState({
- width: 2000,
- height: 2000,
- });
React.useEffect(() => {
const { nodes, edges } = getEdgeNodes(json, settings.expand);
@@ -92,12 +88,6 @@ export const LiveEditor: React.FC = React.memo(function LiveEditor() {
if (input) input.blur();
};
- const onLayoutChange = (layout: ElkRoot) =>
- setCanvasSize({
- width: layout.width ?? 2000,
- height: layout.height ?? 2000,
- });
-
const onInit = (ref: ReactZoomPanPinchRef) => {
dispatch({
type: ConfigActionType.SET_ZOOM_PAN_PICNH_REF,
@@ -123,8 +113,8 @@ export const LiveEditor: React.FC = React.memo(function LiveEditor() {
nodes={data.nodes}
node={(props) => <CustomNode {...props} />}
edges={data.edges}
- maxWidth={canvasSize.width}
- maxHeight={canvasSize.height}
+ maxWidth={20000}
+ maxHeight={20000}
center={false}
zoomable={false}
fit={true}
@@ -132,7 +122,6 @@ export const LiveEditor: React.FC = React.memo(function LiveEditor() {
readonly
key={settings.layout}
onCanvasClick={onCanvasClick}
- onLayoutChange={onLayoutChange}
/>
</TransformComponent>
</TransformWrapper>