fix(ui): nodes value rounded

This commit is contained in:
Shekar Siri 2023-10-12 18:53:54 +02:00
parent 205195f946
commit 7fb8ca5e7b
3 changed files with 9 additions and 10 deletions

View file

@ -29,7 +29,7 @@ function NodeButton(props: Props) {
<div className='w-6 shrink-0'>
<Icon name='arrow-right-short' size={18} color='green' />
</div>
<div className='ml-1 font-medium'>Continuing {payload.value}</div>
<div className='ml-1 font-medium'>Continuing {Math.round(payload.value)}%</div>
</div>
<div className='border-b py-1 px-2 flex items-center'>
<div className='w-6 shrink-0'>
@ -51,7 +51,7 @@ function NodeButton(props: Props) {
}}
onClick={toggleMenu}
>
{payload.name} <span style={{ fontWeight: 'bold' }}>{payload.value + '%'}</span>
{payload.name} <span style={{ fontWeight: 'bold' }}>{Math.round(payload.value) + '%'}</span>
{/*{' '} <span style={{}}>{payload.avgTimeFromPrevious}</span>*/}
</div>
</Popover>

View file

@ -35,13 +35,6 @@ function SankeyChart(props: Props) {
const { data, nodeWidth = 10, height = 240 } = props;
const [activeLink, setActiveLink] = React.useState<any>(null);
data.nodes = data.nodes.map((node: any) => {
return {
...node,
avgTimeFromPrevious: 200
};
});
useEffect(() => {
if (!activeLink) return;
const { source, target } = activeLink.payload;

View file

@ -211,7 +211,6 @@ export default class Widget {
data.hideExcess = this.hideExcess;
data.startType = this.startType;
data.startPoint = [this.startPoint.toJson()];
console.log('excludes', this.excludes);
data.excludes = this.series[0].filter.excludes.map((i: any) => i.toJson());
}
return data;
@ -240,6 +239,13 @@ export default class Widget {
setData(data: any, period: any) {
const _data: any = { ...data };
if (this.metricType === USER_PATH) {
_data['links'] = data.links.map((s: any) => ({
...s,
// value: Math.round(s.value),
}));
return _data;
}
if (this.metricOf === FilterKey.ERRORS) {
_data['errors'] = data.errors.map((s: any) => new Error().fromJSON(s));
} else if (this.metricType === INSIGHTS) {