[beta] test conflicts with challenge requirement.
See original GitHub issueChallenge add-labels-to-scatter-plot-circles has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
This instruction:
Set the x attribute so it’s 5 units more than the value you used for the cx attribute on the circle.
seems to be in conflict with the second test case:
The first label should have text of “34, 78”, an x value of 34, and a y value of 422.
With the above instruction, shouldn’t the value of the x attribute for the text element be 39 and not 34 as the test case states? This is the output received following the above instructions on the developer console:
Here is the current code used:
<body>
<script>
const dataset = [
[ 34, 78 ],
[ 109, 280 ],
[ 310, 120 ],
[ 79, 411 ],
[ 420, 220 ],
[ 233, 145 ],
[ 333, 96 ],
[ 222, 333 ],
[ 78, 320 ],
[ 21, 123 ]
];
const w = 500;
const h = 500;
const svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);
svg.selectAll("circle")
.data(dataset)
.enter()
.append("circle")
.attr("cx", (d, i) => d[0])
.attr("cy", (d, i) => h - d[1])
.attr("r", 5);
svg.selectAll("text")
.data(dataset)
.enter()
.append("text")
// Add your code below this line
.attr("x", (d, i) => d[0] + 5)
.attr("y", (d, i) => h - d[1])
.text(d => d[0] + ", " + d[1]);
// Add your code above this line
</script>
</body>
The code above still passes the challenge regardless of the stated above reasons.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
@erictleung Just saw in chat that @cdrainxv was doing the PR when I posted. So I’ll wait for another ‘help wanted’ issue.
@cdrainxv - yes, good catch on that test! The x-value used to position the text should be 39, not 34 and @erictleung your suggestion will fix this test message. I just went through the other tests and it looks like they are using the correct numbers, so I think it’s just this second test that needs to be fixed.