Skip to content
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

Fix: Avoid duplicate key error with time scales at millisecond precision #1756

Merged
merged 4 commits into from
Feb 18, 2022
Merged

Fix: Avoid duplicate key error with time scales at millisecond precision #1756

merged 4 commits into from
Feb 18, 2022

Conversation

vedmakk
Copy link

@vedmakk vedmakk commented Sep 2, 2021

When using the Line-Chart as a timeline with Date-Objects on the X-Axis, the AxisTicks and GridLines are using a string representation of the x-Values' Date-Object as the react element's "key". This causes duplicate keys when the timelines scale is below 1 second intervals (since a date-objects string representation does only include seconds, for example: "Thu Sep 16 2021 09:40:59 GMT+0100 (Western European Summer Time)").

This is a small PR to use the timestamp (.valueOf()) as the react element's key for AxisTicks and GridLines, so that the Line Chart works correctly with milliseconds precision.

@vedmakk vedmakk marked this pull request as draft September 16, 2021 09:12
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a11710e:

Sandbox Source
nivo Configuration

@vedmakk vedmakk marked this pull request as ready for review September 16, 2021 14:25
@vedmakk vedmakk changed the title Use timestamp as key for grid lines and axis ticks to support ms scale Fix: Avoid duplicate key error with time scales at millisecond precision Sep 16, 2021
@netzwerg
Copy link
Contributor

This is currently blocking some of our UI work – how can we support you in moving this PR forward?

@vedmakk
Copy link
Author

vedmakk commented Oct 7, 2021

Hi @plouc , anything we can do to get this merged?

@plouc
Copy link
Owner

plouc commented Oct 7, 2021

@protyze, I'm afraid not, I'm just super busy with work atm.

@stale
Copy link

stale bot commented Jan 5, 2022

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

@stale stale bot added the stale label Jan 5, 2022
@netzwerg
Copy link
Contributor

netzwerg commented Jan 5, 2022

bump

@stale stale bot removed the stale label Jan 5, 2022
@plouc
Copy link
Owner

plouc commented Feb 18, 2022

Good catch! And sorry for the late review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants