-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace react-vis with Recharts #1722
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Anik Dhabal Babu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anshgoyalevil mind reviewing this?
On it 🚀 |
packages/jaeger-ui/src/components/Monitor/ServicesView/operationDetailsTable/opsGraph.tsx
Outdated
Show resolved
Hide resolved
crosshairValues: [ | ||
{ | ||
key: 1, | ||
...serviceMetrics.service_call_rate.metricPoints[0], | ||
}, | ||
], | ||
}); | ||
expect(wrapper.find('AreaSeries').render()).toMatchSnapshot(); | ||
expect(wrapper.find('LineSeries').render()).toMatchSnapshot(); | ||
}); | ||
|
||
it('AreaSeries onNearestX, XYPlot onMouseLeave', () => { | ||
wrapper.setProps({ | ||
...props, | ||
loading: false, | ||
metricsData: serviceMetrics.service_call_rate, | ||
}); | ||
wrapper.find('AreaSeries').at(0).prop('onNearestX')({ x: 1, y: 2 }, { index: 7 }); | ||
expect(wrapper.state().crosshairValues).toEqual([{ label: 0.95 }]); | ||
wrapper.find('XYPlot').prop('onMouseLeave')(); | ||
expect(wrapper.state().crosshairValues).toEqual([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing these tests defeats the purpose of test-driven development. Can we add some similar assumptions for tooltip hover test to verify the functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, on it.
yAxisTickFormat?: (v: number) => number; | ||
yAxisTickFormat?: (v: number) => string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we return a number here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, as I previously described that timeFormatter function only accept string.
type="monotone" | ||
dataKey="y" | ||
connectNulls | ||
fillOpacity={0.1} | ||
stroke={color || this.colors[idx]} | ||
fill={color || this.colors[idx]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we passing on the data prop here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no props to pass the data here. Also, we don't need to pass the data props here; the data props is passed to the parent component.
data={line.metricPoints ? line.metricPoints : []} | ||
color={[color || this.colors[idx]]} | ||
/> | ||
<Line connectNulls key={i++} type="monotone" dataKey="y" stroke={color || this.colors[idx]} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we passing on the data prop here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need.
packages/jaeger-ui/src/components/Monitor/ServicesView/serviceGraph.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Anik Dhabal Babu <[email protected]>
it('Loading indicator is displayed', () => { | ||
expect(wrapper).toMatchSnapshot(); | ||
it('displays loading indicator when loading', () => { | ||
expect(wrapper.find('LoadingIndicator').exists()).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exists()).toBe(true)
- is there a simpler form like isNotNull?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think. But there are similar from like toBeTruthy()
or toBeTrue()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(wrapper.find(ServiceGraph).first().prop('error')).not.toBeNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh OKK
Q: in the screenshot all dots are the same size, but the original chart used number of spans to control the size of the trace. Is such functionality supported in recharts? |
Apart from the X and Y axes, Recharts also provides a Z-axis. With the assistance of the range property of Z axis, we can achieve this desired functionality. (similar to sizeRange in react-vis) |
Are you planning to add that? Otherwise you're removing exiting functionality |
Signed-off-by: Anik Dhabal Babu <[email protected]>
Signed-off-by: Anik Dhabal Babu <[email protected]>
Signed-off-by: Anik Dhabal Babu <[email protected]>
when I run
(for some reason they are not included in the CI output). |
Okay, let me go through it and try to fix it. |
I also noticed the same. There are a lot of warnings because of the Deprecated Enzyme API, and due to that, the useful errors cannot be seen in CI output. A quick fix here can be to use the Though ignoring the warnings by suppressing them is also wrong. In future, we may fix all of the warnings (hopefully), and fail the CI on warning too. |
Thanks for your review. I will definitely try it. |
Signed-off-by: Yuri Shkuro <[email protected]>
the two CI builds now very clearly show the breaks, both from linter and compiler |
It gives this error every time: 'TypeError: window.ResizeObserver is not a constructor. |
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
})) Add the above code to It should then work. |
@anikdhabal are you still working on this issue? |
Yeah, I was inactive due to my exam, but I have fixed that issue now. |
Can we help to get this shipped? |
help is welcome, this needs a rebase |
Okay, I'm on it |
Which problem is this PR solving?
Resolves #1597
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test