Commit Graph

342 Commits

Author SHA1 Message Date
atlasan
cbbdd38eab ctx.roundRect re-Apply modern way for [radius] 2021-10-11 11:51:51 +02:00
atlasan
edfcc5ccbf Fixes and cleaning
- broken missing LGraph.nodes_executing and nodes_actioning

- fix detect location for in out buttons in subgraph

- clean debugs
2021-10-09 18:48:45 +02:00
atlasan
95e10bd80e some cleaning 2021-10-09 12:42:46 +02:00
atlasan
662817ecbd Cleaning and LOST CHANGES 2021-10-09 12:34:56 +02:00
atlasan
b337cd07ef Many improvements and implementations, TEST EM
- allow connecting from IN to OUT (drag an IN slot to create a link to
OUT slots)

- dim (opacity) uncompatible slots while creating a link

- filter in the searchbox for types (slotsIn, slotsOut), autofilter when
chaining

- drag-shift a slot to search and connect a new node

- code widget re-enabled

- properties panel improvements

- paste will use mouse coordinates


:: properties and methods ::
- additional shape GRID_SHAPE intended for slot arrays
- NODE_MODES_COLORS array of colors based on the node modes

node_box_coloured_by_mode: false, // [true!] nodebox colored on node
mode, visual feedback
node_box_coloured_when_on: false, // [true!] this make the nodes box
(top left circle) coloured when triggered (execute/action), visual
feedback

dialog_close_on_mouse_leave: true, // better true if not touch device
dialog_close_on_mouse_leave_delay: 500,

shift_click_do_break_link_from: false, // [false!] prefer false if
results too easy to break links - TODO custom keys
click_do_break_link_to: false, // [false!] prefer false, way too easy to
break links

search_hide_on_mouse_leave: true, // better true if not touch device
search_filter_enabled: true, // [true!] enable filtering slots type in
the search widget, !requires auto_load_slot_types
search_show_all_on_open: true, // [true!] opens the results list when
opening the search widget

auto_load_slot_types: true, // [if want false, use true, run, get vars
values to be statically set, than disable] nodes types and nodeclass
association with node types need to be calculated, if dont want this,
calculate once and set registered_slot_[in/out]_types and
slot_types_[in/out]
- this will create (without adding it) a node for each class when they
are registered. This allows for slots checking. Could raise errors in
case some node miss something: somehow nice.


alt_drag_do_clone_nodes: false, // [true!] very handy, ALT click to
clone and drag the new node

do_add_triggers_slots: false, // [true!] will create and connect event
slots when using action/events connections, !WILL CHANGE node mode when
using onTrigger (enable mode colors), onExecuted does not need this

allowMultiOutputForEvents: true, // [false!] being events, it is
strongly reccomended to use them sequentually, one by one


- find(Input/Output)Slot functions can return the object instead

- connectByType - allow connecting a node slot to a target node using an
auto-slot mode that looks for the right types

- onNodeCreated - new callback

- addOnTriggerInput, addOnExecutedOutput - creates action slots
(triggerIn, executedOut) when needed (changing mode, dragging events
onto the node)

- doExecute and doAction - wraps the onExecute and onAction node
functions with helpers and checks

- onAfterExecuteNode - new callback

- onBeforeConnectInput - new callback, can change slot while connecting
(or create a new one)

- onConnectOutput - new callback, similar to onConnectInput

- onNodeInputAdd, onNodeOutputAdd - new callbacks

- isOverNodeOutput - similar to isOverNodeInput

- helpers findInput, findOutput, findInputSlotFree, findOutputSlotFree,
findSlotByType

- canvas default_connection_color_byType[Off] allows custom colors type
based

- ESC will close panels

- showConnectionMenu will show the "Add menu" while dragging, to connect
after creation
2021-10-09 11:34:33 +02:00
atlasan
a3055c7fcb Couple implementations
- matrix shape (enabled for array slots)
- dim opacity on incompatibile slots when dragging
2021-10-06 17:43:48 +02:00
atlasan
ad9611ce4f Helper pointerListener(Add/Remove)
- moved from LGCanvas to LiteGraph to allow contextmenu and others to
access it easily
2021-10-03 20:29:09 +02:00
atlasan
8d302bd4f9 Simulate right click by multiple fingers 2021-10-02 16:33:50 +02:00
atlasan
b793e5c1d5 remove console.log for pointerevents 2021-10-02 14:29:38 +02:00
atlasan
a66d822e2a PointerEvents: from mouse events to pointer events v1
added LiteGraph.pointerevents_method with default "pointer"
replaced EventListeners with pointerevents_method+"down", "up", etc..
replaced e.localX (and Y) for e.clientX (Y)
fixed e.clientX is not writable

TODO: finish checks and clean
version with console.log("pointerevents..) enabled
alpha working for mobile, touch enabled
2021-10-02 14:26:15 +02:00
atlasan
d3d2586039 First easy fix to touch integration: 2021-10-01 17:02:11 +02:00
tamat
9ad6301101 make removable slots only the ones created from editor 2021-09-16 11:25:32 +02:00
Eike Michel Wobken
3c9ea1cc0a make y pos of widgets customizable 2021-09-15 13:48:57 +02:00
tamat
c2f7e389b9 little fix 2021-08-25 13:46:36 +02:00
tamat
fcf37260ad added semaphore node 2021-08-25 12:59:54 +02:00
Javi Agenjo
d0e8e41390 Merge pull request #242 from turkron/master
changed the auto sort function to make the function es5 compliant as …
2021-08-16 17:12:08 +02:00
Javi Agenjo
334868c84d Merge pull request #247 from Eikeike/RenderTitleFix
Add functionality for title mode NO_TITLE
2021-08-16 17:11:02 +02:00
tamat
f71aad4450 fixes' 2021-08-16 17:00:48 +02:00
tamat
667b04f62a replaced old roundRect function 2021-08-16 16:45:36 +02:00
Eike Michel Wobken
1a10cce69d Add functionality for title mode NO_TITLE 2021-07-30 18:49:04 +02:00
Eike Michel Wobken
0f55726252 Separator only drawn when title is drawn 2021-07-30 13:02:44 +02:00
周存根
94ee0d57d0 Merge branch 'master' of github.com:gausszhou/litegraph.js into master 2021-07-29 11:41:24 +08:00
周存根
3f4666b4e6 fixed subgraph 2021-07-29 11:39:30 +08:00
Nathan Kendall
7ccd907f71 changed the auto sort function to make the function es5 compliant as the rest of the project is already 2021-07-26 10:23:09 +01:00
tamat
998de17038 Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2021-07-12 17:02:29 +02:00
tamat
18e53d8788 minor fix 2021-07-12 17:02:22 +02:00
Eike Michel Wobken
3eb9533ad2 Highlight arrow shape when connecting slots with arrow shape 2021-07-08 17:05:37 +02:00
tamat
bdad111eb0 Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2021-07-02 17:11:08 +02:00
tamat
63d1506efa fixed touch 2021-07-02 17:10:49 +02:00
RobTheFiveNine
d0eedf7232 Fix widget buttons registering clicks twice 2021-06-15 14:37:17 +01:00
RobTheFiveNine
7017bd31ed Fix bug causing property labels not to be used when creating widgets 2021-06-14 14:42:58 +01:00
RobTheFiveNine
bc4ac4724f Add missing brackets that cause context menu bug 2021-06-11 20:12:51 +01:00
RobTheFiveNine
e6af69c887 Merge remote-tracking branch 'upstream/master' into fix/auto_sort_value 2021-06-11 19:59:04 +01:00
tamat
143bd0789a Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2021-06-11 13:39:49 +02:00
tamat
e4e48ff583 mini version 2021-06-11 13:39:43 +02:00
kdb621
75bf136797 Fix Boundary and collapsed issue
* If you collapse a node with a widget after loading the graph, it cannot be expanded.
* Compute Collapsed Nodes boundary is incorrect
2021-05-20 13:26:58 +09:00
tamat
4b47ed9056 added viewport rendering 2021-03-19 20:56:14 +01:00
tamat
41f779c3f8 align to grid in canvas 2021-03-12 16:27:55 +01:00
RobTheFiveNine
875726d396 Fix node types incorrectly sorted in minified code 2021-02-13 15:45:01 +00:00
Ben
b3502d385c working multi-level context menus
working multi-level context menu
2021-01-12 10:14:49 +11:00
tamat
82485c92f4 added beforeChange and afterChange to graph.remove( node ) 2021-01-05 18:08:44 +01:00
tamat
3c66255cfd Merge branch 'master' of https://github.com/jagenjo/litegraph.js 2021-01-05 17:33:46 +01:00
tamat
a1a51ef056 added multiline support for widgets 2021-01-05 17:33:26 +01:00
Javi Agenjo
1020176bc2 Merge pull request #165 from ilyabesk/node_connect_hooks
Remade lost changes from pull request #154
2021-01-04 13:20:30 +01:00
RobTheFiveNine
88994e1843 Change terminology for property descriptors to 'labels' 2020-10-05 18:08:02 +01:00
RobTheFiveNine
66a7a5cf78 Fix serialisation bug when editing string properties 2020-10-05 18:02:31 +01:00
RobTheFiveNine
99b7e93f2d Add ability to control property display name via the 'descriptor' of the property info 2020-10-05 17:45:06 +01:00
RobTheFiveNine
3d7bea5c51 Add ability to automatically sort node types / categories in the context menu 2020-10-01 18:00:58 +01:00
mateuswetah
b9bb66e3e9 Fixes new constants value for hex color string. 2020-09-25 00:34:03 -03:00
mateuswetah
04cc7bac7b Adds NODE_SELECTED_TITLE_COLOR and NODE_SELECTED_TITLE_COLOR for better theme customization. 2020-09-25 00:29:36 -03:00