I’m following Quickstart - React Flow but I’m not sure how to:
- import the css
- get past
Uncaught TypeError: u.interrupt is not a function
import param
from panel.custom import ReactComponent
class ReactFlowComponent(ReactComponent):
"""A Panel component that renders a React Flow diagram."""
value = param.List()
_importmap = {
"imports": {
"@xyflow/react": "https://esm.sh/reactflow",
}
}
_esm = """
import { ReactFlow } from '@xyflow/react';
export function render({ model }) {
const initialNodes = [
{ id: '1', position: { x: 0, y: 0 }, data: { label: '1' } },
{ id: '2', position: { x: 0, y: 100 }, data: { label: '2' } },
];
const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }];
return (
<div style={{ width: '100vw', height: '100vh' }}>
<ReactFlow nodes={initialNodes} edges={initialEdges} />
</div>
);
}
"""
flow = ReactFlowComponent()
flow.servable()