You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VictoryStack supports null values in the VictoryArea data, except in the instance where all values are null, x values are dates, and there are multiple VictoryAreas. In this case VictoryStack crashes.
This is due to filtering out all null values before determining if the array of data uses dates as the x data.
The dataset being passed into fillData is empty, and so when inside fill data it is checked if the x value is a date, it returns a falsey value (undefined).
This causes the return from fillData to place unix timestamps instead of JS date objects in the x value. Once this new dataset is passed into addLayoutData it sees the other VictoryArea uses JS Dates, and so tries to call a date function (getTime) on a unix timestamp.
This can be solved by waiting to filter the null values out until the isDate is determined so that a Date object will be returned rather than a unix timestamp.
Is there an existing issue for this?
Code of Conduct
Victory version
37
Code Sandbox link
https://codesandbox.io/p/sandbox/victory-starter-forked-3gxgkt?file=%2Fsrc%2FApp.tsx
Bug report
VictoryStack supports null values in the VictoryArea data, except in the instance where all values are null, x values are dates, and there are multiple VictoryAreas. In this case VictoryStack crashes.
This is due to filtering out all null values before determining if the array of data uses dates as the x data.
The dataset being passed into fillData is empty, and so when inside fill data it is checked if the x value is a date, it returns a falsey value (undefined).
This causes the return from fillData to place unix timestamps instead of JS date objects in the x value. Once this new dataset is passed into addLayoutData it sees the other VictoryArea uses JS Dates, and so tries to call a date function (getTime) on a unix timestamp.
This can be solved by waiting to filter the null values out until the isDate is determined so that a Date object will be returned rather than a unix timestamp.
Steps to reproduce
Steps to reproduce behavior:
Expected behavior
Actual behavior
Environment
The text was updated successfully, but these errors were encountered: