DEV Community

loading...

Discussion on: Inside a dev's mind: How do you plan a UI feature?

Collapse
jkettmann profile image
Johannes Kettmann Author

Thanks for your feedback Rob! That's interesting. So they basically look at it as a 3D coordinate system? I'll check that out. Thanks for the link

Collapse
kelvin9877 profile image
Kelvin Liang

I tend to use 3D array to store posts data, and render them in HTML Table format. (it make more sense to me rather than use flex or grid).

 const result = new Array(7).fill().map(() => new Array(24).fill().map(() => new Array()));

It is easier to retrieve the posts by data[row][col], get the number of posts by data[row][col].length, in 2D coordinate system (I am not sure how to do the color yet).

Collapse
robole profile image
Rob OLeary

The conceptual model is different. I think this is where the mindset differs between a developer and data scientist. Im a developer interested to learn more Data Science, so don't quote me on this, but this is what I got from it! The chart coordinate system is 2D: width and height, but the 3 data dimensions are represented in the chart by: X (horizontal position), Y (vertical position), Z (colour). If data is symmetric, having separate data structures is not an issue, you can reference the same data point by indices. So, you find some statistics and data science guys going down this route, it's a data-first approach. We think in more algorithmic terms I guess.

In HTML, to be semantic HTML it should be in a <table> btw! If you give it a <caption> and summarise the table, you also give assistive technology a chance to navigate the data. So I would avoid <div>s if you can!

Thread Thread
jkettmann profile image
Johannes Kettmann Author

Of course, now it makes sense. If you look at the number of posts being a function of the weekday and hour like "numPosts = f(weekday, hour)" then you have a 3D coordinate system. Thanks for pointing that out.