(layout, aro)
| 377 | // compute the bounding box of the shape so that it can be compared with the SVG |
| 378 | // bounding box |
| 379 | function shapeToBBox(layout, aro) { |
| 380 | var bbox = {}; |
| 381 | var x1; |
| 382 | var y1; |
| 383 | // map x coordinates |
| 384 | bbox.x = mapAROCoordToPixel(layout, 'xref', aro, 'x0'); |
| 385 | x1 = mapAROCoordToPixel(layout, 'xref', aro, 'x1'); |
| 386 | // SVG bounding boxes have x,y referring to top left corner, but here we are |
| 387 | // specifying aros where y0 refers to the bottom left corner like |
| 388 | // Plotly.js, so we swap y0 and y1 |
| 389 | bbox.y = mapAROCoordToPixel(layout, 'yref', aro, 'y1'); |
| 390 | y1 = mapAROCoordToPixel(layout, 'yref', aro, 'y0'); |
| 391 | bbox.width = x1 - bbox.x; |
| 392 | bbox.height = y1 - bbox.y; |
| 393 | return bbox; |
| 394 | } |
| 395 | |
| 396 | function imageToBBox(layout, img) { |
| 397 | var bbox = {}; |
no test coverage detected
searching dependent graphs…