Nativescript: Enable Canvas API in NativeScript

Created on 7 May 2015  路  10Comments  路  Source: NativeScript/NativeScript

Enable the Canvas API in NativeScript so that existing data visualization frameworks written in JavaScript to be out of the box integrated inside NativeScript. For example - charts.js.

Please vote for this issue in our ideas portal.

done feature

Most helpful comment

Hey folks,

Please use this repository to test and submit issues about our Canvas implementation:
https://github.com/NativeScript/nativescript-canvas

Thanks

All 10 comments

Here is an iOS implementation that we can use as a reference: https://github.com/phoboslab/Ejecta

it will be cool if it can support canvas in nativescript!!

Rendering is one part of the task. Other parts are dimensions and user input responding. Enabling the drawing APIs of the HTML5 Canvas will not be enough to reuse existing Web Libraries in {N}. For example here you can see the usages of the document and window objects. So, this is connected to enabling some Web shims within {N} and will require more work than the drawing ONLY.

If you're going to enable Canvas support, possibly it should be put into a WebGL 2D orthogonal context. That way, it'll be accelerated on both platforms. Additionally, it seems like Canvas API and WebGL should be polyfills to real GL/ES support. All of the browser capabilities should be polyfills on top of native implementations/plug-ins. That way, performance isn't lost to a bunch of translations in JavaScript.

Just my 2cents!

Gents, I mention a pre-existing Javascript-based WebGL function list (provided by Google's Closure compiler) @ issue 289, hopefully, it should be possible to implement this 3D-Canvas API, against equivalent OpenGL ES functions, cross-platform, within NativeScript.

Hey folks,

Please use this repository to test and submit issues about our Canvas implementation:
https://github.com/NativeScript/nativescript-canvas

Thanks

@enchev thank you for this

@enchev , mentioned plugin is not supported anymore. am I missing something, maybe there is other way to perform simple drawing in Nativescript?

I'm also currently look for a way to do some very special drawing in Nativescript. Normally I did this with canvas on Android. Should I use something like https://www.npmjs.com/package/nativescript-canvas-interface ?

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rLoka picture rLoka  路  3Comments

kn9ts picture kn9ts  路  3Comments

dhanalakshmitawwa picture dhanalakshmitawwa  路  3Comments

NickIliev picture NickIliev  路  3Comments

Pourya8366 picture Pourya8366  路  3Comments