Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

D3: Scatterplot Graph: "y-values don't line up with y-locations" when Date object is not in isoFormat #1094

Closed
qwloh opened this issue Apr 15, 2020 · 1 comment

Comments

@qwloh
Copy link

qwloh commented Apr 15, 2020

Issue Description

The project's User Story #6 only requires that the data-yvalue attribute of a data point be set to a Date object. It does not explicitly state that the object has to be in ISO format. Hence,

Expected behavior

Test #8: The data-yvalue and its corresponding dot should align with the corresponding point/value on the y-axis

The above test should return true regardless whether a student set the data-yvalue attribute to take Date objects in ISO format or the JavaScript default format.

Actual behavior

Test only pass when Date object in data-yvalue attribute is explicitly formatted to ISO Dates. See screenshots.

How to Reproduce
Toggle line 66 and 67 of Javascript in the following pen

.attr('data-yvalue', d=>d3.isoFormat(d3.timeParse("%M:%S")(d.Time)))
//  .attr('data-yvalue', d=>d3.timeParse("%M:%S")(d.Time))

Link to Pen

https://codepen.io/qwenloh/pen/dyYGzjW

Browser Information

  • Browser Name, Version: Google Chrome, 80.0.3987.163 (Official Build)(64-bit)
  • Operating System: Windows 10
  • Mobile, Desktop, or Tablet: Desktop

Screenshot

Test pass when Date object in the data-yvalue attribute is in ISO format
pass

Test fail when the exact same code is tested, but without explicitly formatting the Date object
fail

@moT01
Copy link
Member

moT01 commented Sep 18, 2020

For more visibility, please open issues on the main repo for these. Thanks and happy coding 🎉

@moT01 moT01 closed this as completed Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants
@qwloh @moT01 and others