* Helper function for select and selectAll
(p)
| 157 | * Helper function for select and selectAll |
| 158 | */ |
| 159 | function getContainer(p) { |
| 160 | var container = document; |
| 161 | if (typeof p === 'string' && p[0] === '#'){ |
| 162 | p = p.slice(1); |
| 163 | container = document.getElementById(p) || document; |
| 164 | } else if (p instanceof p5.Element){ |
| 165 | container = p.elt; |
| 166 | } else if (p instanceof HTMLElement){ |
| 167 | container = p; |
| 168 | } |
| 169 | return container; |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Helper function for getElement and getElements. |