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 hardcoded margin causing nested levels to have negative radius #4587

Merged
merged 1 commit into from
Aug 27, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export interface NestedPetrinetOptions extends Options {
dims?: string[];
}

const CIRCLE_MARGIN = 2;
const { getNodeTypeColor } = useNodeTypeColorPalette();
const { getNestedTypeColor, setNestedTypeColor } = useNestedTypeColorPalette();

Expand Down Expand Up @@ -193,7 +192,8 @@ export class NestedPetrinetRenderer extends PetrinetRenderer {
Object.entries(node).forEach((kvPair, i) => {
if (kvPair[0] === '_key') return;
const value = kvPair[1];
const childRadius = CIRCLE_PACKING_CHILD_NORMALIZED_RADII[nestedNodesLen] * parentRadius - CIRCLE_MARGIN;
const margin = parentRadius * 0.03;
const childRadius = CIRCLE_PACKING_CHILD_NORMALIZED_RADII[nestedNodesLen] * parentRadius - margin;

const xPos = parentRadius * CIRCLE_PACKING_CHILD_NORMALIZED_VECTORS[nestedNodesLen][i][0] + parentX;
const yPos = parentRadius * CIRCLE_PACKING_CHILD_NORMALIZED_VECTORS[nestedNodesLen][i][1] + parentY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const getModelRenderer = (
useAStarRouting: false,
useStableZoomPan: true,
zoomModifier: 'ctrlKey',
zoomRange: [0.1, 30],
runLayout: runDagreLayout,
dims,
nestedMap,
Expand Down
Loading