I would guess it's less about "online and offline" than "in a web browser and out of one". The web offers several powerful standards for rendering 2D visuals - SVG, canvas, WebGL - all of which are much easier to bootstrap and to use directly than anything that's ever made it to the native desktop, and all of which come with first-class support for interactivity.
Even today, just creating a desktop window that you can draw to using OpenGL is a significant hurdle for someone who isn't used to that sort of thing. Now, do want that GUI code to also work on multiple systems? What about your graphics code? macOS has deprecated OpenGL. Do you want to interact with it using your mouse? What about rendering text, which is a whole other hurdle? Heaven forbid you want a higher-level vocabulary or dev tools with live inspection. I suppose writing to a PNG is easy enough- but then you lose any chance at interactivity.
The web is simply the most straightforward option if a plot is to be embedded in any kind of interactive app.