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 | 14x 14x 14x 14x 7x 7x 4x 3x | import { defaultAmountOfTopLabels } from "../../store/appSettings/amountOfTopLabels/amountOfTopLabels.reducer" const BUILDINGS_PER_LABEL = 100 const MAX_NUMBER_OF_LABELS = 10 export const getNumberOfTopLabels = (codeMapNodes: { length: number }) => { const numberOfLabels = Math.floor(codeMapNodes.length / BUILDINGS_PER_LABEL) if (numberOfLabels <= defaultAmountOfTopLabels) { return defaultAmountOfTopLabels } return Math.min(numberOfLabels, MAX_NUMBER_OF_LABELS) } |