tsc fixes and rules
This commit is contained in:
@@ -103,7 +103,7 @@ export default function Graph({ setGraphPath }: { setGraphPath: React.Dispatch<R
|
||||
graphsPath.push(createPathSegment(nodeContext.nodeId, nodeContext.nodeName));
|
||||
setGraphsPath([...graphsPath])
|
||||
}
|
||||
const state = useGraphsStore.getState();
|
||||
const state = useGraphsStore.getState() as { graphsById: Map<string, GraphModel> };
|
||||
const graphsById = state.graphsById;
|
||||
const graph = graphsById.get(graphId);
|
||||
if (graph) {
|
||||
@@ -118,8 +118,8 @@ export default function Graph({ setGraphPath }: { setGraphPath: React.Dispatch<R
|
||||
const svgElement = await viz.renderSVGElement(dot, { engine: 'dot' });
|
||||
const container = containerRef.current;
|
||||
if (!container) return;
|
||||
container.innerHTML = '';
|
||||
container.appendChild(svgElement);
|
||||
(container as HTMLElement).innerHTML = '';
|
||||
(container as HTMLElement).appendChild(svgElement);
|
||||
attachInteractions(svgElement);
|
||||
} catch (e) {
|
||||
console.error('Viz render error', e);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Dropdown, type MenuProps } from "antd";
|
||||
import { defaultGraph, graphContext, type EdgeModel, type NodeContext } from "./Graph";
|
||||
import { defaultGraph, graphContext, GraphModel, type EdgeModel, type NodeContext } from "./Graph";
|
||||
import { useContext } from "react";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { useGraphsStore } from "../stores/GraphsStore";
|
||||
@@ -39,7 +39,7 @@ export default function NodeContextMenu({
|
||||
}
|
||||
|
||||
const graphContextValue = useContext(graphContext)!;
|
||||
const graphsById = useGraphsStore((s) => s.graphsById);
|
||||
const graphsById = useGraphsStore((s) => (s as { graphsById: Map<string, GraphModel> }).graphsById);
|
||||
const addTreeNode = useGraphLayersTreeStore(store => store.add);
|
||||
|
||||
function contextMenuOpenChange(open: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user