41 Commits

Author SHA1 Message Date
Kamil Koczurek
7cf8181c36 Allow inserting responses in draw_graph_editor
This allows a user to trigger an event externally as if it was created
by UI. For example, to remove a node one just needs to insert a
NodeRespone::DeleteNodeUi. Without this feature one needs to remove the
node from the graph *and* adjust the internal state of GraphEditorState.
2023-05-20 14:36:03 +02:00
Kamil Koczurek
671d1e6eed example: appease clippy in main.rs 2023-05-10 12:34:24 +02:00
Kamil Koczurek
006a5f3608 node finder: support node categories
* Add CategoryTrait that gives a name to a category of nodes. Provide
  implementations for String, &str and ().
* Add NodeTemplateTrait::node_finder_categories to list categories to
  which the template belongs, defaults to an empty vector.
* Node finder now displays at the top a collapsible header for each
  category and corresponding nodes inside of them. Nodes without a
  category are displayed below, so the behavior of programs that don't
  adapt to use categories remains the same. The collapsible headers
  behave as follows:
    - For empty query, all categories are collapsed
    - Otherwise:
      1. Categories that contain no matching nodes are ommited.
      2. Matching categories are now opened by default -- it's assumed
	 that filtered results are more manageable and can now be
         unwrapped.
      3. The user can normally un/collapse each category, but if the
	 query is changed, the default is applied.
* Update the example to use this feature.

This change will break all existing programs and the simplest fix to
that is adding `type CategoryType = ();` in the implementation of
`NodeTemplateTrait`. Default associated types are not supported, so
this can't be avoided with this design.
2023-05-10 12:34:19 +02:00
Okko Hakola
4ce43f5521 Update egui 2023-04-22 16:40:17 +03:00
Setzer22
d6c1b324ee Also add NodeData parameter to value_widget 2022-10-29 18:22:50 +02:00
Setzer22
0ab08bd9ca Also expose UserState in NodeTemplateTrait 2022-10-29 17:22:14 +02:00
Setzer22
79fbe31482 Expose UserState and the node id to value_widget 2022-10-29 15:43:55 +02:00
KOKI
36384258ab impl Default in some struct 2022-10-06 06:04:28 +09:00
setzer22
75308d0e72
Merge pull request #58 from kkngsm/outside-userstate
Change UserState to outside of GraphEditorState
2022-09-17 21:08:06 +02:00
KOKI
19ce5f4fa3 Changed the UserState args to mutable 2022-09-16 21:30:34 +09:00
KOKI
b32d864f0b Simplify NodeGraphExample::new() 2022-09-16 21:20:34 +09:00
KOKI
9c662f8ae1 fix clippy 2022-08-26 13:50:50 +09:00
KOKI
d3fa4d3ff2 fix NodeGraphExample::new() 2022-08-26 13:27:07 +09:00
KOKI
be08862056 Merge branch 'persistence' into outside-userstate 2022-08-26 03:17:46 +09:00
KOKI
774eb5247c add feature persistence 2022-08-26 03:17:40 +09:00
KOKI
84c32c720e Change UserState to outside of GraphEditorState 2022-08-26 02:40:59 +09:00
Mathias Pius
b1deb59af1
Bump egui to 0.19.0 2022-08-25 08:23:12 +02:00
Setzer22
ec0e863dc7 Add UserState to build_node
This is necessary if your NodeTemplate struct can't store all the
necessary information to define a new node.
2022-06-29 15:04:57 +02:00
Setzer22
9bc0ebc946 Fix the example 2022-06-21 10:57:19 +02:00
Setzer22
d8189997ce Multiple improvements 2022-06-09 21:25:25 +02:00
setzer22
7bba780c92
Merge branch 'main' into widget-response 2022-06-07 21:18:31 +02:00
IsseW
6174e14a0f add doc comment, and fix typo 2022-05-31 11:07:35 +02:00
IsseW
ad3c9b1383 widget response 2022-05-31 11:07:35 +02:00
KOKI
9f4d20e2e2 change connections color for each data type. 2022-05-30 17:51:46 +09:00
KOKI
303af6ac14 support light mode 2022-05-27 21:33:57 +09:00
Philpax
095e86f823 Use one evaluator for all cases 2022-05-24 18:08:31 +02:00
Philpax
9386057e48 lambda -> closure 2022-05-24 17:14:26 +02:00
Setzer22
452607d9ad Force run CI 2022-05-24 16:56:56 +02:00
Philpax
430c3dadcc Fix #26 - use lambdas/a struct instead of macros 2022-05-24 14:04:05 +02:00
Setzer22
42bd98e9ed Revert putting the graph inside a window
There are a few issues with this approach that have been documented in
Issue #27.
2022-05-24 11:56:03 +02:00
Setzer22
84884f05a9 Fix merge conflicts and update to latest main 2022-05-24 11:48:19 +02:00
Setzer22
568a5aeb82 Merge latest main. Resolve conflicts and apply thread suggestions 2022-05-24 11:45:13 +02:00
nekomehako
b81479cc88 Fix a crash bug when deleting an active node 2022-05-11 01:56:34 +09:00
Greg Morenz
0ca71cec86 Update to egui 0.18 2022-05-09 20:16:08 -04:00
Lukas Wirth
bf86623866 Update to egui 0.17 2022-04-02 14:05:16 +02:00
Setzer22
60a37ab4ea Expand the example to include graph evaluation 2022-03-23 09:54:47 +01:00
Setzer22
c88aae2110 More serde derives and adjust NodeTemplateIter return value 2022-02-24 20:10:25 +01:00
Setzer22
4804b859c1 Move generic parameters to associated types in NodeDataTrait 2022-02-22 15:32:55 +01:00
Setzer22
e16968256a Documentation, readme 2022-02-19 19:42:02 +01:00
Setzer22
db4c4f0f9f Cleanup blackjack-specific responses. Add custom user responses 2022-02-19 18:00:10 +01:00
Setzer22
a40d2343f3 Finish up initial implementation. Add example code 2022-02-19 12:28:58 +01:00