Has anyone successfully been able to get a Canvas or WebGL context in a package? I’m interested in exploring what can be done with respect to code visualization.
Have you tried? They should be available like any other HTML.
I created an example for you. Look at the canvas branch of the repo at https://github.com/mark-hahn/html-tab.
You can run it by cloning the branch into your packages folder, running
apm install inside the project folder, and then running the command
Thanks, Mark. I appreciate you putting in the time to create the example.
I would have simply tried it, but I had been holding off on investing the time to learn the Atom package architecture until the API settled down. It looks like now is the time!
Actually you don’t have to. Just look at the source. It is tiny and works. I just did it out of curiosity.
The minimap package use a canvas with a context2d for rendering the minimap, the whole canvas rendering can be found in the
CanvasDrawer mixin if you need more examples.