Skip to content

Commit a701edf

Browse files
committed
chore: cluster map
1 parent 1de74d2 commit a701edf

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.3.0-beta-11",
3+
"version": "1.3.0-beta-12",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/SegmentedBarChart/SegmentedBarChart.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
3939

4040
const renderValue = (value: string | number, label: string) => (
4141
<span className={countClassName} data-testid={`segmented-bar-chart-${label}-value`}>
42-
{value}
42+
{value}/{total}
4343
</span>
4444
)
4545

4646
const renderContent = (entity: Entity) => {
47-
if (entity.proportionalValue) {
47+
if (isProportional) {
4848
if (entity.value === 0) {
4949
return null
5050
}
5151
return (
5252
<>
53-
{renderValue(entity.proportionalValue, entity.label)}
53+
{renderValue(entity.value, entity.label)}
5454
<div className="flex left dc__gap-6">
5555
<span style={{ backgroundColor: entity.color }} className="h-12 dc__border-radius-2 w-4" />
5656
{renderLabel(entity.label)}
@@ -71,9 +71,7 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
7171
<div className={`flexbox-col w-100 dc__gap-12 ${rootClassName}`}>
7272
<div className={`flexbox ${isProportional ? 'dc__gap-24' : 'dc__gap-16'}`}>
7373
{entities?.map((entity) => (
74-
<div
75-
className={`${entity.proportionalValue ? 'flexbox-col' : 'flexbox dc__gap-4 dc__align-items-center'}`}
76-
>
74+
<div className={`${isProportional ? 'flexbox-col' : 'flexbox dc__gap-4 dc__align-items-center'}`}>
7775
{renderContent(entity)}
7876
</div>
7977
))}

src/Common/SegmentedBarChart/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ export const FALLBACK_ENTITY = {
1818
color: '#B1B7BC',
1919
label: '-',
2020
value: 0,
21-
proportionalValue: '0/1',
2221
}

src/Common/SegmentedBarChart/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export type Entity = {
1818
color: string
1919
label: string
2020
value: number
21-
proportionalValue?: string
2221
}
2322

2423
export interface SegmentedBarChartProps {

0 commit comments

Comments
 (0)