Allow multiple whiskers
See original GitHub issueI wanted to experiment with multiple whiskers but creating the second whisker failed with the error:
Error[program:0:0]: "Cannot read property 'getContext' of null"
The problem seems to be that paper.get('supporterCanvas') only returns a reference to the canvas on the first call. I assume the reason for this is that you can call transferControlToOffscreen only once. Instead of just returning null I think it would be nicer if paper.get(‘supporterCanvas’) would cache the reference to the canvas on the worker side and return the cached reference instead. I think this would be generally useful independent of the whisker issue. To improve handling multiple whiskers I would like to change the current implementation so only a single setInterval is created by paper.whenPointsAt().
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Several Boxplots per Category, Whiskers & Boxplot do not align
However, I have several issues: I want the whiskers to have small horizontal lines. I tried to do it by stat_boxplot(geom = "errorbar")...
Read more >A Complete Guide to Box Plots | Tutorial by Chartio
Whisker range and outliers ... There are multiple ways of defining the maximum length of the whiskers extending from the ends of the...
Read more >How often should cats' whiskers be trimmed? - Vet Help Direct
The short answer, never. Cats whiskers are important for their communication, balance and protection, find out more in our latest blog.
Read more >Understanding and using Box and Whisker Plots - Tableau
As shown above, one can arrange several box and whisker plots horizontally or vertically to allow for easy comparison. When and how to...
Read more >Cats, husbands and whiskers - Dayton.com
It's known that whiskers also help felines hunt. Pip's whiskers allow him to sense his prey or even to alert him to predators....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No this is a separate issue. The problem is the following line, where the whisker canvas is requested:
https://github.com/janpaul123/paperprograms/blob/a35abb97008d711c29e5092c9b99117529c02037/client/paper/entry.js#L125
If this is called twice the second time null is returned instead of a reference to the canvas. I quick fix would be to generate a unique id for each whisker canvas.
Ah that’s a good idea! Maybe we should drop the two different colours in the default case too and just use the moving dot animation? In any case, sounds good to me. 💯