refactor: defaults should be in their own file, respecting eslint/ react standards. all tests fail, obviously.
ref: N25B-294
This commit is contained in:
@@ -12,9 +12,7 @@ import {DndToolbar} from './visualProgrammingUI/components/DragDropSidebar.tsx';
|
||||
import useFlowStore from './visualProgrammingUI/VisProgStores.tsx';
|
||||
import type {FlowState} from './visualProgrammingUI/VisProgTypes.tsx';
|
||||
import styles from './VisProg.module.css'
|
||||
import type { JSX } from 'react';
|
||||
import { NodeTypes } from './visualProgrammingUI/NodeRegistry.ts';
|
||||
import { graphReducer } from './visualProgrammingUI/GraphReducer.ts';
|
||||
import { NodeReduces, NodeTypes } from './visualProgrammingUI/NodeRegistry.ts';
|
||||
|
||||
// --| config starting params for flow |--
|
||||
|
||||
@@ -116,6 +114,19 @@ function runProgram() {
|
||||
console.log(program);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces the graph into its phases' information and recursively calls their reducing function
|
||||
*/
|
||||
function graphReducer() {
|
||||
const { nodes } = useFlowStore.getState();
|
||||
return nodes
|
||||
.filter((n) => n.type == 'phase')
|
||||
.map((n) => {
|
||||
const reducer = NodeReduces['phase'];
|
||||
return reducer(n, nodes)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* houses the entire page, so also UI elements
|
||||
* that are not a part of the Visual Programming UI
|
||||
|
||||
Reference in New Issue
Block a user