Commit Graph

27 Commits

Author SHA1 Message Date
Yuxin
c76940d6ef
refactor: pass context in layout (#5906)
* feat: layout support context

* fix: fix ci issues

* refactor(utils): ajust layoutAdapter types

* chore: fix deps version

* chore: fix ci report

* test: update snapshot

---------

Co-authored-by: Aaron <yangtao.yangtao@antgroup.com>
2024-06-20 20:49:08 +08:00
Yuxin
49398ddecc
feat: add fullscreen plugin (#5825)
* feat: add fullscreen plugin

* fix: fix cr issues

* docs: add alias
2024-06-06 10:19:35 +08:00
Yuxin
f0cbeba90a
docs: plugin api docs and demo (#5703)
* refactor: modify plugin comments

* docs: add plugin demos

* fix: fix ci
2024-05-07 20:43:47 +08:00
Aaron
63261258cf
refactor: emit graph destroy event (#5680) 2024-04-25 19:10:18 +08:00
Yuxin
09a62abc38
feat: hull plugin (convex hull, concave hull) (#5626)
* feat: hull

* feat: hull label and dynamically change options

* feat: hull supports convex and concave hull

* docs: site demo

* test: add unit tests

* test: fix ci issues

* chore: update deps

* fix: fix cr issues

* test: contextmenu unit test

* test: update snapshots
2024-04-11 20:43:33 +08:00
Yuxin
62535be333
feat: history plugin (#5605)
* feat: base history plugin

* feat: mount history api to graph

* test: history unit and integration test

* refactor: simplify compute draw data

* test: update snapshots

* feat: history event emitter and site demo
2024-04-11 18:49:18 +08:00
Aaron
6583288f83
feat: add 3d behaviors (#5614)
* refactor: adjust ExtensionCategory to enum

* feat(plugins): add camera setting plugin

* refactor(utils): shortcut support drag extend key

* refactor: adjust event type definition

* refactor: emit canvas event

* refactor: adjust exports

* refactor: adjust renderer

* feat(behaviors): add 3d behaviors

* test: add dev demos

* chore: adjust package.json

* refactor: fix getExtension type
2024-04-03 20:46:59 +08:00
Aaron
61fa3d158a
refactor(runtime): add element lifecycle event (#5611)
* test: remove async from createGraph

* refactor(runtime): add element lifecycle event
2024-04-03 11:59:22 +08:00
Aaron
da5297cd8c
feat: add 3d elements, plugin (#5597)
* refactor: adjust exports, use enum replace const enum

* fix: fix issue that unexpected z attr

* feat(utils): add TupleMap and getCacheKey

* feat(elements): add 3d elements

* feat(plugins): add 3d light

* refactor: adjust 3d renderer

* refactor: adjust exports

* test: add demos

* chore: config packages.json, jest config

* test: fix test case

* chore: update g6-extension-3d version

* chore: setup project configs

* test: fix demo type issue

* chore: config tsconfig for type-check
2024-03-29 11:57:10 +08:00
Yuxin
810f982719
feat: refine theme and add support background (#5538)
* refactor: support setting background

* docs: add theme demo

* test: update snapshots

* feat: palette field support callback

* test: update tests and snapshots

* fix: wordwrap set false

* fix: fix cr issues

* fix: animation field

* test: update test case and snapshots
2024-03-15 19:36:27 +08:00
Yuxin
52e9eeccd1
docs: add curve loop and polyline loop demos (#5524)
* docs: add curve loop and polyline loop demos

* refactor: node mapper supports callback
2024-03-12 21:02:26 +08:00
Aaron
673546e641
feat: add grid line plugin (#5498)
* refactor(test): demo support disable default grid

* refactor(runtime): uniform graph lifecycle event, emit size change event

* feat(utils): add mod util

* feat(plugin): add grid plugin

* refactor(register): adjust extension type definitions

* refactor(runtime): adjust rest widget define

* refactor(test): add test case
2024-03-06 20:02:15 +08:00
Aaron
2fc6e0ebdb
feat(runtime): support fit api (#5489)
* refactor(utils): union support multiple bboxes

* fix(test): fix test env

* refactor(utils): add getBBoxSize, multiple and divide support number

* refactor(spec): adjust animation, add extra viewport options

* refactor(behaviors): zoom canvas set pointer position as origin when wheel

* refactor(behaviors): drag-canvas use graph api

* feat(runtime): support fit api

* refactor(test): update test case and snapshot use x,y

* refactor(animation): add getAnimation util to get global animation config

* refactor(utils): remove getElementsBBox, and extend union to getCombinedBBox
2024-03-04 20:44:24 +08:00
Aaron
b86bdcde91
feat: add behavior controller and zoom-canvas (#5470)
* feat(utils): add parseBehaviors util

* feat(constants): add events definition

* refactor(event): rename Event to BaseEvent

* refactor(utils): adjust events

* refactor(utils): move isNode to element

* feat(utils): add isEdge util

* feat(utils): add eventTargetOf util

* feat(runtime): add behavior controller

* refactor(runtime): viewport emit standard event

* feat(behaviors): add zoom-canvas

* chore(test): update test env

* refactor(runtime): export event, destroy behavior, add test cases
2024-02-26 18:48:21 +08:00
Aaron
1096dd903d
refactor: adjust test env and fix element types (#5471)
* chore(test): support alias in test cases

* chore(test): adjust test utils, add toMatchSnapshot

* chore(tests): use path alias in tests

* feat(utils): add parseSize util

* chore: set vite alias config

* fix(elements): fix elements types and remove edge sourcePoints

* refactor(tests): adapt size and remove sourcePoint, update snapshots

* refactor(runtime): remove sleep usage
2024-02-26 10:24:02 +08:00
Aaron
288c7b34bf
refactor: replace the animation return value with an event throw (#5445)
* fix(animation): fix issue that onfinish is override

* refactor: emit animation event instead of return

* refactor(element): optimize invoke logic

* refactor(events): rename event name

* refactor(runtime): adjust event value

* refactor(demo): dev env support display timer

* refactor(runtime): rename element render to draw

* feat(utils): add isEmptyData util

* refactor(utils): modify createAnimationsProxy, add withAnimationCallbacks, executeAnimatableTasks

* refactor(runtime): refactor element controller, add events

* refactor: adjust async draw, layout, emit render event
2024-02-21 17:19:10 +08:00
Aaron
0f21e8d6fa
refactor(event): unified event name naming style (#5444) 2024-02-19 20:08:03 +08:00
Aaron
135640afd4
feat: add graph class (#5439)
* refactor(runtime): element provide setElementState api

* refactor(runtime): data update getElementType returns

* feat(utils): add toPointObject util

* test(demos): support render custom panel

* feat(utils): add cacheStyle and getCachedStyle utils

* feat(runtime): element support setElementsVisibility API

* feat(runtime): element support setElementZIndex API

* feat(runtime): emit graph event

* refactor(runtime): implement setElementState, support partial style calc

* refactor(spec): container support canvas instance

* test(runtime): update snapshots

* feat(graph): init graph

* refactor(test): remove getEnv util

* test: fix test case issue

* refactor(utils): rename transformTreeDataToGraphData to treeToGraphData

* test(runtime): add test assertion
2024-02-19 09:58:36 +08:00
Aaron
b51a86e730
feat: add layout controller (#5423)
* refactor(runtime): rename dataController in context to model

* feat(utils): add isVisible and update uitls

* refactor(layout): update layout types and register built-in layouts

* feat(utils): add deduplicate util

* refactor(utils): update inferDefaultValue to infer position

* refactor(element): add updateNodeLikePosition method to update position immediately

* feat(runtime): data controller support call methods without trace

* fix(animation): it's neccessary to reserve commonEffectTiming config

* fix(test): fix test case issue

* feat(utils): add tree data converter utils

* refactor(runtime): update element controller, add get element api, and updateByLayoutResult method

* feat(utils): add layout utils

* refactor(layout): add built-in layouts

* refactor(elements): add built-in edges

* feat(runtime): add layout controller

* test(layout): add and update test snapshot

* test: update test case

* refactor(utils): remove transformGraphDataToTreeData

* fix: fix issue occured in rebase

* refactor(layout): add built-in layout registration

* refactor(spec): support config global animation

* test(runtime): update element controller snapshots

* fix(elements): fix issue that edge lack of default control points

* refactor(runtime): support tree layout

* fix(elements): fix issue that unexpect loop edge infer

* fix(runtime): fix layout error, support global animation, optimize updateNodeLikePosition method

* test(layout): add static layout test case

* refactor(test): update dendrogram snapshot

* fix(utils): fix pickLayoutResult test case

* refactor(types): add positions type

* refactor(runtime): optimize element updateNodeLikePosition perf

* fix(test): fix test case types issue

* test(demo): update test demos

* refactor(utils): modify transformTreeDataToGraphData default getNodeData

* refactor(runtime): data controller provide getParentData API

* refactor(runtime): rename sneak to silence

* refactor(layout): add comment

* refactor(registry): use console.error instead of throw when plugin duplicated
2024-02-18 11:36:50 +08:00
Yuxin
8436aaa9a8
refactor: draw nodes (#5427)
* refactor: draw nodes

* refactor: rename anchorOptions to anchors;rename badgeOptions to badges

* chore: update ts

* test: update ut snapshots

* refactor: circle node

* refactor: ellipse node

* refactor: rect node

* refactor: rename  to

* refactor: star node

* refactor: triangle node

* refactor: update animation fields

---------

Co-authored-by: yvonneyx <banxuan.zyx@antgroup.com>
2024-02-07 22:30:26 +08:00
Aaron
fafec34990
feat: add viewport controller (#5416)
* feat: add viewport controller

* test: add test case
2024-02-04 17:21:28 +08:00
Aaron
c763217197
feat(runtime): add element controller (#5393)
* feat(themes): add theme plugin type definition

* feat(palettes): add palette utils and plugin type definition

* feat(utils): add computeElementCallbackStyle util

* refactor(spec): edge data style support config sourcePort and targetPort

* refactor(animation): adjust executor to adapt undefined animation

* test(spec): fix spec animation test case

* feat(palettes): add built-in palettes

* refactor(utils): adjust palette default logic

* feat(theme): add built in theme

* feat(runtime): add element controller

* refactor(spec): rename port to anchor

* test(registry): update registry test case

* refactor(palettes): remove built in palettes to canstants

* refactor(runtime): data controler remove event emit and provide getChanges API

* refactor(registry): register built-in nodes and edges

* refactor(runtime): adapt data controller changes, store animation result

* refactor(runtime): element style callback returns index and element data extractly

* fix(animation): remove parseAnimation to avoid circular dependencies

* test: update test case

* refactor: adjust demo env

* refactor(animation): executor support specific modifiedStyle, and provide default style value infer

* refactor(themes): update built-in themes

* refactor(utils): update createAnimationsProxy to avoid sync onframe and onfinish to all instances

* refactor(runtime): refactor cavas init function

* refactor(spec): support to disable animation

* test: update test spec

* test: update test case

* refactor(runtime): update element controller and integration cases

* chore: update editor config

* refactor(runtime): update render logic and fix issue that data states change
2024-02-02 17:34:33 +08:00
Aaron
64175c58c2
feat(spec): init spec definition (#5371) 2024-01-25 21:19:17 +08:00
Aaron
53a3a5341b chore: clear workspace 2024-01-25 15:10:00 +08:00
Aaron
6ce28292b3
fix: fix typos (#5219)
* fix: fix typos
2023-12-04 20:46:28 +08:00
hustcc
ae95e92140
refactor: remove unused files, and add husky and commitlint (#4383)
* refactor: remove unused files, and add husky and commitlint

* test: add github action
2023-03-23 20:43:53 +08:00
Yanyan-Wang
3095544cdf chore: commit history cleaning 2023-02-02 10:31:36 +08:00