Commit Graph

84 Commits

Author SHA1 Message Date
Braks
8fbfca1e7a refactor(edges)!: Replace getMarkerEnd utility with getMarkerId
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
d2ac41e4f7 update: correctly overwrite nodes on re-parsing
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
425fc500b0 fix: selection changes overwriting itself
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
947baefa02 update(nodes): Add draggable,selectable and connectable as props to nodes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
1b206c942c feat(edges): Add source-target-pos to graph-edge
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
17a1b08ee0 refactor(store)!: replace store injection with VueFlow injection 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
b365e947e1 refactor(flow): use computedPosition when checking inner bounds
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
9abd768bce fix(edges): connection line not showing up when no edges are defined
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
6903dcb139 refactor(utils): move store utils to state
* set z index on edge
* extend edgeVisibleParams by dimensions of target and node edge

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
6bdea72b20 refactor(store)!: use stored node data when re-parsing elements
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
2350d83718 fix(edges): edges not properly calculating position
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
e2d60bedfd update(store): add source/target nodes on edge parsing
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks
3e42948cac chore: remove unused imports
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
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
9c1f04426e feat(nodes): add store id as class to handles
* for better identification, add a class to handle according to the current store id

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
1a3b68373e update(store, types): overload flowoptions typings with non-nullables in flowstate
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 15:42:18 +01:00
Braks
3b448100d6 fix(store): correct injection and remove id from refs
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
3c9840cc50 update(types): Rename FlowStore to Store and ReactiveFlowStore to FlowStore
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 15:42:18 +01:00
Braks
58a8f9d4df refactor(store)!: remove pinia
* replace pinia with a reactive state object and inject/provide

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>

update(store)!: inject store if possible, otherwise create a new one by id

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
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
4408ca1eb7 refactor(graph): async process elements
* 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
2021-11-25 19:29:13 +01:00
Braks
6c3bce88a7 update(graph): mutate elements arr on updateEdge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
233e915376 update(store): remove promise from setState
* add default values for nodeTypes/edgeTypes - empty array for customs

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
fd83a6d365 fix(store): parsing overwriting __vf fields or not writing them at all
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
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
5ffeb928ae refactor: move parseElements to graph utils
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
725dc8acb7 refactor(store): remove nodes/edges field
* nodes/edges are accessed via getter - that retains reactivity on elements

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
fa63dee37a refactor: remove node-pos actions
* add getSelectedNodes getter

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
84bad861ea refactor(nodes): remove __vf.position
* duplicate position values as __vf.position and position save the same values

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks
1eac951055 feat(types): add DefaultEdgeTypes-type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>

feat(types): Add DefaultNodeTypes-type

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>

feat(types): Add DefaultNodeTypes and DefaultEdgeTypes to the exports object

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 23:58:11 +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
dbe82a718a fix: node selection not working if selectable === undefined
* selectable has to be explicitly false for node selection to skip the node

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:17:46 +01:00
Braks
46ecec5366 feat(options): add preventScrolling option
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 14:12:43 +01:00