Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 83x 1x 1x 1x 1x 1x 1x | import { HierarchyNode } from "d3-hierarchy"
import { CodeMapNode } from "../../../../codeCharta.model"
import { EdgeMetricCountMap, NodeEdgeMetricsMap } from "../metricData/edgeMetricData.calculator"
 
export const getMetricValuesForNode = (nodeEdgeMetricsMap: NodeEdgeMetricsMap, node: HierarchyNode<CodeMapNode>, metricNames: string[]) => {
    const nodeEdgeMetrics: EdgeMetricCountMap = new Map()
 
    for (const metricName of metricNames) {
        const edgeMetricCount = nodeEdgeMetricsMap.get(metricName)
        if (edgeMetricCount) {
            nodeEdgeMetrics.set(metricName, edgeMetricCount.get(node.data.path))
        }
    }
 
    return nodeEdgeMetrics
}
  |