Freecodecamp: Data Visualization with D3 - Array described as 3d has only 2 dimensions

Created on 25 Feb 2020  路  6Comments  路  Source: freeCodeCamp/freeCodeCamp


Describe your problem and how to reproduce it:

I'd like to submit a suggestion for a clarification in the explanation used in the following lesson:

Data Visualization with D3: Use the d3.max and d3.min Functions to Find Minimum and Maximum Values in a Dataset

The instructions in this lesson refer to variable positionData which is defined as:

const positionData = [[1, 7, -4],[6, 3, 8],[2, 9, 3]]

The lesson describes this as being a 3d array:

The positionData variable holds a 3-dimensional (3D) array.

This is misleading as positionData is not a 3-dimensional array but a 2d array. A 3d array could not be mapped to a 2d representation like a table:

| | | |
|---|---|----|
| 1 | 7 | -4 |
| 6 | 3 | 8 |
| 2 | 9 | 3 |

A 3d array would have a structure like:

[
    [
        ["foo", "bar"],
        ["fizz, "buzz]
    ],
    [
        ["foo", "bar"],
        ["fizz, "buzz]
    ]
]

I think this should be considered for rewording less it lead to a misunderstanding.

Add a Link to the page with the problem:
https://www.freecodecamp.org/learn/data-visualization/data-visualization-with-d3/use-the-d3.max-and-d3.min-functions-to-find-minimum-and-maximum-values-in-a-dataset

Tell us about your browser and operating system:

  • Browser Name: Firefox
  • Browser Version: 73.0.1 (64-bit)
  • Operating System: Windows 10

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Capture

first timers only help wanted learn

Most helpful comment

I'd like to take this issue

All 6 comments

How about this...

The positionData array holds sub arrays of x, y, and z coordinates. Use a D3 
method to find the maximum value of the z coordinate (the third value) from 
the arrays and save it in the output variable.

I would also get rid of the Note and Fun fact sentence.

@moT01 Good suggestion. I think this still conveys the author's intended message without potentially misleading the student's understanding of what constitutes a dimension in the context of an array.

Edit: also agree WRT the Fun fact - I don't think this adds anything enlightening.

If anyone wants to make a PR using Tom's suggestion, it would be very welcome.

I'd like to take this issue

@AshNaz87 Looks like @Senipah has already created a PR for this issue.

Missed it 馃槰

Was this page helpful?
0 / 5 - 0 ratings