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

support for top-down scalefactor #153

Merged
merged 32 commits into from
Feb 28, 2024
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9da7868
new render scaling to scale children of nodes
Eddykasp Mar 8, 2022
25a4b0f
experimental launch configs
Eddykasp Mar 8, 2022
4ee8929
change property name to fit the new name following changes in elk
Eddykasp Mar 17, 2022
d47ddaf
update property check
Eddykasp Mar 17, 2022
8275973
document the update necessary to fix the scaling and translate issue
Eddykasp Mar 18, 2022
74281bc
fix topdown rendering
Eddykasp Mar 18, 2022
56a928f
add fixme
Eddykasp Mar 22, 2022
ed346bf
use scalerendering in all potentially relevant places
Eddykasp Mar 22, 2022
f3d4abe
reference https://github.com/kieler/KLighD/pull/110, this code needs …
Eddykasp Mar 30, 2022
a85e25a
Merge branch 'main' into mka/topdown
Eddykasp Apr 27, 2022
d208385
update topdown scalefactor access
Eddykasp Apr 28, 2022
d520769
debug info
Eddykasp Apr 28, 2022
fe98b9c
documentation of problem
Eddykasp Apr 29, 2022
62a0c4b
further documentation of why rendering the topdown scaling is difficu…
Eddykasp Apr 29, 2022
1d5237f
Merge branch 'main' into mka/topdown
Eddykasp Jun 2, 2022
e8bd1ea
Merge branch 'main' into mka/topdown
Eddykasp Jul 13, 2022
a6572da
fix scaling of child areas
Eddykasp Jul 28, 2022
893c053
undo bad changes
Eddykasp Jul 28, 2022
2622f1c
Merge branch 'main' into mka/topdown
Eddykasp Jul 29, 2022
48b279f
Merge branch 'main' into mka/topdown
Eddykasp Jul 29, 2022
a3b30bf
Merge branch 'main' into mka/topdown
Eddykasp Aug 5, 2022
cd78397
basic depth map expansion for topdown layout, still very buggy, but w…
Eddykasp Aug 19, 2022
21cb38f
Merge branch 'main' into mka/topdown
Eddykasp Nov 21, 2022
a772d23
Merge branch 'main' into mka/topdown
Eddykasp Jun 6, 2023
8c55afd
junction point scalingÄ
Eddykasp Jun 12, 2023
f3db9c8
Merge branch 'main' into mka/topdown
Eddykasp Jun 16, 2023
73462b1
Merge remote-tracking branch 'origin/main' into mka/topdown
Eddykasp Aug 31, 2023
0e983f5
remove experimental depth-map changes from this branch
Eddykasp Sep 12, 2023
eda185e
Merge branch 'main' into mka/topdown
Eddykasp Jan 22, 2024
ebf9d71
Update views-rendering.tsx
Eddykasp Jan 22, 2024
da17eb1
Update views-rendering.tsx
Eddykasp Jan 22, 2024
1eef24e
Update views-rendering.tsx
Eddykasp Jan 22, 2024
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
21 changes: 19 additions & 2 deletions packages/klighd-core/src/views-rendering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@ export function renderChildArea(
</g>
)

return element
// get scale factor and apply to child area
if (
(parent as any).properties === undefined ||
(parent as any).properties['org.eclipse.elk.topdown.scaleFactor'] === undefined
) {
return element
}
const topdownScaleFactor = (parent as any).properties['org.eclipse.elk.topdown.scaleFactor'] as number
return <g transform={`scale (${topdownScaleFactor})`}>${element}</g>
}

/**
Expand Down Expand Up @@ -1525,9 +1533,18 @@ export function getJunctionPointRenderings(edge: SKEdge, context: SKGraphModelRe
}

const renderings: VNode[] = []

let topdownScaleFactor = 1
if (
(edge.parent as any).properties === undefined ||
(edge.parent as any).properties['org.eclipse.elk.topdown.scaleFactor'] === undefined
) {
topdownScaleFactor = (edge.parent as any).properties['org.eclipse.elk.topdown.scaleFactor'] as number
}

edge.junctionPoints.forEach((junctionPoint) => {
const junctionPointVNode = <g transform={`translate(${junctionPoint.x},${junctionPoint.y})`}>{vNode}</g>
renderings.push(junctionPointVNode)
renderings.push(<g transform={`scale (${topdownScaleFactor})`}>${junctionPointVNode}</g>)
})
return renderings
}
Loading