Commit Graph

129 Commits

Author SHA1 Message Date
Braks
445718d6f4 update(examples): correct examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
69dc45c3be update(examples): fix examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
5139b0786b update(examples): correct examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
ca2eca4265 refactor(store): add getters for selected nodes/edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
a983858acf update(examples): use computedPosition in GroupNode.vue
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
774cb2e644 feat(flow)!: Remove node/edge-types prop
* infer node/edge types from types used in elements

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
d730869443 update(examples): adapt examples
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
c96f62f622 refactor(flow)!: properly nest components
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
0450ba2eae feat(store): flatten child map of nodes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
076ff4ce54 refactor(nodes): use plugin to import prop interface
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
b80341467b refactor(types)!: Remove elements and replace with nodes and edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
f28e10b05a refactor(types): Remove internal __vf field
* fields are merged into the GraphNode / Node interface
* Remove passing props from VueFlow container, use injected state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
3f0b0dbd70 feat(nodes): nested boundaries
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
f00f34d84b refactor(types)!: Remove ElementId type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
fe0eeaeae9 refactor(types)!: change node and edge types to extend element
* element type provides intersection interface of nodes and edges
* rename isHidden to hidden

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
da54bc3316 refactor(types)!: Remove Node/TranslateExtent
* replace with CoordinateExtent

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
ecd38b232b feat(examples): Add grouping example
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
f5caf94cfa update(examples): remove node zoom from basic example
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 15:42:18 +01:00
Braks
b1f541b63d refactore(store)!: Remove transition and loading.transition property
* Tranisitions break testing and are superflous

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 15:42:18 +01:00
Braks
0816bf0c75 update(examples): remove pinia
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 15:42:18 +01:00
Braks
796c60431f feat(test): Add cypress for testing 2021-11-27 16:53:24 +01:00
Braks
27e39796a0 fix(nodes): nodeExtent not set on position update
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-26 15:33:56 +01:00
Braks
4630f3efc1 refactor(edges): Make edge updating optional
* 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>
2021-11-26 11:08:12 +01:00
Braks
0b2764028f update(nodes): watch nodes width for dimension update
* 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>
2021-11-25 19:29:13 +01:00
Braks
bb0b9049ea fix(flow): props not being watched on time
* updated example for UpdateNode

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
9e941966a4 feat(nodes): add option to pass a valid target pos / valid source pos func to nodes
* 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>
2021-11-25 15:21:36 +01:00
Braks
74cc61ad8d feat(utils): make addEdge and removeElement mutate the array passed in
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
729d3d5ca2 update(examples): remove watchEffect from UpdateNodeExample.vue
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>

update(examples): fix style calculation in CustomNode.vue

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
708fa1f970 refactor(options)!: remove worker and store option
* either unnecessary, broken or needs more work

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
89849f4eac update(connection): pass source node to ConnectionLine as prop
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
409a268ddd fix(examples): wrong type added to button-edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-24 01:05:03 +01:00
Braks
f4559398f6 fix(examples): interaction example firing events wrong
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-24 00:22:09 +01:00
Braks
9ec1c4dc2b fix: remove deep flag from elements and store-elements watcher
* deep watching causes a reset after positions change
* fallback to non-worker parsing

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 13:55:41 +01:00
Braks
2b065b4e56 update: pass store state as props to edge-renderer and edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 13:40:25 +01:00
Braks
6059b02e44 update: Pass down values as props instead of relying on store
* store values are passed down by main vue flow component
* store is only used to emit events or if really necessary in the component
* add keys with store id to elements
*

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 12:25:32 +01:00
Braks
c35673c622 refactor: pass props to edge/nodewrapper separately
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 01:22:27 +01:00
Braks
b10207021f refactor(types)!: Change ConnectionLineComponentProps to ConnectionLineProps
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 19:05:24 +01:00
Braks
062aee45b2 update!: graphnode and node typing
* 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>
2021-11-21 16:25:27 +01:00
Braks
ba24f3ca62 update(edges): useAttrs on edges to use style
* remove class and style props, pass them as attrs

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 13:33:59 +01:00
Braks
0e9f8c5fc2 refactor: rename internal data field to __vf
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 12:54:04 +01:00
Braks
39b21faa5b refactor(types)!: Remove elements prop, change EdgeTypes/NodeTypes prop to string[]
* 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>
2021-11-20 22:10:25 +01:00
Braks
668fed1dc4 feat: Add dedicated default loading component
* add option to pass a transition name

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 18:22:30 +01:00
Braks
4e8ff6201a feat: Add loading indicator slot and prop
* 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>
2021-11-20 17:33:27 +01:00
Braks
1b6ea1e1b5 update: make types for nodes and edges a computed prop
* remove nodeTypesId (was used in react to manually trigger a nodeTypes change)

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 03:28:46 +01:00
Braks
6a1571e6e3 fix: Flow not properly pre-loading state
* pass key to initFlow to possibly find a pre-existing state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-20 00:40:42 +01:00
Braks
6a68292f7c feat: merge store with props
* 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>
2021-11-19 23:45:39 +01:00
Braks
37388ddf47 feat(types): Add NodeTypes and EdgeTypes
* Interface for passing an object of NodeTypes/EdgeTypes
* Object needs to be passed with components markedRaw

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 17:47:57 +01:00
Braks
ee95fbe34a update(examples): rgb flow styles
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 15:41:25 +01:00
Braks
f92c5462bf update: a couple more perfomance related updates
* check for selected value inside Node instead of the wrapping renderer
* instead of "parsing" elements just return the current store.elements object
* use map funct to find index

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 15:41:00 +01:00
Braks
f99dca1c11 update(examples): Use vmodel for custom node
* use v-model for save & restore example

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-19 13:47:09 +01:00