codecharta-visualization 1.86.0 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +1 -1
- package/app/app.module.ts +6 -2
- package/app/codeCharta/codeCharta.model.ts +1 -1
- package/app/codeCharta/state/store/dynamicSettings/dynamicSettings.splitter.ts +2 -2
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/currentFocused.selector.ts +8 -0
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.actions.ts +27 -7
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.reducer.spec.ts +27 -11
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.reducer.ts +11 -5
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.selector.ts +4 -0
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.service.spec.ts +2 -2
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.service.ts +1 -1
- package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.actions.ts +9 -10
- package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.spec.ts +37 -7
- package/app/codeCharta/state/store/fileSettings/markedPackages/markedPackages.reducer.ts +7 -3
- package/app/codeCharta/state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent.spec.ts +39 -0
- package/app/codeCharta/state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent.ts +19 -0
- package/app/codeCharta/state/store/state.splitter.spec.ts +4 -4
- package/app/codeCharta/state/store.service.spec.ts +3 -3
- package/app/codeCharta/state/store.service.ts +5 -0
- package/app/codeCharta/ui/artificialIntelligence/__snapshots__/artificialIntelligence.component.spec.ts.snap +13 -16
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.html +4 -4
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.scss +0 -4
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.spec.ts +82 -52
- package/app/codeCharta/ui/artificialIntelligence/artificialIntelligence.component.ts +41 -101
- package/app/codeCharta/ui/codeMap/codeMap.actions.service.ts +1 -40
- package/app/codeCharta/ui/codeMap/codeMap.mouseEvent.service.ts +10 -16
- package/app/codeCharta/ui/colorPicker/colorPicker.component.html +16 -7
- package/app/codeCharta/ui/colorPicker/colorPicker.component.spec.ts +55 -16
- package/app/codeCharta/ui/colorPicker/colorPicker.component.ts +32 -1
- package/app/codeCharta/ui/colorPicker/colorPicker.module.ts +3 -1
- package/app/codeCharta/ui/customConfigs/customConfigs.component.html +21 -3
- package/app/codeCharta/ui/customConfigs/customConfigs.component.scss +1 -0
- package/app/codeCharta/ui/customConfigs/customConfigs.component.spec.ts +123 -2
- package/app/codeCharta/ui/customConfigs/customConfigs.component.ts +56 -2
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.html +21 -13
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.spec.ts +11 -24
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.component.ts +1 -40
- package/app/codeCharta/ui/labelledColorPicker/labelledColorPicker.module.ts +1 -2
- package/app/codeCharta/ui/legendPanel/legendMarkedPackages/legendMarkedPackages.component.ts +2 -2
- package/app/codeCharta/ui/nodeContextMenu/focusButtons/focusButtons.component.html +24 -0
- package/app/codeCharta/ui/nodeContextMenu/focusButtons/focusButtons.component.spec.ts +55 -0
- package/app/codeCharta/ui/nodeContextMenu/focusButtons/focusButtons.component.ts +38 -0
- package/app/codeCharta/ui/nodeContextMenu/focusButtons/focusButtons.module.ts +13 -0
- package/app/codeCharta/ui/nodeContextMenu/focusButtons/isNodeFocused.pipe.spec.ts +31 -0
- package/app/codeCharta/ui/nodeContextMenu/focusButtons/isNodeFocused.pipe.ts +25 -0
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.html +8 -4
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.component.ts +1 -21
- package/app/codeCharta/ui/nodeContextMenu/markFolderColorPicker/markFolderColorPicker.module.ts +1 -2
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.html +2 -12
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.scss +3 -1
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.spec.ts +28 -125
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.ts +29 -55
- package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.module.ts +2 -0
- package/app/codeCharta/ui/ui.ts +0 -2
- package/app/codeCharta/util/algorithm/streetLayout/strip/strip.ts +2 -2
- package/app/codeCharta/util/algorithm/streetLayout/treeMap.ts +1 -1
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.spec.ts +1 -1
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapHelper.spec.ts +2 -2
- package/app/codeCharta/util/algorithm/treeMapLayout/treeMapHelper.ts +1 -1
- package/app/codeCharta/util/customConfigBuilder.ts +1 -1
- package/app/codeCharta/util/dataMocks.ts +2 -2
- package/app/codeCharta/util/fileExtensionCalculator.ts +1 -1
- package/dist/webpack/bundle.js +963 -934
- package/dist/webpack/bundle.js.map +1 -1
- package/package.json +6 -5
- package/app/codeCharta/state/store/dynamicSettings/focusedNodePath/focusedNodePath.splitter.ts +0 -8
- package/app/codeCharta/ui/codeMap/codeMap.actions.service.spec.ts +0 -147
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.html +0 -15
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.scss +0 -5
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.spec.ts +0 -106
- package/app/codeCharta/ui/unfocusButton/unfocusButton.component.ts +0 -62
- package/app/codeCharta/ui/unfocusButton/unfocusButton.module.ts +0 -7
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import "./nodeContextMenu.component.scss"
|
|
2
2
|
import angular, { IRootScopeService } from "angular"
|
|
3
|
-
import { CodeMapActionsService } from "../codeMap/codeMap.actions.service"
|
|
4
3
|
import { BlacklistItem, BlacklistType, CodeMapNode, MapColors, NodeType } from "../../codeCharta.model"
|
|
5
4
|
import { CodeMapPreRenderService } from "../codeMap/codeMap.preRender.service"
|
|
6
5
|
import { StoreService } from "../../state/store.service"
|
|
7
6
|
import { addBlacklistItem, removeBlacklistItem } from "../../state/store/fileSettings/blacklist/blacklist.actions"
|
|
8
|
-
import { focusNode } from "../../state/store/dynamicSettings/focusedNodePath/focusedNodePath.actions"
|
|
9
7
|
import { CodeMapBuilding } from "../codeMap/rendering/codeMapBuilding"
|
|
10
|
-
import { BuildingRightClickedEventSubscriber, CodeMapMouseEventService } from "../codeMap/codeMap.mouseEvent.service"
|
|
11
8
|
import { MapColorsService, MapColorsSubscriber } from "../../state/store/appSettings/mapColors/mapColors.service"
|
|
12
9
|
import { getCodeMapNodeFromPath } from "../../util/codeMapHelper"
|
|
13
10
|
import { ThreeSceneService } from "../codeMap/threeViewer/threeSceneService"
|
|
14
11
|
import { DialogService } from "../dialog/dialog.service"
|
|
15
12
|
import { BlacklistService } from "../../state/store/fileSettings/blacklist/blacklist.service"
|
|
16
13
|
import { ERROR_MESSAGES } from "../../util/fileValidator"
|
|
14
|
+
import type { BUILDING_RIGHT_CLICKED_EVENT_TYPE } from "../../../../src/globals"
|
|
15
|
+
import { findIndexOfMarkedPackageOrParent } from "../../state/store/fileSettings/markedPackages/util/findIndexOfMarkedPackageOrParent"
|
|
16
|
+
import { markPackages, unmarkPackage } from "../../state/store/fileSettings/markedPackages/markedPackages.actions"
|
|
17
17
|
|
|
18
18
|
export enum ClickType {
|
|
19
19
|
RightClick = 2
|
|
@@ -27,9 +27,7 @@ export interface HideNodeContextMenuSubscriber {
|
|
|
27
27
|
onHideNodeContextMenu()
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export class NodeContextMenuController
|
|
31
|
-
implements BuildingRightClickedEventSubscriber, ShowNodeContextMenuSubscriber, HideNodeContextMenuSubscriber, MapColorsSubscriber
|
|
32
|
-
{
|
|
30
|
+
export class NodeContextMenuController implements ShowNodeContextMenuSubscriber, HideNodeContextMenuSubscriber, MapColorsSubscriber {
|
|
33
31
|
private static SHOW_NODE_CONTEXT_MENU_EVENT = "show-node-context-menu"
|
|
34
32
|
private static HIDE_NODE_CONTEXT_MENU_EVENT = "hide-node-context-menu"
|
|
35
33
|
private static instance: NodeContextMenuController
|
|
@@ -40,16 +38,12 @@ export class NodeContextMenuController
|
|
|
40
38
|
markingColors: string[]
|
|
41
39
|
nodePath: string
|
|
42
40
|
lastPartOfNodePath: string
|
|
43
|
-
isNodeFocused: boolean
|
|
44
|
-
isParentFocused: boolean
|
|
45
41
|
} = {
|
|
46
42
|
codeMapNode: null,
|
|
47
43
|
showNodeContextMenu: false,
|
|
48
44
|
markingColors: null,
|
|
49
45
|
nodePath: "",
|
|
50
|
-
lastPartOfNodePath: ""
|
|
51
|
-
isNodeFocused: false,
|
|
52
|
-
isParentFocused: false
|
|
46
|
+
lastPartOfNodePath: ""
|
|
53
47
|
}
|
|
54
48
|
|
|
55
49
|
constructor(
|
|
@@ -57,7 +51,6 @@ export class NodeContextMenuController
|
|
|
57
51
|
private $window,
|
|
58
52
|
public $rootScope: IRootScopeService,
|
|
59
53
|
private storeService: StoreService,
|
|
60
|
-
private codeMapActionsService: CodeMapActionsService,
|
|
61
54
|
private codeMapPreRenderService: CodeMapPreRenderService,
|
|
62
55
|
private threeSceneService: ThreeSceneService,
|
|
63
56
|
private dialogService: DialogService,
|
|
@@ -66,7 +59,7 @@ export class NodeContextMenuController
|
|
|
66
59
|
"ngInject"
|
|
67
60
|
NodeContextMenuController.instance = this
|
|
68
61
|
MapColorsService.subscribe(this.$rootScope, this)
|
|
69
|
-
|
|
62
|
+
document.addEventListener("building-right-clicked", this.onBuildingRightClicked)
|
|
70
63
|
NodeContextMenuController.subscribeToShowNodeContextMenu(this.$rootScope, this)
|
|
71
64
|
NodeContextMenuController.subscribeToHideNodeContextMenu(this.$rootScope, this)
|
|
72
65
|
}
|
|
@@ -75,7 +68,7 @@ export class NodeContextMenuController
|
|
|
75
68
|
this._viewModel.markingColors = mapColors.markingColors
|
|
76
69
|
}
|
|
77
70
|
|
|
78
|
-
onBuildingRightClicked(
|
|
71
|
+
onBuildingRightClicked = ({ detail: { building, x, y } }: CustomEvent<BUILDING_RIGHT_CLICKED_EVENT_TYPE>) => {
|
|
79
72
|
const nodeType = building.node.isLeaf ? NodeType.FILE : NodeType.FOLDER
|
|
80
73
|
this.onShowNodeContextMenu(building.node.path, nodeType, x, y)
|
|
81
74
|
}
|
|
@@ -85,18 +78,13 @@ export class NodeContextMenuController
|
|
|
85
78
|
this._viewModel.nodePath = path
|
|
86
79
|
this._viewModel.lastPartOfNodePath = `${path.lastIndexOf("/") === 0 ? "" : "..."}${path.slice(path.lastIndexOf("/"))}`
|
|
87
80
|
|
|
88
|
-
const focusedNodePath = this.storeService.getState().dynamicSettings.focusedNodePath
|
|
89
|
-
this._viewModel.isNodeFocused = path === focusedNodePath
|
|
90
|
-
this._viewModel.isParentFocused = path.startsWith(focusedNodePath) && path !== focusedNodePath
|
|
91
|
-
|
|
92
81
|
this._viewModel.showNodeContextMenu = true
|
|
93
82
|
|
|
94
83
|
const { x, y } = this.calculatePosition(mouseX, mouseY)
|
|
95
84
|
this.setPosition(x, y)
|
|
96
85
|
|
|
97
86
|
// Add event listeners, so that opened node context menu can be closed again later
|
|
98
|
-
// when clicking (left or right button)
|
|
99
|
-
// or using the mouse wheel on the body element.
|
|
87
|
+
// when clicking (left or right button) or using the mouse wheel on the body element.
|
|
100
88
|
document.body.addEventListener("click", this.onBodyLeftClickHideNodeContextMenu, true)
|
|
101
89
|
document.body.addEventListener("mousedown", this.onBodyRightClickHideNodeContextMenu, true)
|
|
102
90
|
document.getElementById("codeMap").addEventListener("wheel", this.onMapWheelHideNodeContextMenu, true)
|
|
@@ -106,12 +94,7 @@ export class NodeContextMenuController
|
|
|
106
94
|
if (this.isEventFromColorPicker(mouseEvent)) return
|
|
107
95
|
|
|
108
96
|
// Just close node context menu, if you click anywhere on the map.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// The listener is added when showing the node context menu.
|
|
112
|
-
// Thus, remove the listener when clicking the body element with the left or right button
|
|
113
|
-
// to fire hide events only (once) when it is really necessary.
|
|
114
|
-
document.body.removeEventListener("click", this.onBodyLeftClickHideNodeContextMenu, true)
|
|
97
|
+
this.hideContextMenu()
|
|
115
98
|
}
|
|
116
99
|
|
|
117
100
|
onBodyRightClickHideNodeContextMenu = event => {
|
|
@@ -119,31 +102,26 @@ export class NodeContextMenuController
|
|
|
119
102
|
// Otherwise, if mouseup would be used and you would move the map with keeping the right button pressed,
|
|
120
103
|
// the menu would not be closed.
|
|
121
104
|
if (event.button === ClickType.RightClick) {
|
|
122
|
-
|
|
105
|
+
this.hideContextMenu()
|
|
123
106
|
}
|
|
124
|
-
|
|
125
|
-
// The listener is added when showing the node context menu.
|
|
126
|
-
// Thus, remove the listener when clicking the body element with the left or right button
|
|
127
|
-
// to fire hide events only (once) when it is really necessary.
|
|
128
|
-
document.body.removeEventListener("mousedown", this.onBodyRightClickHideNodeContextMenu, true)
|
|
129
107
|
}
|
|
130
108
|
|
|
131
109
|
onMapWheelHideNodeContextMenu = () => {
|
|
132
110
|
// If you zoom in and out the map, the node context menu should be closed.
|
|
133
|
-
|
|
111
|
+
this.hideContextMenu()
|
|
112
|
+
}
|
|
134
113
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// to fire hide events only (once) when it is really necessary.
|
|
138
|
-
document.getElementById("codeMap").removeEventListener("wheel", this.onMapWheelHideNodeContextMenu, true)
|
|
114
|
+
hideContextMenu = () => {
|
|
115
|
+
NodeContextMenuController.broadcastHideEvent(this.$rootScope)
|
|
139
116
|
}
|
|
140
117
|
|
|
141
118
|
onHideNodeContextMenu() {
|
|
142
119
|
this._viewModel.showNodeContextMenu = false
|
|
143
|
-
}
|
|
144
120
|
|
|
145
|
-
|
|
146
|
-
|
|
121
|
+
// remove event listeners registered in onShowNodeContextMenu
|
|
122
|
+
document.body.removeEventListener("click", this.onBodyLeftClickHideNodeContextMenu, true)
|
|
123
|
+
document.body.removeEventListener("mousedown", this.onBodyRightClickHideNodeContextMenu, true)
|
|
124
|
+
document.getElementById("codeMap").removeEventListener("wheel", this.onMapWheelHideNodeContextMenu, true)
|
|
147
125
|
}
|
|
148
126
|
|
|
149
127
|
flattenNode() {
|
|
@@ -200,11 +178,18 @@ export class NodeContextMenuController
|
|
|
200
178
|
}
|
|
201
179
|
|
|
202
180
|
markFolder = (color: string) => {
|
|
203
|
-
this.
|
|
181
|
+
this.storeService.dispatch(
|
|
182
|
+
markPackages([
|
|
183
|
+
{
|
|
184
|
+
path: this._viewModel.codeMapNode.path,
|
|
185
|
+
color
|
|
186
|
+
}
|
|
187
|
+
])
|
|
188
|
+
)
|
|
204
189
|
}
|
|
205
190
|
|
|
206
191
|
unmarkFolder() {
|
|
207
|
-
this.
|
|
192
|
+
this.storeService.dispatch(unmarkPackage(this._viewModel.codeMapNode))
|
|
208
193
|
}
|
|
209
194
|
|
|
210
195
|
calculatePosition(mouseX: number, mouseY: number) {
|
|
@@ -248,7 +233,8 @@ export class NodeContextMenuController
|
|
|
248
233
|
}
|
|
249
234
|
|
|
250
235
|
private packageMatchesColorOfParentMP(color: string) {
|
|
251
|
-
const
|
|
236
|
+
const { markedPackages } = this.storeService.getState().fileSettings
|
|
237
|
+
const index = findIndexOfMarkedPackageOrParent(markedPackages, this._viewModel.codeMapNode.path)
|
|
252
238
|
if (index === -1) {
|
|
253
239
|
return false
|
|
254
240
|
}
|
|
@@ -266,18 +252,6 @@ export class NodeContextMenuController
|
|
|
266
252
|
return false
|
|
267
253
|
}
|
|
268
254
|
|
|
269
|
-
isNodeOrParentFocused() {
|
|
270
|
-
const { focusedNodePath } = this.storeService.getState().dynamicSettings
|
|
271
|
-
return Boolean(focusedNodePath && this._viewModel.codeMapNode?.path.startsWith(focusedNodePath))
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
isNodeFocused() {
|
|
275
|
-
if (this._viewModel.codeMapNode) {
|
|
276
|
-
return this._viewModel.codeMapNode.path === this.storeService.getState().dynamicSettings.focusedNodePath
|
|
277
|
-
}
|
|
278
|
-
return false
|
|
279
|
-
}
|
|
280
|
-
|
|
281
255
|
nodeIsFolder() {
|
|
282
256
|
return this._viewModel.codeMapNode?.children?.length > 0
|
|
283
257
|
}
|
|
@@ -6,8 +6,10 @@ import { downgradeComponent } from "@angular/upgrade/static"
|
|
|
6
6
|
|
|
7
7
|
import { nodeContextMenuComponent } from "./nodeContextMenu.component"
|
|
8
8
|
import { MarkFolderColorPickerComponent } from "./markFolderColorPicker/markFolderColorPicker.component"
|
|
9
|
+
import { FocusButtonsComponent } from "./focusButtons/focusButtons.component"
|
|
9
10
|
|
|
10
11
|
angular
|
|
11
12
|
.module("app.codeCharta.ui.nodeContextMenu", ["app.codeCharta.state", "app.codeCharta.ui"])
|
|
12
13
|
.component(nodeContextMenuComponent.selector, nodeContextMenuComponent)
|
|
13
14
|
.directive("ccMarkFolderColorPicker", downgradeComponent({ component: MarkFolderColorPickerComponent }))
|
|
15
|
+
.directive("ccFocusButtons", downgradeComponent({ component: FocusButtonsComponent }))
|
package/app/codeCharta/ui/ui.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { downgradeComponent } from "@angular/upgrade/static"
|
|
|
3
3
|
|
|
4
4
|
import "./artificialIntelligence/artificialIntelligence.module"
|
|
5
5
|
import "./customConfigs/customConfigs.module"
|
|
6
|
-
import "./unfocusButton/unfocusButton.module"
|
|
7
6
|
import "./metricValueHovered/metricValueHovered.module"
|
|
8
7
|
import "./downloadButton/downloadButton.module"
|
|
9
8
|
import "./screenshotButton/screenshotButton.module"
|
|
@@ -51,7 +50,6 @@ angular
|
|
|
51
50
|
.module("app.codeCharta.ui", [
|
|
52
51
|
"app.codeCharta.ui.artificialIntelligence",
|
|
53
52
|
"app.codeCharta.ui.customConfigs",
|
|
54
|
-
"app.codeCharta.ui.unfocusButton",
|
|
55
53
|
"app.codeCharta.ui.metricValueHovered",
|
|
56
54
|
"app.codeCharta.ui.downloadButton",
|
|
57
55
|
"app.codeCharta.ui.screenshotButton",
|
|
@@ -10,7 +10,7 @@ export default abstract class Strip {
|
|
|
10
10
|
this.nodes = nodes
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
abstract layout(
|
|
14
14
|
rect: Rectangle,
|
|
15
15
|
rootSize: number,
|
|
16
16
|
metricName: string,
|
|
@@ -19,7 +19,7 @@ export default abstract class Strip {
|
|
|
19
19
|
order?: number
|
|
20
20
|
): CodeMapNode[]
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
protected abstract worstAspectRatio(nodes: CodeMapNode[], rect: Rectangle, rootSize: number, metricName: string): number
|
|
23
23
|
|
|
24
24
|
totalScaledSize(nodes: CodeMapNode[], metricName: string, rootSize: number, rootArea: number): number {
|
|
25
25
|
return nodes.reduce((total, n) => total + this.scaledSize(n, rootSize, rootArea, metricName), 0)
|
|
@@ -11,7 +11,7 @@ export default abstract class Treemap extends BoundingBox {
|
|
|
11
11
|
super(rootNode)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
abstract layout(margin: number, origin: Vector2): CodeMapNode[]
|
|
15
15
|
|
|
16
16
|
calculateDimension(metricName: string): void {
|
|
17
17
|
this.metricName = metricName
|
|
@@ -34,7 +34,7 @@ describe("treeMapGenerator", () => {
|
|
|
34
34
|
codeMapNode = klona(VALID_NODE_WITH_PATH)
|
|
35
35
|
metricData = klona(METRIC_DATA)
|
|
36
36
|
isDeltaState = false
|
|
37
|
-
state.dynamicSettings.focusedNodePath =
|
|
37
|
+
state.dynamicSettings.focusedNodePath = []
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
describe("create Treemap nodes", () => {
|
|
@@ -48,7 +48,7 @@ describe("TreeMapHelper", () => {
|
|
|
48
48
|
state.dynamicSettings.margin = 15
|
|
49
49
|
state.dynamicSettings.heightMetric = "theHeight"
|
|
50
50
|
state.appSettings.invertHeight = false
|
|
51
|
-
state.dynamicSettings.focusedNodePath =
|
|
51
|
+
state.dynamicSettings.focusedNodePath = []
|
|
52
52
|
})
|
|
53
53
|
|
|
54
54
|
function buildNode() {
|
|
@@ -117,7 +117,7 @@ describe("TreeMapHelper", () => {
|
|
|
117
117
|
})
|
|
118
118
|
|
|
119
119
|
it("should be visible if it's a children of the focused node path", () => {
|
|
120
|
-
state.dynamicSettings.focusedNodePath = "/root"
|
|
120
|
+
state.dynamicSettings.focusedNodePath = ["/root"]
|
|
121
121
|
expect(buildNode().visible).toBeTruthy()
|
|
122
122
|
})
|
|
123
123
|
|
|
@@ -144,7 +144,7 @@ export function isVisible(squaredNode: CodeMapNode, isNodeLeaf: boolean, state:
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
if (state.dynamicSettings.focusedNodePath.length > 0) {
|
|
147
|
-
return squaredNode.path.startsWith(state.dynamicSettings.focusedNodePath)
|
|
147
|
+
return squaredNode.path.startsWith(state.dynamicSettings.focusedNodePath[0])
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
return true
|
|
@@ -1745,7 +1745,7 @@ export const STATE: State = {
|
|
|
1745
1745
|
colorMetric: "mcc",
|
|
1746
1746
|
distributionMetric: "mcc",
|
|
1747
1747
|
edgeMetric: "pairingRate",
|
|
1748
|
-
focusedNodePath: "/root/ParentLeaf",
|
|
1748
|
+
focusedNodePath: ["/root/ParentLeaf"],
|
|
1749
1749
|
searchPattern: "",
|
|
1750
1750
|
margin: 48,
|
|
1751
1751
|
colorRange: {
|
|
@@ -1876,7 +1876,7 @@ export const DEFAULT_STATE: State = {
|
|
|
1876
1876
|
dynamicSettings: {
|
|
1877
1877
|
areaMetric: null,
|
|
1878
1878
|
colorMetric: null,
|
|
1879
|
-
focusedNodePath:
|
|
1879
|
+
focusedNodePath: [],
|
|
1880
1880
|
heightMetric: null,
|
|
1881
1881
|
distributionMetric: null,
|
|
1882
1882
|
edgeMetric: null,
|
|
@@ -97,7 +97,7 @@ export class FileExtensionCalculator {
|
|
|
97
97
|
static hashCode(fileExtension: string) {
|
|
98
98
|
let hash = 0
|
|
99
99
|
for (let index = 0; index < fileExtension.length; index++) {
|
|
100
|
-
hash = fileExtension.
|
|
100
|
+
hash = fileExtension.codePointAt(index) + ((hash << 5) - hash)
|
|
101
101
|
}
|
|
102
102
|
return hash
|
|
103
103
|
}
|