reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Example of wrapping ReactFlow doesn't work as intended(nodes can't be dragged)

Open seb613 opened this issue 2 years ago β€’ 8 comments

Path: /docs/wrapping-react/example

Created nodes can't be dragged, despite specifying so image

seb613 avatar Apr 02 '24 09:04 seb613

Hey @Alek99

Looks like onNodeChange is not implemented , Idea is to add a event handler onNodeChange and change the position of the dragged node to the new position.

Manas1820 avatar Jun 23 '24 02:06 Manas1820

Is there a way to wrap litegraph.js?

xiong-zhitong avatar Sep 15 '24 12:09 xiong-zhitong

@xiong-zhitong I guess you can use Wrapping , to make a custom wrapper of your own and then use it to wrap litegraph.js

Manas1820 avatar Sep 15 '24 21:09 Manas1820

@xiong-zhitong I guess you can use Wrapping , to make a custom wrapper of your own and then use it to wrap litegraph.js

Thanks for your reply! It seems like the LGraph class is very complex. Don't know how to wrap the functions like "add", "start" ...

<html>
<head>
	<link rel="stylesheet" type="text/css" href="litegraph.css">
	<script type="text/javascript" src="litegraph.js"></script>
</head>
<body style='width:100%; height:100%'>
<canvas id='mycanvas' width='1024' height='720' style='border: 1px solid'></canvas>
<script>
var graph = new LGraph();

var canvas = new LGraphCanvas("#mycanvas", graph);

var node_const = LiteGraph.createNode("basic/const");
node_const.pos = [200,200];
graph.add(node_const);
node_const.setValue(4.5);

var node_watch = LiteGraph.createNode("basic/watch");
node_watch.pos = [700,200];
graph.add(node_watch);

node_const.connect(0, node_watch, 0 );

graph.start()
</script>
</body>
</html>

xiong-zhitong avatar Sep 16 '24 09:09 xiong-zhitong

Can I try to attempt to create a wrapper and then wrap litegraph to reflex or try to implement onnodechange since it is a good first issue? I have tried to get assigned to 4262 issue but in case its already finished may I try to attempt this?

KarinaNi avatar Dec 01 '24 22:12 KarinaNi

Hi, I am working on a team project in school and wanted to take a shot at this issue with my team, can I be allowed permission for this issue?

arodr25 avatar Feb 07 '25 15:02 arodr25

Hi, I noticed it was fixed some time ago, although it's very laggy.

seb613 avatar Feb 07 '25 16:02 seb613

@seb613 Thanks!

arodr25 avatar Feb 07 '25 16:02 arodr25