Skip to content

Commit

Permalink
Merge pull request #576 from Ferlab-Ste-Justine/feat/SJIP-1116-number
Browse files Browse the repository at this point in the history
fix(venn): SJIP-1116 format entity count
  • Loading branch information
lflangis authored Feb 25, 2025
2 parents e5a4fb4 + de625f4 commit bc0125e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions packages/ui/Release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 10.16.6 2025-02-26
- fix: SJIP-1116 format entity count

### 10.16.5 2025-02-25
- fix: SJIP-1116 add analytics, fix typo and styles

Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ferlab/ui",
"version": "10.16.5",
"version": "10.16.6",
"description": "Core components for scientific research data portals",
"publishConfig": {
"access": "public"
Expand Down
23 changes: 12 additions & 11 deletions packages/ui/src/components/Charts/Venn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as d3 from 'd3';
import { v4 } from 'uuid';

import { ISyntheticSqon } from '../../../data/sqon/types';
import { numberFormat } from '../../../utils/numberUtils';
import { IUserSetOutput } from '../../BiospecimenRequest/requestBiospecimen.utils';
import ExternalLinkIcon from '../../ExternalLink/ExternalLinkIcon';

Expand Down Expand Up @@ -188,8 +189,8 @@ const getSummaryColumns = (mode: Index, dictionary: TVennChartDictionary): Colum
},
{
align: 'right',
dataIndex: 'entityCount',
key: 'entityCount',
render: (record) => numberFormat(record.entityCount),
title: getIcon(mode),
width: 100,
},
Expand All @@ -212,8 +213,8 @@ const getOperationColumns = ({
},
{
align: 'right',
dataIndex: 'entityCount',
key: 'entityCount',
render: (record) => numberFormat(record.entityCount),
title: getIcon(mode),
width: 100,
},
Expand Down Expand Up @@ -326,7 +327,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[0].entityCount) }),
)
.text(operations[0].entityCount);
.text(numberFormat(operations[0].entityCount));

/**
* Circle2 'Q₂' is placed at the top left
Expand Down Expand Up @@ -373,7 +374,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[1].entityCount) }),
)
.text(operations[1].entityCount);
.text(numberFormat(operations[1].entityCount));

/**
* Intersection 'Q₁∩Q₂' between Circle1 and Circle2
Expand Down Expand Up @@ -411,7 +412,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[2].entityCount) }),
)
.text(operations[2].entityCount);
.text(numberFormat(operations[2].entityCount));
}

/**
Expand Down Expand Up @@ -483,7 +484,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[2].entityCount) }),
)
.text(operations[2].entityCount);
.text(numberFormat(operations[2].entityCount));

// Insert count value of (Q₂∩Q₃)-(Q₁)
svg.append('text')
Expand All @@ -494,7 +495,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[3].entityCount) }),
)
.text(operations[3].entityCount);
.text(numberFormat(operations[3].entityCount));

/**
* Intersection 'Q₂∩Q₃' between Circle2 and Circle3
Expand Down Expand Up @@ -528,7 +529,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[4].entityCount) }),
)
.text(operations[4].entityCount);
.text(numberFormat(operations[4].entityCount));

/**
* Intersection 'Q₁∩Q₃' between Circle1 and Circle2 and Circle3
Expand Down Expand Up @@ -576,7 +577,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[5].entityCount) }),
)
.text(operations[5].entityCount);
.text(numberFormat(operations[5].entityCount));

/**
* Intersection 'Q₁∩Q₂∩Q₃' between Circle1 and Circle2 and Circle3
Expand Down Expand Up @@ -605,7 +606,7 @@ const VennChart = ({
'class',
classnames(styles.legend, { [styles.disabled]: isEntityCountInvalid(operations[6].entityCount) }),
)
.text(operations[6].entityCount);
.text(numberFormat(operations[6].entityCount));
}
}, [loading, ref]);

Expand Down Expand Up @@ -850,7 +851,7 @@ const VennChart = ({
{dictionary.set.footer}
</Table.Summary.Cell>
<Table.Summary.Cell align="right" index={1}>
{total()}
{numberFormat(total())}
</Table.Summary.Cell>
<Table.Summary.Cell index={2}>
<Tooltip
Expand Down

0 comments on commit bc0125e

Please sign in to comment.