-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shapes on canvas #28
Comments
Hi @diebarral, Thank you for sharing your thoughts on this. I agree that adding support for overlaying shapes and text would significantly enhance the usability of this module. In terms of the approach, we can expose additional apis for Shape and Text rendition. These APIs will overlay an additional single canvas layer(To keep the rendering simple and lightweight) on top of the Heatmap (WebGL) layer. This layer will be reactive to zoom, pan, rotations and other interactions inline with Heatmap layer. As part of this feature, we may need to support the following feature as well:
Sample API sytax for considerations:
|
Overlaying canvases is the thing that I want to avoid. I've found it's quite complicated to get it right, especially if the user can zoom in/out or drag the heatmap around. What do you think about drawing the shapes on the same canvas as the heatmap? Is there something I don't know that makes this complicated or not possible? |
Rendering everything on a single existing WebGL layer may not be optimal:
|
Hi @nswamy14,
I have a situation at my current project for which I have to overlap a second canvas on top of this library to display some shapes the client wants to see (zones, more specifically). This has been proven to be quite complicated to get right, so the alignment and zoom/scale between the two canvases make sense.
It'd be great if this library supported drawing additional shapes on top of the heatmap because I avoid the problem mentioned above. Also, this is something I'm willing to do myself and create a pull request later on.
The solution I'm thinking of is providing a function to which you can pass an array of objects, where each object represents a shape. This object would be a list of points that represent the vertexes of the shape (only polygons for now).
What do you think about this? Do you think is doable? Do you see any potential issue I might run into? Any consideration I need to have?
Thanks!
The text was updated successfully, but these errors were encountered: