Blocks are placed on the workspace, and their positions are in "workspace coordinates": they are relative to the workspace origin, and they don't change when you zoom the view. BlockSvg:getRelativeToSurfaceXY() returns workspace coordinates. Workspace coordinates can be negative in both X and Y.
"Workspace units" refer to measurements on the workspace that ignore the origin. You might use workspace units to describe the distance between two blocks or two connections.
There is a viewport into the workspace, which may be moved around or zoomed in. The scrollbars show the position of that viewport within the allowable range.
Although the Blockly workspace is of infinite size, you can't move the viewport infinitely far away from the blocks in the workspace. We add a border around all of the blocks, such that you can scroll half-a-screen past the left-most block. Same thing for up, down, and right.
So this is as far as I can scroll left:
If I zoom out, the block is in the same position, so effectively more of the workspace is visible:
Measurements on the screen are generally done in pixels. For instance, the width of the viewport in pixels didn't change between the two previous images. All of the members of workspace metrics are in pixel units (as far as I know).
Conversion from pixels to workspace units can be done by multiplying by workspace.scale. "Pixel units" means that we're specifying a distance on the screen, but not an origin. How far the mouse has moved during a drag would be measured in pixel units.
workspace.zoom(x, y, 1)
scrollbar.set(x, y)
They require workspace coordinates or pixel coordinates?