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

Master Thesis - Node Scaling - Code Review #59

Open
wants to merge 96 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5fce187
define a default for UseSmartZoom and use it
Skgland Jan 20, 2022
dd016f5
whitespace
Skgland Jan 20, 2022
ab9e4af
rewrite conditions
Skgland Jan 20, 2022
d5ac370
the viewport is not supposed to be optional in the context anyway
Skgland Jan 20, 2022
5b9cb2f
change title scaling to use a minimum height instead of a minimum scale
Skgland Jan 20, 2022
c23df12
add launch option to use a lsp running on port 5007
Skgland Jan 11, 2022
4eeb794
workaround no length on undefined exception
Skgland Jan 12, 2022
d6aa4d8
add path to help vs-code find imported modules
Skgland Jan 18, 2022
87adbdb
whitespace
Skgland Jan 20, 2022
ebac50b
perform simple node scaling
Skgland Jan 20, 2022
4a56bd2
fix deprecation warning
Skgland Jan 19, 2022
34f2e6e
fix missing superclass
Skgland Jan 19, 2022
9bce8b5
move the computeDetailLevel and isInBounds from DepthMap to Region
Skgland Jan 19, 2022
c29771b
calculate the detailLevel after determining the absolute position
Skgland Jan 19, 2022
789c349
move sizeInViewport to Region as it is only used on the boundingRecta…
Skgland Jan 19, 2022
0a52477
cleanup duplication between title scaling and node scaling
Skgland Jan 20, 2022
1e0887e
take siblings into account when scaling nodes
Skgland Jan 19, 2022
8e7c479
fix maxParentScale
Skgland Jan 19, 2022
51e9b9e
fix siblings
Skgland Jan 19, 2022
24f7cf3
make scaling nodes independent of scaling titles
Skgland Jan 19, 2022
7436da2
Revert "change title scaling to use a minimum height instead of a min…
Skgland Jan 20, 2022
cd4211a
fix incorrectly placed end tag
Skgland Jan 20, 2022
e41352f
apply node scaling before title scaling
Skgland Jan 21, 2022
e2fdaa5
simplify the code that works with the title scopes
Skgland Jan 21, 2022
4f8bc95
fix missing effectiveZoom
Skgland Jan 21, 2022
e97a983
we don't actually need the calculated bounds here
Skgland Jan 21, 2022
91bb6bd
change scaled title background border color to grey
Skgland Jan 21, 2022
29712cd
add margin
Skgland Jan 24, 2022
a722519
add some comments
Skgland Jan 24, 2022
0ea701b
fix incorrect margin calculation
Skgland Jan 24, 2022
643cc80
initial edge adjustment
Skgland Jan 24, 2022
ddb62a6
fix depthmap size and in bounds calculations in the presence of node …
Skgland Jan 25, 2022
5358877
scale and position edge direction markers
Skgland Jan 25, 2022
6e37b04
use effective zoom for min line width
Skgland Jan 25, 2022
cf98680
fix edge ends ignoring whether node scaling was disabled
Skgland Jan 26, 2022
ee5fa53
bound edge points when scaling by parents bounds taking the margin in…
Skgland Jan 26, 2022
a08a135
actually use _node_scaled_bounds for caching the result of forceNodeS…
Skgland Jan 26, 2022
57148ee
ignore margin for a lines start and end point
Skgland Jan 26, 2022
8b6a73f
simplify transform
Skgland Jan 26, 2022
652ea3f
routingPoints may be missing initially without Incremental Diagram Ge…
Skgland Jan 26, 2022
1b5333a
collapse if if
Skgland Jan 27, 2022
5b3fc1c
add spaces for readability of the svg paths
Skgland Jan 27, 2022
fe47f60
point.length === 0 was already checked
Skgland Jan 27, 2022
f2614a3
use a switch as we probably need to handle splines seperately
Skgland Jan 27, 2022
3092cf2
fix undefined in transform
Skgland Jan 27, 2022
dd32784
change to dropping points that overlap end or start node
Skgland Jan 27, 2022
597df5f
refactor scaling-utils
Skgland Jan 27, 2022
7c07580
[WIP] change edge adjustment
Skgland Jan 27, 2022
ab4710f
fix end_moved_by offset
Skgland Jan 28, 2022
7e0a291
fix off by one error
Skgland Jan 28, 2022
54887e2
keep the control points for the end_choice
Skgland Jan 28, 2022
8d4e7bb
cleanup scaling-util
Skgland Jan 28, 2022
64260eb
remove never read originalTitleHeight again
Skgland Jan 28, 2022
e6030b3
remove classes added for debugging
Skgland Jan 28, 2022
0bdf188
add a comment
Skgland Jan 28, 2022
19835a8
move depth-map.ts into a sub-directory and split of region.ts
Skgland Feb 21, 2022
cf237c6
update doc-comments
Skgland Feb 21, 2022
aac85a9
update doc-comments
Skgland Feb 21, 2022
33e5539
add missing documentation for ScalingUtil
Skgland Feb 21, 2022
f075670
add more documentation for inverseScaleDimension
Skgland Feb 21, 2022
797ba7b
fix spelling
Skgland Feb 21, 2022
378ecc1
clarification
Skgland Feb 21, 2022
e35b591
apply suggestion for better variable name
Skgland Feb 21, 2022
7161688
use plural as this are potentially multiple
Skgland Feb 21, 2022
9c641a4
stop calculating sibling scale if we are already at a scale of 1
Skgland Feb 21, 2022
f9ee070
calculate absolute bounds in SKNode.forceNodeScaleBounds
Skgland Feb 21, 2022
84375bd
fix spelling
Skgland Feb 21, 2022
1c2b1c9
remove no longer necessary localToParentRendered
Skgland Feb 21, 2022
7b68e03
re-add comments that got lost while moving the scaling algorithm
Skgland Feb 21, 2022
f53ef65
remove confused comment
Skgland Feb 22, 2022
14d71ae
remove unnecessary spaces in path
Skgland Feb 22, 2022
8e14cc1
fix absolute bounds calculation when node scaling is off
Skgland Mar 2, 2022
01d3d26
reduce the amount of cache invalidation
Skgland Mar 2, 2022
8e4a43c
improve naming of inverseScaleDimension and expand comment
Skgland Mar 12, 2022
41a4ce3
add the minor optimization mentioned in https://github.com/kieler/kli…
Skgland Mar 12, 2022
66abdf9
fix some not camel case names
Skgland Mar 12, 2022
da982d4
extract line scaling into a function
Skgland Mar 12, 2022
d2a347f
further de-duplicate
Skgland Mar 14, 2022
8c963c2
fix more names not following the naming scheme
Skgland Mar 12, 2022
a57474d
fix unnecessary indirect return
Skgland Mar 12, 2022
ffef143
move popEffectiveZoom outside of the switch
Skgland Mar 12, 2022
06a96bd
fix another unnecessary indirect return
Skgland Mar 14, 2022
d2ca249
improve debuggability by setting development mode and eval-source-maps
Skgland Mar 15, 2022
bf19305
initial version of edge label hiding for node scaling
Skgland Mar 15, 2022
318f388
fix line ends sometimes overlapping scaled nde
Skgland Mar 15, 2022
bd27473
extract filtering of labels and reuse it in the case that only childr…
Skgland Mar 15, 2022
2ca3f77
fix names not following the naming scheme
Skgland Mar 20, 2022
2f0bcde
fix names not following the naming scheme
Skgland Mar 20, 2022
78770c7
fix spelling
Skgland Mar 20, 2022
b989402
rename forceNodeScaleBounds to calculateScaledBounds and add comments
Skgland Mar 20, 2022
4ee3a46
add comments to the polygon case of line scaling
Skgland Mar 20, 2022
102c705
simplify sorting function
Skgland Mar 21, 2022
a610893
don't draw a background if the original and scaled bounds are almost …
Skgland Mar 23, 2022
c797c78
fix the edge adjustment
Skgland Apr 7, 2022
001958a
fix minimal line width accidentally using the viewport zoom instead o…
Skgland Apr 19, 2022
4f29870
Merge remote-tracking branch 'upstream/main' into ben/node_scaling
Skgland May 5, 2022
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
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
"outFiles": ["${workspaceFolder}/applications/klighd-vscode/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Launch VS Code Extension (socket)",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}/applications/klighd-vscode"],
"env": {
"KEITH_LS_PORT": "5007"
},
"sourceMaps": true,
"smartStep": true,
"outFiles": ["${workspaceFolder}/applications/klighd-vscode/dist/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Start CLI Webserver",
"type": "node",
Expand Down
2 changes: 1 addition & 1 deletion applications/klighd-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"clean": "rm -rf lib dist bin",
"lint": "eslint .",
"build": "run-p --print-label \"build:*\"",
"build:app": "webpack --mode production --devtool hidden-source-map",
"build:app": "webpack --mode development --devtool eval-source-map",
"build:server": "tsc -p ./tsconfig.server.json",
"watch": "run-p --print-label \"watch:*\"",
"watch:app": "webpack --watch",
Expand Down
6 changes: 3 additions & 3 deletions packages/klighd-core/src/bookmarks/bookmark-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
*
* Copyright 2021 by
* + Kiel University
* + Department of Computer Science
Expand Down Expand Up @@ -172,8 +172,8 @@ export class BookmarkPanel extends SidebarPanel {
const save = document.getElementById(bookmark.saveId);
if (save && bookmark.bookmarkIndex !== undefined) {
save.classList.toggle("options__hidden", true)
const new_name = save.getElementsByTagName("input")[0].value ?? undefined;
this.actionDispatcher.dispatch(RenameBookmarkAction.create(bookmark.bookmarkIndex, new_name));
const newName = save.getElementsByTagName("input")[0].value ?? undefined;
this.actionDispatcher.dispatch(RenameBookmarkAction.create(bookmark.bookmarkIndex, newName));
}
}

Expand Down
20 changes: 10 additions & 10 deletions packages/klighd-core/src/bookmarks/bookmark-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
*
* Copyright 2021 by
* + Kiel University
* + Department of Computer Science
Expand All @@ -27,7 +27,7 @@ import { AddBookmarkAction, Bookmark, DeleteBookmarkAction, GoToBookmarkAction,
* A simple {@link Registry} that holds a list of all added Bookmarks
*
* Handles CreateBookmark and GoToBookmark actions
*
*
*/
@injectable()
export class BookmarkRegistry extends Registry {
Expand All @@ -50,11 +50,11 @@ export class BookmarkRegistry extends Registry {

} else if (DeleteBookmarkAction.isThisAction(action)) {

this.deleteBookmark(action.bookmark_index)
this.deleteBookmark(action.bookmarkIndex)

} else if (RenameBookmarkAction.isThisAction(action)) {

this.updateBookmarkName(action.bookmark_index, action.new_name)
this.updateBookmarkName(action.bookmarkIndex, action.newName)

} else if (AddBookmarkAction.isThisAction(action)) {

Expand All @@ -69,19 +69,19 @@ export class BookmarkRegistry extends Registry {
this.notifyListeners();
}

protected deleteBookmark(bookmark_index: number): void {
const index = this._bookmarks.findIndex((value) => value.bookmarkIndex === bookmark_index);
protected deleteBookmark(bookmarkIndex: number): void {
const index = this._bookmarks.findIndex((value) => value.bookmarkIndex === bookmarkIndex);
this._bookmarks.splice(index, 1)
this.notifyListeners();
}

protected updateBookmarkName(bookmark_index: number, new_name: string): void {
const bm = this._bookmarks.find((bm) => bm.bookmarkIndex === bookmark_index)
protected updateBookmarkName(bookmarkIndex: number, newName: string): void {
const bm = this._bookmarks.find((bm) => bm.bookmarkIndex === bookmarkIndex)
if (bm) {
if (new_name === "") {
if (newName === "") {
bm.name = undefined
} else {
bm.name = new_name
bm.name = newName
}
this.notifyListeners();
}
Expand Down
20 changes: 10 additions & 10 deletions packages/klighd-core/src/bookmarks/bookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
*
* Copyright 2021 by
* + Kiel University
* + Department of Computer Science
Expand Down Expand Up @@ -168,16 +168,16 @@ export namespace AddBookmarkAction {
*/
export interface DeleteBookmarkAction extends Action {
kind: typeof DeleteBookmarkAction.KIND
bookmark_index: number
bookmarkIndex: number
}

export namespace DeleteBookmarkAction {
export const KIND = 'delete-bookmark'

export function create(bookmark_index: number): DeleteBookmarkAction {
export function create(bookmarkIndex: number): DeleteBookmarkAction {
return {
kind: KIND,
bookmark_index,
bookmarkIndex,
}
}

Expand All @@ -189,18 +189,18 @@ export namespace DeleteBookmarkAction {

export interface RenameBookmarkAction extends Action {
kind: typeof RenameBookmarkAction.KIND
bookmark_index: number
new_name: string
bookmarkIndex: number
newName: string
}

export namespace RenameBookmarkAction {
export const KIND = 'rename-bookmark'

export function create(bookmark_index: number, new_name: string): RenameBookmarkAction {
export function create(bookmarkIndex: number, newName: string): RenameBookmarkAction {
return {
kind: KIND,
bookmark_index,
new_name,
bookmarkIndex,
newName,
}
}

Expand Down Expand Up @@ -280,4 +280,4 @@ export namespace SetInitialBookmarkAction {
export function isThisAction(action: Action): action is SetInitialBookmarkAction {
return action.kind === SetInitialBookmarkAction.KIND;
}
}
}
Loading