diff --git a/frontend/src/modules/Servicemap/utils.ts b/frontend/src/modules/Servicemap/utils.ts index a321f8bcec..6eab757cc6 100644 --- a/frontend/src/modules/Servicemap/utils.ts +++ b/frontend/src/modules/Servicemap/utils.ts @@ -2,11 +2,11 @@ import { uniqBy, uniq, maxBy, cloneDeep, find } from "lodash"; import { serviceMapStore } from "Src/store/actions"; import { graphDataType } from "./ServiceMap"; +const MAX_WIDTH = 8; +const MIN_WIDTH = 5; +const MAX_FONT_SIZE = 8; +const MIN_FONT_SIZE = 5; export const getDimensions = (num, highest) => { - const MAX_WIDTH = 8; - const MIN_WIDTH = 5; - const MAX_FONT_SIZE = 8; - const MIN_FONT_SIZE = 5; const percentage = (num / highest) * 100; const width = (percentage * (MAX_WIDTH - MIN_WIDTH)) / 100 + MIN_WIDTH; const fontSize = @@ -39,6 +39,19 @@ export const getGraphData = (serviceMap: serviceMapStore): graphDataType => { const nodes = uniqNodes.map((node, i) => { const service = find(services, (service) => service.serviceName === node); let color = "#84ff00"; + if (!service) { + return { + id: node, + group: i + 1, + fontSize: MIN_FONT_SIZE, + width: MIN_WIDTH, + color, + nodeVal: MIN_WIDTH, + callRate: 0, + errorRate: 0, + p99: 0, + }; + } if (service.errorRate > 0) { color = "#f00a0a"; } else if (service.fourXXRate > 0) {