✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.
performance context
AykutSarac07cfbc061626
diff --git a/src/constants/data.ts b/src/constants/data.tsindex f15ac679..8341364a 100644--- a/src/constants/data.ts+++ b/src/constants/data.ts@@ -45,4 +45,5 @@ export const defaultConfig: StorageConfig = {hideEditor: false,zoomPanPinch: null,lightmode: false,+ performance: false,};diff --git a/src/containers/Editor/Tools.tsx b/src/containers/Editor/Tools.tsxindex 7de7e86f..1b246f17 100644--- a/src/containers/Editor/Tools.tsx+++ b/src/containers/Editor/Tools.tsx@@ -68,10 +68,12 @@ export const Tools: React.FC = () => {<StyledToolElement aria-label="switch theme" onClick={toggleTheme}>{settings.lightmode ? <HiOutlineMoon /> : <HiOutlineSun />}</StyledToolElement>- <SearchInput />- <StyledToolElement aria-label="save" onClick={exportAsImage}>- <FiDownload />- </StyledToolElement>+ {!settings.performance && <SearchInput />}+ {!settings.performance && (+ <StyledToolElement aria-label="save" onClick={exportAsImage}>+ <FiDownload />+ </StyledToolElement>+ )}<StyledToolElement aria-label="center canvas" onClick={centerView}><MdCenterFocusWeak /></StyledToolElement>diff --git a/src/hocs/config.tsx b/src/hocs/config.tsxindex fa32c7d6..581dae98 100644--- a/src/hocs/config.tsx+++ b/src/hocs/config.tsx@@ -66,6 +66,7 @@ const WithConfig: ReactComponent = ({ children }) => {JSON.stringify({...states.settings,zoomPanPinch: undefined,+ performance: undefined,}));}, [states.settings, render]);diff --git a/src/reducer/reducer.ts b/src/reducer/reducer.tsindex 23ddbc3b..49061c32 100644--- a/src/reducer/reducer.ts+++ b/src/reducer/reducer.ts@@ -6,6 +6,7 @@ export enum ConfigActionType {SET_CONFIG,TOGGLE_LAYOUT,TOGGLE_EXPAND,+ TOGGLE_PERFORMANCE,TOGGLE_DOCK,TOGGLE_THEME,ZOOM_IN,@@ -87,6 +88,15 @@ export const useConfigReducer: React.Reducer<AppConfig, ReducerAction> = (},};+ case ConfigActionType.TOGGLE_PERFORMANCE:+ return {+ ...state,+ settings: {+ ...state.settings,+ performance: !state.settings.performance,+ },+ };+case ConfigActionType.TOGGLE_LAYOUT:return {...state,diff --git a/src/typings/global.ts b/src/typings/global.tsindex c937f603..dc4a7e36 100644--- a/src/typings/global.ts+++ b/src/typings/global.ts@@ -8,6 +8,7 @@ export interface StorageConfig {hideEditor: boolean;zoomPanPinch: ReactZoomPanPinchRef | null;lightmode: boolean;+ performance: boolean;}export type ReactComponent = React.FC<PropsWithChildren<{}>>;