Skip to content

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

fix zoom buttons

AykutSarac03647216bc9f
diff --git a/src/containers/LiveEditor/index.tsx b/src/containers/LiveEditor/index.tsx
index 02d8b07f..ba633a78 100644
--- a/src/containers/LiveEditor/index.tsx
+++ b/src/containers/LiveEditor/index.tsx
@@ -58,7 +58,11 @@ export const LiveEditor: React.FC = React.memo(() => {
}, [json, settings.expand]);
React.useEffect(() => {
- wrapperRef.current?.zoomIn();
+ wrapperRef.current?.setTransform(
+ wrapperRef.current.state.positionX,
+ wrapperRef.current.state.positionY,
+ settings.zoomScale
+ );
}, [settings.zoomScale]);
React.useEffect(() => {
diff --git a/src/reducer/reducer.ts b/src/reducer/reducer.ts
index 693e515c..00cbbd80 100644
--- a/src/reducer/reducer.ts
+++ b/src/reducer/reducer.ts
@@ -38,7 +38,7 @@ export const useConfigReducer: React.Reducer<AppConfig, ReducerAction> = (
...state,
settings: {
...state.settings,
- zoomScale: state.settings.zoomScale + 0.1,
+ zoomScale: state.settings.zoomScale + 0.2,
},
};
@@ -47,7 +47,7 @@ export const useConfigReducer: React.Reducer<AppConfig, ReducerAction> = (
...state,
settings: {
...state.settings,
- zoomScale: state.settings.zoomScale - 0.1,
+ zoomScale: state.settings.zoomScale - 0.2,
},
};