biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Provide External Access to Graph Structure Represented on Orange Canvas #5049

Closed bam4564 closed 3 years ago

bam4564 commented 3 years ago

I'm exploring the possibility of using orange as the frontend for a component based workflow system. The workflow system supports an API for creating and running a directed graph where each node is a functional component and edges represent run order dependencies (i.e. 'A' has edge to 'B' implies 'A' needs to execute before 'B' and the output of 'A' becomes the input of 'B'). I want users to be able to use orange as a frontend to visually build a workflow, but have the workflow engine actually perform all of the work of executing the graph. So essentially, the orange widgets would be used for collecting input configurations and would also be used to view inputs / outputs for the workflow after the workflow is executed.

It seems to me that the following two requirements for my project are not currently supported by orange (please correct me if I am wrong).

  1. Access to the internal flow (nodes and edges in the orange workflow)
  2. A mechanism to update the input data channels on nodes within this flow (assuming requirement 1 is met) programmatically. So for example, let's say there are multiple nodes on the canvas and the user executes the the workflow as is. The workflow engine runs asynchronously and then when it finishes, a callback is triggered which sends the inputs / outputs from each component to the corresponding widget via the appropriate channels.

Would there be any interest in working to enable this kind of functionality within orange? I understand this may not be possible or would involve a lot of dev work but I'd be interested in helping out!

If not no worries. It might just be the case that orange isn't quite right for what I'm trying to do.

ajdapretnar commented 3 years ago

@brycemorrow4564 Thank you for your interest. From my perspective, it looks like Orange is very close to something you are trying to do. First, I would direct you to https://github.com/biolab/orange-canvas-core and https://github.com/biolab/orange-widget-base, which are bare libraries for GUI-based workflows. Canvas is just the canvas (obv) and widget base introduces the widgets.

As for your questions, I think @ales-erjavec, @irgolic and @janezd would know the answer(s).

ales-erjavec commented 3 years ago

I want users to be able to use orange as a frontend to visually build a workflow, but have the workflow engine actually perform all of the work of executing the graph. So essentially, the orange widgets would be used for collecting input configurations and would also be used to view inputs / outputs for the workflow after the workflow is executed.

You would need to implement a subclass of SignalManager to delegate execution and WidgetManger to create and then bind the configuration GUI to your workflow engine (e.g. the subclasses that do this for orange widgets themselves are implemented in https://github.com/biolab/orange-widget-base/blob/master/orangewidget/workflow/widgetsscheme.py)

bam4564 commented 3 years ago

Thanks for the responses @ajdapretnar and @ales-erjavec. @ales-erjavec that strategy seems like it would work well for my use case so thanks for the recommendation.

Also, I've been looking into orange-canvas-core for a few days now and I never knew those docs existed but they're very helpful. I would suggest putting a link to them on the README so they're easier to find.

P.S. Is it alright if I keep this issue open to ask questions or should I close it?

janezd commented 3 years ago

We have a weekly meeting at which we review issues, so we prefer keeping only those that require action or serve as reminders. I'm closing the issue, but you can still use it to ask questions. You can also use Discord, if you will.