Skip to content

Commit

Permalink
fix(Services): 🐞 Sankey no manage byterate value 0
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoval committed Dec 13, 2024
1 parent 7f69f70 commit 879ab4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/components/SKSanckeyChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const SkSankeyChart: FC<{ data: SkSankeyChartProps; onSearch?: Function; formatt
tooltip: { container: { color: styles.default.darkTextColor } }
}}
labelTextColor={styles.default.darkTextColor}
valueFormat={formatter ? (value: number) => formatter?.(value) : ''}
valueFormat={(value: number) => formatter?.(value)}
colors={getColors}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Services/components/PairsSankeyChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const PairsSankeyChart: FC<PairsSankeyChartProps> = function ({ pairs, showFilte
<SkSankeyChart
data={{ nodes, links }}
onSearch={showFilter ? handleFindPairType : undefined}
formatter={metricSelected && mapFormatter[metricSelected]}
formatter={metricSelected ? mapFormatter[metricSelected] : undefined}
/>
</CardBody>
</Card>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Services/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ const generateSankeyLinks = (
.map(({ sourceName, destinationName, ...rest }) => ({
source: `${sourceName}.`,
target: destinationName,
value: metricSelected ? (rest[metricSelected] as number) : DEFAULT_SANKEY_CHART_FLOW_VALUE
value:
metricSelected && rest[metricSelected] ? (rest[metricSelected] as number) : DEFAULT_SANKEY_CHART_FLOW_VALUE
}))
.filter(({ source, target }) => source && target)
);
Expand Down

0 comments on commit 879ab4a

Please sign in to comment.