Skip to content
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

Clearer documentation and API for initializing CanvasSpace #12

Open
mrgreenh opened this issue May 17, 2016 · 1 comment
Open

Clearer documentation and API for initializing CanvasSpace #12

mrgreenh opened this issue May 17, 2016 · 1 comment

Comments

@mrgreenh
Copy link
Collaborator

mrgreenh commented May 17, 2016

I find the documentation for CanvasSpace to be unclear about how to initialize it and call its display() method. The CanvasSpace's id attribute is briefly explained as:
"an id property which refers to the "id" attribute of the canvas element in DOM. If no canvas element with this id is found, a new canvas element will be created."
While the display method's parent_id attribute is described as:
"the DOM element into which the canvas element should be appended".

So right now to select/obtain the canvas element you want to use for pt, you need to write something like CanvasSpace('canvasId').display('#canvasContainer'). I found it very easy to get confused and get it wrong, so I'm just suggesting to add one or two example usages there. And maybe highlight the fact that by default, with no parameters specified, it will simply append a new canvas element to a container with id "pt".

@williamngan
Copy link
Owner

Pt 0.2 has now a new constructor for CanvasSpace and SVGSpace to make it clearer. See if this works better for you. Thanks!
http://williamngan.github.io/pt/docs/guide/migration.html
http://williamngan.github.io/pt/docs/#func-CanvasSpace-CanvasSpace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants