Merge branch 'demo' into feat/add-inferred-belief-node
# Conflicts: # src/pages/VisProgPage/VisProg.module.css # src/pages/VisProgPage/visualProgrammingUI/NodeRegistry.ts
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
MarkerType,
|
||||
} from '@xyflow/react';
|
||||
import '@xyflow/react/dist/style.css';
|
||||
import {useEffect} from "react";
|
||||
import {type CSSProperties, useEffect, useState} from "react";
|
||||
import {useShallow} from 'zustand/react/shallow';
|
||||
import orderPhaseNodeArray from "../../utils/orderPhaseNodes.ts";
|
||||
import useProgramStore from "../../utils/programStore.ts";
|
||||
@@ -79,7 +79,7 @@ const VisProgUI = () => {
|
||||
endBatchAction,
|
||||
scrollable
|
||||
} = useFlowStore(useShallow(selector)); // instructs the editor to use the corresponding functions from the FlowStore
|
||||
|
||||
const [zoom, setZoom] = useState(1);
|
||||
// adds ctrl+z and ctrl+y support to respectively undo and redo actions
|
||||
useEffect(() => {
|
||||
const handler = (e: KeyboardEvent) => {
|
||||
@@ -91,7 +91,7 @@ const VisProgUI = () => {
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={`${styles.innerEditorContainer} round-lg border-lg`}>
|
||||
<div className={`${styles.innerEditorContainer} round-lg border-lg`} style={({'--flow-zoom': zoom} as CSSProperties)}>
|
||||
<ReactFlow
|
||||
nodes={nodes}
|
||||
edges={edges}
|
||||
@@ -107,6 +107,7 @@ const VisProgUI = () => {
|
||||
onNodeDragStart={beginBatchAction}
|
||||
onNodeDragStop={endBatchAction}
|
||||
preventScrolling={scrollable}
|
||||
onMove={(_, viewport) => setZoom(viewport.zoom)}
|
||||
snapToGrid
|
||||
fitView
|
||||
proOptions={{hideAttribution: true}}
|
||||
|
||||
Reference in New Issue
Block a user