* triggered after elements have been processed and updated in store
* add missing selection change trigger to store
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* add an option to enable edge updating globally
* pass an option to an edge to enable updating for a single edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* add force param to setElements, if set we clear the elements arr (default true)
* wait for store watcher until store is ready (i.e. a state has been set)
* move renderer css class to Renderer.vue
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* process elements in chunks of 50 per ms to avoid blocking main thread
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
refactor(flow): deferr initial loading to Renderer.vue component
* edge updater cannot discern a valid connection by itself so we allow an option to pass a valid connection func to nodes which will then be used to determine if updating connection is valid
* it is optional, by default all connections are valid
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* omits scale, grid, enableuserselecthack and enabletransformfix as valid options for draggable
* remove event interface and emits from nodewrapper
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* Change getEdges to parse edges with source & target nodes and filter if one of them is missing
* add new type for Edges w sourceTargetNode called GraphEdge which is the return type of getEdges
*
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* graphnode is a node containing internal Vue Flow data
* move util files to util directory
* move flow actions type into store file
* rename panel type file to zoom
* rename types file to flow
* Rename Node to NodeWrapper
* Rename Edge to EdgeWrapper
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* no more elements prop - v-model instead!
* Instead of passing an object map to components just pass in an array of strings as nodeTypes/edgeTypes object
* the string name will either be resolved to a dynamic component with :is="type" or a slot with the type-name
* update all examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* While the graph is suspended we open up a loading indicator slot
* a prop option has to be passed to enable the indicator
* add some styles for a default loading text
* move loading event to after store has been initialized *and* zoom pane dimensions are present
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* if options are passed to useVueFlow, we want to merge them with possibly passed props
* renamed flowStore to stateStore
* fix examples
* add store prop to pass an already existing store to flow
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* Add getter for node/edge types
* change nodeTypes prop type to only Record<string, NodeType> - same for edges
* Add rgb example
* remove v-model for elements
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
* For easier access and to avoid context issues with injections hooks are put into the store
* hooks can be accessed and will emit events when the flow has bound its emit function to the hooks
* useHooks and useStore are not exported anymore! Instead, useVueFlow is provided, which will return an instance of the current vue flow store
* Rename NodeIdContextKey to NodeId
* Add addElements function to store to add elements without having to re-set the whole store
* use v-model for elements, re-set elements only if there's an actual change
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>