Commit Graph
52 Commits
Author SHA1 Message Date
Braks 2fa7e22b5f feat(background): Allow background height/width to be set
* allow for bgColor to be set
* allow for no pattern to be used
2022-03-14 14:10:38 +01:00
bcakmakoglu ac6f62f0a3 update(flow): deprecate modelValue prop
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:08:25 +01:00
bcakmakoglu 6746d6bb46 fix(flow): fix typo in paneMovable prop
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:07:57 +01:00
bcakmakoglu d835e4546c update: add missing property to store
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 8260eabc58 fix: typings for UseVueFlow
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 2731d0bf5e fix: typings for UseVueFlow
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks ca85d8002e refactor(flow)!: Remove useElementsState utility
* to avoid confusion and duplicates remove the useElementsState utilities
* move functionality to store actions

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks 16997494ab update(zoom): set store instance before emitting pane-ready event
* add missing generics on getters
* replace ? notation with undefined (does not mean the exact same, i.e.
`instance?: FlowInstance` will become `Ref<FlowInstance | undefined> | undefined`
using `instance: FlowInstance | undefined` results in `Ref<FlowInstance | undefined>`

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks 35165c3a98 refactor: make nodes/edges for useStates helpers optional
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks a9e7eb31ea feat(flow): Narrow options type for useNodesState/useEdgesState/useElementsState
* remove storageKey
* make modelValue optional

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks ee6bf3252e refactor(flow): Watch models
* replace model value after re-setting elements/nodes/edges

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 4c7cf39e7b refactor(flow): add options to useElementsState
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks b12863f297 refactor(flow): lowercase event names (OnPaneLoad -> onPaneLoad)
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e64f6b7bc6 update(types)!: Rename FlowActions/FlowGetters etc. to Actions, Getters
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e2e094b987 feat(flow): Add option to disable default change handlers globally
* overwrites applyDefault setting for useEdgeState/useNodeState/useElementsState
* export apply change handlers

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 423f6aa78d refactor(flow): remove separate apply changes function and add them to useNodesState useEdgesState
* immedatiely execute props watcher

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 994dd9929c feat(flow): export applychanges utilities separately
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 39501d0bb0 refactor(flow): export useNodesState and useEdgesState separately from useVueFlow
* bind vueFlow instance to currentInstance when useVueFlow is called multiple times in a single setup call

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks f8a23c59ec refactor(flow)!: Use watcher to change every prop as a single item
* instead of replacing the whole state on each watch trigger, split into multiple watchers that set a single state
* improve reacitivty and two-way binding for v-models
* remove elements option -> only modelValue (old api) or nodes/edges

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 91009e1dca feat(store): add store as refs to useVueFlow
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks d9e0675385 refactor(nodes, edges): Add slots to node/edge labels
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 518d12d381 feat(flow): add utilities to useState functions 2021-12-20 19:29:52 +01:00
Braks 65b2e0d148 feat(flow): Add setNodes and OnNodesChange / setEdges OnEdgesChange utils to useNode/Edge-state
* add option to apply default change handler
2021-12-20 19:29:52 +01:00
Braks c80ab8fe50 feat(store, flow)!: Add useNode/useEdge-state helpers
* for two way binding use the helpers
2021-12-20 19:29:52 +01:00
Braks 81c8145f3a feat(store, flow)!: Add apply changes handlers
* flow will not update changes unless a handler to apply changes is passed
* a default handler is available in the useVueFlow composable
* removeElements export removed
2021-12-20 19:29:52 +01:00
Braks d875cfede3 feat(flow): Add event listener to vueflow object
* event listener also exist in store state (hooksOn)
* add applyChangesHandlers to vueflow object, can be used to apply changes i.e. deleting etc.

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 7cb6192591 feat(zoom): Add new zoom pan helper functions + transition for all helpers
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 056bcd5dd9 refactor(types)!: remove arrowhead and replace with markertype
* remove markerEndId
* rename arrowHeadColor to defaultMarkerColor

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 c82ca4e225 update(zoom): add getElements helper
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 368b0de1b6 feat(types)!: extend Element generics to DataNode and DataEdge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 74c30376a5 refactor(types): use vite-plugin-import-types
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +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 43b68c1699 feat(zoom): Add option to zoom to specific node ids and transitionDuration for smooth transitions on fitView
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-26 15:59:01 +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 f2e38ca7ac update(nodes): add __vf to node props
* move edge/node component-types to components file

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 96d54c59dc refactor(store): check if state variables have to be re-set
* instead of just pasting over the state constantly check what needs to be re-set

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 8b0ddc9be9 refactor(types): Remove SourceTargetNode-type
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 073b25ec60 feat(zoom): Add offset to fitview-params
* Allow for offsetting fit view by x or y values

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 23:58:11 +01:00
Braks d22e21041d fix(edges): edges not reacting to hidden nodes
* 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>
2021-11-23 18:25:08 +01:00
Braks cddf875b6d feat(types): Add GraphEdge type
* GraphEdges are edges that have been parsed and have a sourceTargetNode property

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 17:46:55 +01:00