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

fix cytoscape zoom issue #3835

Merged
merged 7 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The types of changes are:

## [Unreleased](https://github.com/ethyca/fides/compare/2.17.0...main)

### Fixed
- Fix datamap zoom for low system counts [#3835](https://github.com/ethyca/fides/pull/3835)

### Added

- HTTP Logging for the Privacy Center [#3783](https://github.com/ethyca/fides/pull/3783)
Expand Down
8 changes: 8 additions & 0 deletions clients/admin-ui/src/features/datamap/CytoscapeGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ const CytoscapeGraph = ({
};
if (datamapGraphRef.current) {
datamapGraphRef.current.on("click", "node", setNode);
datamapGraphRef.current.on("layoutstop", () => {
// solution found here: https://github.com/cytoscape/cytoscape.js/issues/941#issuecomment-104501028
if (datamapGraphRef.current && elements.length < 5) {
datamapGraphRef.current.maxZoom(2.5);
datamapGraphRef.current.fit();
datamapGraphRef.current.maxZoom(100);
}
});
}

return () => {
Expand Down