Say I have a figure instantiated:
#could spec frame width/height too but ends in same issue
f = figure(height=800,width=500)
In a JS callback I want to get the pixel values (i.e. screen space coords) of the plot area’s lower left (i.e. origin) and upper right corner. I started this thinking I could get it using the JS-side computed outer/inner height/width:
var ox_pixel = f.outer_width-f.inner_width
var oy_pixel = g.outer_height-f.inner_height
But this doesn’t actually work because there’s border space on either side of the figure’s plot area - space for axes ticks, labels, titles, toolbars, other layout type things etc. I don’t know how to access the computed “border padding” on either side.
I looked at the “above”,“below”, “left” and “right” properties on the figure (accessing an array of layouts located on the respective sides of the plot area), but they don’t seem to yield a computed height/width for each.
There are also min_border_top etc. properties you can assign but obviously that’s just the “minimum” obviously and not the computed value.
Another idea I had was to somehow send a manufactured tap event to data units (0,0) and see if I could get a corresponding sx/sy computed… or even go the other way and send a tap event at screen units (0,0) and work it out from there. But that hasn’t worked because I can’t seem to access the (deep in the source code) method that translates data units and screen units (really if I could figure out an easy way to do that I’d be golden too).
Any ideas?? Thanks…