-
Notifications
You must be signed in to change notification settings - Fork 31
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
Bug/1095/number of edges not visible #1111
Conversation
…mber-of-edges-not-visible # Conflicts: # visualization/app/codeCharta/state/metric.service.ts # visualization/app/codeCharta/ui/edgeChooser/edgeChooser.component.spec.ts # visualization/app/codeCharta/ui/edgeSettingsPanel/edgeSettingsPanel.component.spec.ts # visualization/app/codeCharta/ui/mapTreeView/mapTreeView.level.component.spec.ts # visualization/app/codeCharta/util/dataMocks.ts # visualization/app/codeCharta/util/fileDownloader.ts # visualization/app/codeCharta/util/scenarioHelper.ts # visualization/package-lock.json
…mber-of-edges-not-visible # Conflicts: # CHANGELOG.md # visualization/app/codeCharta/ui/edgeChooser/edgeChooser.component.html
…mber-of-edges-not-visible # Conflicts: # visualization/app/codeCharta/ui/mapTreeView/mapTreeView.level.po.ts
visualization/app/codeCharta/state/store/metricData/edgeMetricData/edgeMetricData.reducer.ts
Show resolved
Hide resolved
Needs a rebase |
…mber-of-edges-not-visible # Conflicts: # visualization/app/codeCharta/ui/edgeChooser/edgeChooser.e2e.ts
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
…Data/edgeMetricData.reducer.ts Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
…Data/nodeMetricData.reducer.ts Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
…Data/nodeMetricData.service.ts Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for following up on the comments! This is shaping nicely!
return this.storeService.getState().metricData.nodeMetricData.some(x => x.name == metricName) | ||
} | ||
|
||
public getMaxMetricByMetricName(metricName: string): number { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public getMaxMetricByMetricName(metricName: string): number { | |
public getMaxMetricByMetricName(metricName: string): number | undefined { |
I could imagine that metric is always truthy due to just accepting known metricNames (I suggest to use an enum to guarantee that metricName is always known).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we only call this method on metrics we know exist.
How can we build an enum dynamically containing only the metrics that are relevant to the visible files though?
visualization/app/codeCharta/state/store/metricData/edgeMetricData/edgeMetricData.reducer.ts
Show resolved
Hide resolved
visualization/app/codeCharta/state/store/metricData/nodeMetricData/nodeMetricData.reducer.ts
Outdated
Show resolved
Hide resolved
@BridgeAR Great suggestions. I decided that we should sort the edge-metrics the same way, we sort the node-metrics (by name). This way, I was able to resolve the duplicate of the sort-function. |
@NearW do you have a before and after screenshot for the change? :-) |
Edge-Metrics will be sorted the same way, we sort the node-metrics: By name. Before they were sorted by the max-value of incoming and outgoing edges. Sorting them by max-value isn't a bad idea, but we should handle both metrics the same way in my opinion. I also pushed another huge performance improvement for huge maps. |
Fix number of edges not visible when hovering
closes #1095
Description
The bug existed, because we already started rendering when the metricData was set and didn't await the edgeMetricData. I decided that instead of adding a simple if-condition to ensure that, we should rework some stuff and finally add the metrics to the redux store. This was a huge task. Some changes are trivial, but especially the nodeMetricService/Reducer and edgeMetricService/Reducer are not.
NodeMetricData
andEdgeMetricData
and used the previousMetricData
for the parent-reducermetric-data-complete
that is triggered, when both node and edge metric data is calculatedjest.resetAllMocks()
since they're not doing anything anywayIn order to review this, check out the two new services I created and check every file that just required small changes (such as fixing the import and injecting the new service). I can help you with the rest then. :)
ToDoDefinition of Done
A task/pull request will not be considered to be complete until all these items can be checked off.
master