Closed bartbutenaers closed 8 months ago
Hi @bartbutenaers , I would suggest adopting a normalised values ranging from 0 to 1 for the x, and y co-ordinates of the heatmap data. This approach will facilitate the scaling of these values according to the client-side viewport dimensions (height and width). To ensure consistent rendering across various resolutions, it's crucial to preserve the aspect ratio of the heatmap.
For example: On Server :
Client side rendering:
If you need any clarifications let me know.
Thanks, NSwamy
Hi @nswamy14,
Thanks for thinking out loud. Really appreciated!
Yes indeed that makes sense. On the other hand I am not sure if users would have a good understanding of that. If they want to create their heatmap data, they need to start working with floating point x and y coordinates. And how many digits behind the zero are they allowed to specify.
But can I conclude from this, that this kind of calculations is the responsibility of the applications and not of your library? So I mean it is ok that I do such calculations myself in my application? Beside from how i do it: using normalized x/y coordinates, or by specifying my own grid rows and columns, or...
@bartbutenaers Yes, you're correct. The application must handle the calculations based on its specific needs and what's feasible.
Ok thanks for educating me ;-)
Hi @nswamy14,
After seeing your new projection method, I 'think' I am not using this library correctly...
I have no idea what the width and height of the div element will become in the front end running in the device's browser. Moreover if I have e.g. the same dashboard running on a large Windows portable and a small Android smartphone, the div elements will have a completely different size. As a result, since I don't know the clientWidth and clientHeight, I don't know the maximum x and y values of my heatmap. Or am I completely misinterpreting your x/y space?
So I 'thought' that it was not ok to work with x and y coordinates. Instead I had defined rows and columns that divide my heatmap area in a grid with cells.
Which means my server-side application generates something like this:
When this data arrives in the frontend code running on my devices, for each grid cell the corresponding heatmap coordinates are being calculated (based on the current row & column & div client width & div client height):
Then I pass that data (containing x and y coordinates) to your heatmap node.
Is this a bad way of working, and should I simply use x and y coordinates. But then how do I know what is the maximum x and y coordinate value (without knowing in advance the div client width and height)?
Thanks for illuminating me!!!!!!!!!!
Kind regards, Bart