rete-react-plugin
packageReact plugin. Renders nodes, connections and other elements using React.
class ReactPlugin<Schemes extends BaseSchemes, T extends unknown>
Parameter | Extends | Description |
---|---|---|
Schemes | BaseSchemes | |
T | unknown |
Extends Scope<Produces
Emits connectionpath
Listens render
unmount
Adds a preset to the plugin.
addPreset(preset: RenderPreset<Schemes, CanAssignEachTupleElemmentToAnyOf<T, UnionToTuple<K>> extends true ? K : "Cannot apply preset. Provided signals are not compatible">): void
Parameter | Type | Description |
---|---|---|
preset | RenderPreset<Schemes, CanAssignEachTupleElemmentToAnyOf<T, UnionToTuple<K>> extends true ? K : "Cannot apply preset. Provided signals are not compatible"> | Preset that can render nodes, connections and other elements. |
Returns void
Signals that can be emitted by the plugin
type Produces<Schemes extends BaseSchemes> = {
data: Object;
type: "connectionpath";
};
Parameter | Extends | Description |
---|---|---|
Schemes | BaseSchemes |
Built-in presets, responsible for rendering different parts of the editor.
Classic preset for rendering nodes, connections, controls and sockets.
setup(props: ClassicProps<Schemes, K>): RenderPreset<Schemes, K>
Parameter | Type | Description |
---|---|---|
props | ClassicProps<Schemes, K> |
Returns RenderPreset<Schemes, K>
src/presets/context-menu/index.tsx
src/presets/context-menu/index.tsx
Preset for rendering context menu.
setup(props: Props): RenderPreset<Schemes, K>
Parameter | Type | Description |
---|---|---|
props | Props |
Returns RenderPreset<Schemes, K>
Preset for rendering minimap.
setup(props: { size: number }): RenderPreset<Schemes, K>
Parameter | Type | Description |
---|---|---|
props | { size: number } |
Returns RenderPreset<Schemes, K>
src/presets/reroute-pins/index.tsx
src/presets/reroute-pins/index.tsx
Preset for rendering pins.
setup(props: Props): RenderPreset<Schemes, K>
Parameter | Type | Description |
---|---|---|
props | Props |
Returns RenderPreset<Schemes, K>
Plugin props
type Props = { createRoot: Function };
Component for rendering various elements embedded in the React.js component tree.
RefComponent(__namedParameters: Props): Element
Parameter | Type | Description |
---|---|---|
__namedParameters | Props |
Returns Element