Skip to content

Commit 6ff955a

Browse files
improve display of hypernode count
1 parent 1504c3d commit 6ff955a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/app-builder/src/components/Graph/GraphComponents.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { type FtmEntityPersonOption, type FtmEntityV2 } from '@app-builder/models/data-model';
22
import { SCORING_LEVELS_COLORS } from '@app-builder/models/scoring';
33
import { useDataModel } from '@app-builder/services/data/data-model';
4+
import { formatNumber } from '@app-builder/utils/format';
45
import {
56
BaseEdge,
67
EdgeLabelRenderer,
@@ -13,7 +14,7 @@ import {
1314
import { type ReactNode, useCallback, useState } from 'react';
1415
import { useTranslation } from 'react-i18next';
1516
import { match } from 'ts-pattern';
16-
import { Button, Checkbox, cn, Tag, Tooltip } from 'ui-design-system';
17+
import { Button, Checkbox, cn, Tag, Tooltip, useFormatLanguage } from 'ui-design-system';
1718
import { Icon, type IconName } from 'ui-icons';
1819
import { useGraphAnnotations } from './contexts/GraphAnnotationsContext';
1920
import { useSelectedObject } from './contexts/GraphFocusContext';
@@ -357,6 +358,7 @@ function HypernodeNode({ id, data }: NodeProps<HypernodeRfNode>) {
357358
const { t } = useTranslation(graphI18n);
358359
const highlighted = useIsNodeHighlighted(id);
359360
const isHovered = useIsNodeHovered(id);
361+
const locale = useFormatLanguage();
360362

361363
return (
362364
<div
@@ -374,7 +376,7 @@ function HypernodeNode({ id, data }: NodeProps<HypernodeRfNode>) {
374376
</div>
375377
<Tooltip.Default content={t('graph:node.too_many', { count: data.count })}>
376378
<div className="text-xs h-10 min-w-10 rounded-full grid place-items-center border border-grey-border p-xs leading-none">
377-
{data.count}
379+
{formatNumber(data.count, { language: locale, notation: 'compact' })}
378380
</div>
379381
</Tooltip.Default>
380382
</div>

0 commit comments

Comments
 (0)