Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component | Graph: SVGs in Link labels, Zoom start/end callbacks, Fit view to specific nodes, Docs update #465

Merged
merged 10 commits into from
Oct 30, 2024

Conversation

rokotyan
Copy link
Contributor

This PR adds a few news features to the graph component and updates the documentation (covering the previous updates too).

SVGs in Link labels

Screen.Recording.2024-10-17.at.3.15.34.PM.mov

Fit View to specific nodes

Screen.Recording.2024-10-17.at.3.17.20.PM.mp4

New Zoom callbacks

image

Docs update

Screen.Recording.2024-10-17.at.3.18.42.PM.mp4

…s for internal links

Render link labels as SVG `use` elements when the label text is an id pointing to the element provided via `svgDefs` to the container. This allows the link labels to use SVG icons instead of simple text
Consolidate utility exports in `packages/ts/src/index.ts` by creating a new `utils/index.ts` file that re-exports all utility modules. This simplifies the main entry point and makes it easier to discover and use the available utility functions.
- Ensures the `fitView` method waits for the `_layoutCalculationPromise` to resolve before calling `_fit` to prevent potential errors.
- Adds `onZoomStart` and `onZoomEnd` callbacks to the `GraphConfigInterface` to allow users to hook into the start and end of the zoom behavior.
- Implements the `_onZoomStart` and `_onZoomEnd` methods to call the respective callbacks when the zoom behavior starts and ends.
- Adds an optional `nodeIds` parameter to the `fitView` method that allows the caller to specify which nodes to fit the view to.
- Updates the `_fit` method to filter the nodes to the specified `nodeIds` if provided, or use all nodes if not.
- This enables users to focus the view on a subset of nodes, rather than always fitting the entire graph.
@lee00678 lee00678 merged commit bc6ddfc into f5:main Oct 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants