Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a node for looping over code with conditions #384

Closed
akshayred opened this issue Oct 21, 2019 · 10 comments
Closed

Create a node for looping over code with conditions #384

akshayred opened this issue Oct 21, 2019 · 10 comments

Comments

@akshayred
Copy link

Hello,
Thanks for all the good work you are doing with rete js. We are using your library for one Drupal 8 module. And it is getting a good response. Here is the link for the module which we are working on https://www.drupal.org/project/if_then_else

We need some help with one functionality which we want to have in our module. We want a loop type of functionality that can loop over a set of nodes. We can handle the programmatic part of it but we need help with UI. We need a node that can hold a set of other nodes in it. I am attaching an image of a rough idea of what we need. Can you please help me with how I can proceed with it?

Loop.pdf

@Ni55aN
Copy link
Member

Ni55aN commented Oct 22, 2019

#243 (comment)

@akshayred
Copy link
Author

Hi,
Thanks for sharing the other issue which is related to this. I did try what was given there but I think that won't work for my case. The problem is in our module we are not using retejs to do any processing. It is only used for creating a flow of events, actions, and conditions.
With foreach node, I want to loop over a subset of nodes that are connected with that foreach. Now there could be multiple foreach nodes in the same graph. The problem is I am not able to make a decision programmatically, which all nodes are to be processed in foreach. So what I was thinking to have a different type of node which can hold a subset of nodes inside it and somehow in the JSON we know that which set of nodes are inside that special type of node. Can you please provide me some direction on how we can achieve that?
I have attached a screenshot of what I am visualizing as what that special type of node would look. Let me know if that is possible somehow in retejs?

Thanks

@Ni55aN
Copy link
Member

Ni55aN commented Nov 9, 2019

@akshayred

We can handle the programmatic part of it but we need help with UI. We need a node that can hold a set of other nodes in it.

There is no implementation for this case. Maybe the plugin module will solve your problem

@akshayred
Copy link
Author

@Ni55aN I did check the plugin module as you suggested. Can you help me how I we can add a new node type to it. I think the current node defined there is for normal node and for the loop node we might have to define a totally new node type.

@Ni55aN
Copy link
Member

Ni55aN commented Nov 20, 2019

I do not know how your implementation works. I can only suggest making a loop node as in the example:https://codepen.io/Ni55aN/pen/KJVEMe

@akshayred
Copy link
Author

Hi , I am trying to compile rete example using gulp-babel and use the bundled file in html but I am getting error in console - "ReferenceError: require is not defined". Am I doing something wrong ??

@akshayred
Copy link
Author

@Ni55aN Can you help me with understanding how the current node is being generated. Is it called by the area or by editor. I am thinking to create another implementation of node which should be able to include other nodes inside it.

@Ni55aN
Copy link
Member

Ni55aN commented Dec 6, 2019

ReferenceError: require is not defined

It seems that gulp-babel import CommonJS dependencies and doesn't transpile them completely into iife bundle

@Ni55aN
Copy link
Member

Ni55aN commented Dec 6, 2019

Can you help me with understanding how the current node is being generated

rete creates HTMLElement for node

NodeEditor -> addNode -> EditorView -> addNode-> new NodeView() -> triggerrendernode` -> rete-*-render-plugin insert content into this element

I am thinking to create another implementation of node which should be able to include other nodes inside it.

I think a custom node will solve your issue

@Ni55aN Ni55aN added the v1 label Apr 4, 2023
@rete-js
Copy link
Contributor

rete-js bot commented Jul 13, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@rete-js rete-js bot added the Stale label Jul 13, 2023
@rete-js rete-js bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants