codecharta-visualization 1.88.0 → 1.89.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.
Files changed (124) hide show
  1. package/app/app.module.ts +20 -10
  2. package/app/codeCharta/codeCharta.component.html +0 -2
  3. package/app/codeCharta/codeCharta.model.ts +1 -0
  4. package/app/codeCharta/services/ajs-upgraded-providers.ts +13 -0
  5. package/app/codeCharta/state/angular-redux/effects/createEffect.spec.ts +37 -0
  6. package/app/codeCharta/state/angular-redux/effects/createEffect.ts +25 -0
  7. package/app/codeCharta/state/angular-redux/effects/effects.module.ts +36 -0
  8. package/app/codeCharta/state/angular-redux/ofType.ts +11 -0
  9. package/app/codeCharta/state/angular-redux/state.ts +12 -0
  10. package/app/codeCharta/state/angular-redux/store.ts +1 -1
  11. package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/addBlacklistItemsIfNotResultsInEmptyMap.effect.spec.ts +60 -0
  12. package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/addBlacklistItemsIfNotResultsInEmptyMap.effect.ts +56 -0
  13. package/app/codeCharta/state/effects/addBlacklistItemsIfNotResultsInEmptyMap/resultsInEmptyMap.ts +22 -0
  14. package/app/codeCharta/state/effects/nodeContextMenu/excludeButton/excludeButton.component.html +3 -0
  15. package/app/codeCharta/state/effects/nodeContextMenu/excludeButton/excludeButton.component.ts +26 -0
  16. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.html +13 -0
  17. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.spec.ts +55 -0
  18. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.component.ts +34 -0
  19. package/app/codeCharta/state/effects/nodeContextMenu/flattenButtons/flattenButtons.module.ts +11 -0
  20. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/focusButtons/focusButtons.component.html +0 -0
  21. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/focusButtons/focusButtons.component.spec.ts +2 -2
  22. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/focusButtons/focusButtons.component.ts +5 -5
  23. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/focusButtons/focusButtons.module.ts +1 -1
  24. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/focusButtons/isNodeFocused.pipe.spec.ts +0 -0
  25. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/focusButtons/isNodeFocused.pipe.ts +2 -2
  26. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.html +6 -0
  27. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.spec.ts +64 -0
  28. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.component.ts +39 -0
  29. package/app/codeCharta/state/effects/nodeContextMenu/highlightButtons/highlightButtons.module.ts +11 -0
  30. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/markFolderRow/markFolderRow.component.html +3 -3
  31. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/markFolderRow/markFolderRow.component.scss +0 -0
  32. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/markFolderRow/markFolderRow.component.spec.ts +2 -2
  33. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/markFolderRow/markFolderRow.component.ts +6 -6
  34. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/markFolderRow/markFolderRow.module.ts +1 -1
  35. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.spec.ts +0 -0
  36. package/app/codeCharta/state/effects/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.ts +29 -0
  37. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/nodeContextMenu.e2e.ts +4 -16
  38. package/app/codeCharta/{ui → state/effects}/nodeContextMenu/nodeContextMenu.po.ts +1 -1
  39. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenu.service.spec.ts +78 -0
  40. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenu.service.ts +72 -0
  41. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/lastPartOfNodePath.pipe.spec.ts +11 -0
  42. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/lastPartOfNodePath.pipe.ts +8 -0
  43. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.html +17 -0
  44. package/app/codeCharta/{ui/nodeContextMenu/nodeContextMenu.component.scss → state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.scss} +6 -11
  45. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.spec.ts +49 -0
  46. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.component.ts +19 -0
  47. package/app/codeCharta/state/effects/nodeContextMenu/nodeContextMenuCard/nodeContextMenuCard.module.ts +18 -0
  48. package/app/codeCharta/state/effects/nodeContextMenu/openNodeContextMenu.effect.spec.ts +32 -0
  49. package/app/codeCharta/state/effects/nodeContextMenu/openNodeContextMenu.effect.ts +33 -0
  50. package/app/codeCharta/state/effects/nodeContextMenu/rightClickedCodeMapNode.selector.ts +8 -0
  51. package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.spec.ts +47 -0
  52. package/app/codeCharta/state/effects/unfocusNodesOnLoadingMap.effect.ts +18 -0
  53. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/areAllNecessaryRenderDataAvailable.selector.ts +30 -0
  54. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areDynamicSettingsAvailable.spec.ts +36 -0
  55. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areDynamicSettingsAvailable.ts +10 -0
  56. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areMetricsAvailable.spec.ts +13 -0
  57. package/app/codeCharta/state/selectors/allNecessaryRenderDataAvailable/utils/areMetricsAvailable.ts +8 -0
  58. package/app/codeCharta/state/store/appSettings/appSettings.actions.ts +2 -0
  59. package/app/codeCharta/state/store/appSettings/appSettings.reducer.ts +2 -0
  60. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.actions.ts +32 -0
  61. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.spec.ts +26 -0
  62. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.reducer.ts +12 -0
  63. package/app/codeCharta/state/store/appSettings/invertArea/invertArea.selector.ts +3 -0
  64. package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.spec.ts +14 -3
  65. package/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts +41 -6
  66. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.actions.ts +33 -2
  67. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.reducer.spec.ts +17 -1
  68. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.reducer.ts +3 -1
  69. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.spec.ts +1 -19
  70. package/app/codeCharta/state/store/fileSettings/blacklist/blacklist.service.ts +5 -28
  71. package/app/codeCharta/state/store/lookUp/idToNode/idToNode.selector.ts +4 -0
  72. package/app/codeCharta/state/store/lookUp/lookUp.selector.ts +3 -0
  73. package/app/codeCharta/state/store/metricData/nodeMetricData/nodeMetricData.service.ts +0 -4
  74. package/app/codeCharta/state/store/store.ts +5 -1
  75. package/app/codeCharta/state/store.service.spec.ts +20 -7
  76. package/app/codeCharta/state/store.service.ts +3 -36
  77. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.html +3 -1
  78. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.scss +6 -2
  79. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.component.ts +1 -1
  80. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.module.ts +3 -0
  81. package/app/codeCharta/ui/areaSettingsPanel/areaSettingsPanel.po.ts +4 -4
  82. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.html +1 -0
  83. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.scss +26 -0
  84. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.spec.ts +29 -0
  85. package/app/codeCharta/ui/areaSettingsPanel/invertAreaOption/invertAreaOption.component.ts +24 -0
  86. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/aggregationType.pipe.spec.ts +19 -0
  87. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/{aggregationSymbol.pipe.ts → aggregationType.pipe.ts} +4 -4
  88. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.html +4 -12
  89. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.scss +11 -20
  90. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.component.spec.ts +8 -15
  91. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/attributeTypeSelector.module.ts +2 -2
  92. package/app/codeCharta/ui/codeMap/codeMap.preRender.service.spec.ts +1 -9
  93. package/app/codeCharta/ui/codeMap/codeMap.preRender.service.ts +9 -32
  94. package/app/codeCharta/ui/dialogs/dialogs.ts +3 -0
  95. package/app/codeCharta/ui/dialogs/errorDialog/errorDialog.component.html +7 -0
  96. package/app/codeCharta/ui/dialogs/errorDialog/errorDialog.component.ts +9 -0
  97. package/app/codeCharta/ui/mapTreeView/mapTreeView.level.e2e.ts +1 -1
  98. package/app/codeCharta/ui/mapTreeView/mapTreeView.level.po.ts +1 -1
  99. package/app/codeCharta/ui/ribbonBar/ribbonBar.component.html +2 -2
  100. package/app/codeCharta/ui/ribbonBar/ribbonBar.e2e.ts +3 -3
  101. package/app/codeCharta/ui/searchBar/searchBar.component.html +5 -0
  102. package/app/codeCharta/ui/searchBar/searchBar.component.scss +11 -0
  103. package/app/codeCharta/ui/searchBar/searchBar.component.spec.ts +10 -0
  104. package/app/codeCharta/ui/searchBar/searchBar.component.ts +1 -1
  105. package/app/codeCharta/ui/sortingOption/sortingOption.component.spec.ts +1 -1
  106. package/app/codeCharta/ui/ui.ts +0 -2
  107. package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.spec.ts +1 -1
  108. package/app/codeCharta/util/algorithm/treeMapLayout/treeMapGenerator.ts +14 -7
  109. package/app/codeCharta/util/customConfigBuilder.ts +1 -0
  110. package/app/codeCharta/util/dataMocks.ts +2 -0
  111. package/app/codeCharta/util/reduxHelper.ts +11 -0
  112. package/app/material/material.module.ts +17 -1
  113. package/conf/webpack.loaders.js +4 -1
  114. package/dist/webpack/bundle.js +4582 -950
  115. package/dist/webpack/bundle.js.map +1 -1
  116. package/package.json +2 -2
  117. package/app/codeCharta/ui/attributeSideBar/attributeTypeSelector/aggregationSymbol.pipe.spec.ts +0 -19
  118. package/app/codeCharta/ui/nodeContextMenu/markFolderRow/selectors/markFolderItems.selector.ts +0 -29
  119. package/app/codeCharta/ui/nodeContextMenu/markFolderRow/selectors/rightClickedNode.selector.spec.ts +0 -15
  120. package/app/codeCharta/ui/nodeContextMenu/markFolderRow/selectors/rightClickedNode.selector.ts +0 -9
  121. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.html +0 -45
  122. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.spec.ts +0 -365
  123. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.component.ts +0 -198
  124. package/app/codeCharta/ui/nodeContextMenu/nodeContextMenu.module.ts +0 -15
@@ -47,7 +47,7 @@ describe("RibbonBar", () => {
47
47
  })
48
48
 
49
49
  describe("opening and closing ribbon-bar cards", () => {
50
- it("searchPanel", async () => {
50
+ it("search-panel-card", async () => {
51
51
  let isSearchPanelOpen = await searchPanel.toggle()
52
52
  expect(isSearchPanelOpen).toBeTruthy()
53
53
 
@@ -55,7 +55,7 @@ describe("RibbonBar", () => {
55
55
  expect(isSearchPanelOpen).toBeFalsy()
56
56
  })
57
57
 
58
- it("height-metric cad", async () => {
58
+ it("height-metric card", async () => {
59
59
  const panel = "height-metric"
60
60
 
61
61
  let isHeightSettingsPanelOpen = await ribbonBar.togglePanel(panel)
@@ -85,7 +85,7 @@ describe("RibbonBar", () => {
85
85
  expect(isColorSettingsPanelOpen).toBeFalsy()
86
86
  })
87
87
 
88
- it("edge-metric", async () => {
88
+ it("edge-metric card", async () => {
89
89
  const panel = "edge-metric"
90
90
 
91
91
  let isEdgeSettingsPanelOpen = await ribbonBar.togglePanel(panel)
@@ -9,6 +9,11 @@
9
9
  ng-model="$ctrl._viewModel.searchPattern"
10
10
  ng-change="$ctrl.handleSearchPatternChange()"
11
11
  />
12
+ <span class="small-action-button transparent clear-icon" ng-if="!$ctrl.isSearchPatternEmpty()">
13
+ <md-button class="md-fab" ng-click="$ctrl.resetSearchPattern()">
14
+ <i class="fa fa-times"></i>
15
+ </md-button>
16
+ </span>
12
17
  </md-input-container>
13
18
 
14
19
  <md-menu>
@@ -21,6 +21,17 @@ search-bar-component {
21
21
  vertical-align: middle;
22
22
  display: inline-block;
23
23
  }
24
+
25
+ #searchInput {
26
+ padding-right: 24px;
27
+ }
28
+
29
+ .clear-icon {
30
+ position: absolute;
31
+ right: 0;
32
+ margin: 0;
33
+ margin-top: 2px;
34
+ }
24
35
  }
25
36
 
26
37
  .small-action-button {
@@ -213,4 +213,14 @@ describe("SearchBarController", () => {
213
213
  }, SearchBarController["DEBOUNCE_TIME"] + SOME_EXTRA_TIME)
214
214
  })
215
215
  })
216
+
217
+ describe("resetSearchPattern", () => {
218
+ it("should clear the SearchPattern", () => {
219
+ searchBarController["_viewModel"].searchPattern = "pattern"
220
+
221
+ searchBarController.resetSearchPattern()
222
+
223
+ expect(searchBarController.isSearchPatternEmpty()).toBeTruthy()
224
+ })
225
+ })
216
226
  })
@@ -132,7 +132,7 @@ export class SearchBarController implements BlacklistSubscriber, SearchPatternSu
132
132
  return path
133
133
  }
134
134
 
135
- private resetSearchPattern() {
135
+ resetSearchPattern() {
136
136
  this._viewModel.searchPattern = ""
137
137
  this.updateSearchPattern()
138
138
  }
@@ -17,7 +17,7 @@ describe("SortingOptionComponent", () => {
17
17
 
18
18
  it("should have an explaining title", async () => {
19
19
  await render(SortingOptionComponent)
20
- expect(screen.findByLabelText("Sort by")).toBeTruthy()
20
+ expect(await screen.findByTitle("Sort by")).toBeTruthy()
21
21
  })
22
22
 
23
23
  it("should be a select for the sorting option", async () => {
@@ -26,7 +26,6 @@ import "./heightSettingsPanel/heightSettingsPanel.module"
26
26
  import "./loadingGif/loadingGif.module"
27
27
  import "./metricChooser/metricChooser.module"
28
28
  import "./metricType/metricType.module"
29
- import "./nodeContextMenu/nodeContextMenu.module"
30
29
  import "./rangeSlider/rangeSlider.module"
31
30
  import "./resetSettingsButton/resetSettingsButton.module"
32
31
  import "./filePanel/filePanel.module"
@@ -74,7 +73,6 @@ angular
74
73
  "app.codeCharta.ui.loadingGif",
75
74
  "app.codeCharta.ui.metricChooser",
76
75
  "app.codeCharta.ui.metricType",
77
- "app.codeCharta.ui.nodeContextMenu",
78
76
  "app.codeCharta.ui.rangeSlider",
79
77
  "app.codeCharta.ui.resetSettingsButton",
80
78
  "app.codeCharta.ui.ribbonBar",
@@ -181,7 +181,7 @@ describe("treeMapGenerator", () => {
181
181
 
182
182
  describe("calculateAreaValue", () => {
183
183
  it("should return 0 if node has children, not blacklisted and not only visible in comparison map", () => {
184
- const actual = SquarifiedLayoutGenerator.calculateAreaValue(codeMapNode, state)
184
+ const actual = SquarifiedLayoutGenerator.calculateAreaValue(codeMapNode, state, 400)
185
185
 
186
186
  expect(actual).toBe(0)
187
187
  })
@@ -12,6 +12,7 @@ const DEFAULT_PADDING_FLOOR_LABEL_FROM_LEVEL_2 = 95
12
12
  export function createTreemapNodes(map: CodeMapNode, state: State, metricData: NodeMetricData[], isDeltaState: boolean): Node[] {
13
13
  const mapSizeResolutionScaling = getMapResolutionScaleFactor(state.files)
14
14
  const maxHeight = metricData.find(x => x.name === state.dynamicSettings.heightMetric).maxValue * mapSizeResolutionScaling
15
+ const maxWidth = metricData.find(x => x.name === state.dynamicSettings.areaMetric).maxValue * mapSizeResolutionScaling
15
16
  const heightScale = (state.treeMap.mapSize * 2) / maxHeight
16
17
 
17
18
  if (hasFixedFolders(map)) {
@@ -42,14 +43,14 @@ export function createTreemapNodes(map: CodeMapNode, state: State, metricData: N
42
43
  0,
43
44
  heightScale,
44
45
  maxHeight,
46
+ maxWidth,
45
47
  isDeltaState,
46
48
  mapSizeResolutionScaling
47
49
  )
48
50
  ]
49
51
  }
50
52
 
51
- const squarifiedTreeMap = getSquarifiedTreeMap(map, state, mapSizeResolutionScaling)
52
-
53
+ const squarifiedTreeMap = getSquarifiedTreeMap(map, state, mapSizeResolutionScaling, maxWidth)
53
54
  const nodes: Node[] = []
54
55
  for (const squarifiedNode of squarifiedTreeMap.treeMap) {
55
56
  nodes.push(TreeMapHelper.buildNodeFrom(squarifiedNode, heightScale, maxHeight, state, isDeltaState))
@@ -66,6 +67,7 @@ function buildSquarifiedTreeMapsForFixedFolders(
66
67
  offsetY0: number,
67
68
  heightScale: number,
68
69
  maxHeight: number,
70
+ maxWidth: number,
69
71
  isDeltaState: boolean,
70
72
  mapSizeResolutionScaling: number
71
73
  ) {
@@ -73,7 +75,7 @@ function buildSquarifiedTreeMapsForFixedFolders(
73
75
 
74
76
  for (const fixedFolder of hierarchyNode.children) {
75
77
  const fixedPosition = fixedFolder.data.fixedPosition
76
- const squarified = getSquarifiedTreeMap(fixedFolder.data, state, mapSizeResolutionScaling)
78
+ const squarified = getSquarifiedTreeMap(fixedFolder.data, state, mapSizeResolutionScaling, maxWidth)
77
79
 
78
80
  for (const squarifiedNode of squarified.treeMap.descendants()) {
79
81
  // squarified.width/height is a sum of the fixedPosition.width/height and applied margins
@@ -119,6 +121,7 @@ function buildSquarifiedTreeMapsForFixedFolders(
119
121
  squarifiedNode.y0,
120
122
  heightScale,
121
123
  maxHeight,
124
+ maxWidth,
122
125
  isDeltaState,
123
126
  mapSizeResolutionScaling
124
127
  )
@@ -150,7 +153,7 @@ function scaleRoot(root: Node, scaleLength: number, scaleWidth: number) {
150
153
  root.length *= scaleLength
151
154
  }
152
155
 
153
- function getSquarifiedTreeMap(map: CodeMapNode, state: State, mapSizeResolutionScaling: number): SquarifiedTreeMap {
156
+ function getSquarifiedTreeMap(map: CodeMapNode, state: State, mapSizeResolutionScaling: number, maxWidth: number): SquarifiedTreeMap {
154
157
  const hierarchyNode = hierarchy(map)
155
158
  const nodesPerSide = getEstimatedNodesPerSide(hierarchyNode)
156
159
  const padding = state.dynamicSettings.margin * PADDING_SCALING_FACTOR * mapSizeResolutionScaling
@@ -216,7 +219,11 @@ function getSquarifiedTreeMap(map: CodeMapNode, state: State, mapSizeResolutionS
216
219
  return padding
217
220
  })
218
221
 
219
- return { treeMap: treeMap(hierarchyNode.sum(node => calculateAreaValue(node, state) * mapSizeResolutionScaling)), height, width }
222
+ return {
223
+ treeMap: treeMap(hierarchyNode.sum(node => calculateAreaValue(node, state, maxWidth) * mapSizeResolutionScaling)),
224
+ height,
225
+ width
226
+ }
220
227
  }
221
228
 
222
229
  function getEstimatedNodesPerSide(hierarchyNode: HierarchyNode<CodeMapNode>) {
@@ -241,7 +248,7 @@ function isOnlyVisibleInComparisonMap(node: CodeMapNode, dynamicSettings: Dynami
241
248
  }
242
249
 
243
250
  // Only exported for testing.
244
- export function calculateAreaValue(node: CodeMapNode, { dynamicSettings }: State) {
251
+ export function calculateAreaValue(node: CodeMapNode, { dynamicSettings, appSettings }: State, maxWidth: number) {
245
252
  if (node.isExcluded) {
246
253
  return 0
247
254
  }
@@ -251,7 +258,7 @@ export function calculateAreaValue(node: CodeMapNode, { dynamicSettings }: State
251
258
  }
252
259
 
253
260
  if (isLeaf(node) && node.attributes?.[dynamicSettings.areaMetric]) {
254
- return node.attributes[dynamicSettings.areaMetric]
261
+ return appSettings.invertArea ? maxWidth - node.attributes[dynamicSettings.areaMetric] : node.attributes[dynamicSettings.areaMetric]
255
262
  }
256
263
  return 0
257
264
  }
@@ -57,6 +57,7 @@ function initializeAppSettings(target: CustomConfig) {
57
57
  edgeHeight: 0,
58
58
  hideFlatBuildings: false,
59
59
  invertHeight: false,
60
+ invertArea: false,
60
61
  isAttributeSideBarVisible: false,
61
62
  isLoadingFile: false,
62
63
  isLoadingMap: false,
@@ -1772,6 +1772,7 @@ export const STATE: State = {
1772
1772
  cameraTarget: new Vector3(177, 0, 299),
1773
1773
  hideFlatBuildings: true,
1774
1774
  invertHeight: true,
1775
+ invertArea: false,
1775
1776
  dynamicMargin: true,
1776
1777
  isWhiteBackground: false,
1777
1778
  mapColors: {
@@ -1838,6 +1839,7 @@ export const DEFAULT_STATE: State = {
1838
1839
  dynamicMargin: true,
1839
1840
  hideFlatBuildings: false,
1840
1841
  invertHeight: false,
1842
+ invertArea: false,
1841
1843
  isWhiteBackground: false,
1842
1844
  mapColors: {
1843
1845
  angularGreen: "#00BFA5",
@@ -1,5 +1,6 @@
1
1
  import { clone } from "./clone"
2
2
  import isEqual from "lodash.isequal"
3
+ import { Action } from "redux"
3
4
 
4
5
  export function removeItemFromArray<T>(array: T[], searchItem: T) {
5
6
  return array.filter(entry => !isEqual(entry, searchItem))
@@ -16,10 +17,20 @@ export function addItemToArray<T>(array: T[], item: T) {
16
17
  return array
17
18
  }
18
19
 
20
+ export function addItemsToArray<T>(array: T[], items: T[]) {
21
+ const newArray = [...array]
22
+ for (const item of items) if (!arrayContainsItem(newArray, item)) newArray.push(item)
23
+ return newArray
24
+ }
25
+
19
26
  export function isActionOfType(actionType: string, actions) {
20
27
  return actions[actionType] !== undefined
21
28
  }
22
29
 
30
+ export function isAction<T extends Action>(action: Action, type: string): action is T {
31
+ return action.type === type
32
+ }
33
+
23
34
  function arrayContainsItem<T>(array: T[], item: T) {
24
35
  return array.some(x => isEqual(x, item))
25
36
  }
@@ -6,8 +6,24 @@ import { MatButtonModule } from "@angular/material/button"
6
6
  import { MatDividerModule } from "@angular/material/divider"
7
7
  import { MatTooltipModule } from "@angular/material/tooltip"
8
8
  import { MatIconModule } from "@angular/material/icon"
9
+ import { MatButtonToggleModule } from "@angular/material/button-toggle"
10
+ import { MatDialogModule } from "@angular/material/dialog"
11
+ import { MatCardModule } from "@angular/material/card"
12
+ import { MatCheckboxModule } from "@angular/material/checkbox"
9
13
 
10
- const materialModules = [MatSelectModule, MatMenuModule, MatButtonModule, MatDividerModule, MatTooltipModule, MatIconModule]
14
+ const materialModules = [
15
+ MatSelectModule,
16
+ MatMenuModule,
17
+ MatButtonModule,
18
+ MatDividerModule,
19
+ MatTooltipModule,
20
+ MatIconModule,
21
+ MatDialogModule,
22
+ MatCardModule,
23
+ MatButtonToggleModule,
24
+ MatDialogModule,
25
+ MatCheckboxModule
26
+ ]
11
27
 
12
28
  @NgModule({
13
29
  imports: [BrowserAnimationsModule, materialModules],
@@ -9,7 +9,10 @@ module.exports = {
9
9
  },
10
10
  {
11
11
  test: /\.html$/,
12
- use: ["html-loader"]
12
+ loader: "html-loader",
13
+ options: {
14
+ esModule: false
15
+ }
13
16
  },
14
17
  {
15
18
  test: /\.css$/,