Commit Graph
61 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 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 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 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 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 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 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
BraksandGitHub 796c60431f feat(test): Add cypress for testing 2021-11-27 16:53:24 +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 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 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 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 17f7e4b0e7 fix(nodes): dont select nodes when selectable=false closes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 14:01:02 +01:00
Braks b9bb3cfb1a update(types): remove null types and use undefined
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:14:57 +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 e4ead738c9 update(types): Correct __vf typing
* fix all uses of __vf so the actual type works properly
* correct the class and style props

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 13:33:12 +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 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 aaf5f608f5 feat: add path alias for src
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-06 09:38:02 +01:00
Braks 5437d48325 fix: custom node example not fitting view
* fit view can't work (for the onLoad event) for elements assigned after the host has mounted (onMounted hook) as we can't calculate a rect of elements that don't exist at flow creation
* in this case just trigger fit view __after__ elements have been created/passed to the flow

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-06 08:54:35 +01:00
Braks ae0772b6d4 update(docs): fix view height 2021-11-06 08:54:35 +01:00
Braks 61779638ac update(dist): Remove rollup and use vite to build lib
* Remove custom tsconfig paths to avoid resolving issues on published package
2021-11-06 08:54:35 +01:00
Braks 64df75d405 feat(docs): Initial commit for docs in nuxt 3 2021-11-06 08:54:35 +01:00
Braks 6ec8258f33 fix: typings 2021-10-22 14:29:27 +02:00
Braks 3f863ef71c update(examples): Add Save & Restore example
* add localforage to dev deps
2021-10-22 10:00:21 +02:00