[Domterm-discuss] DomTerm question/suggestion

Per Bothner per at bothner.com
Mon Nov 9 18:05:29 PST 2020


On 11/9/20 1:42 PM, Ethan Merritt wrote:
> On Monday, 9 November 2020 12:29:17 PST Per Bothner wrote:

> That would suffer from the original problem, I think.
> SVG animation switches amongst previously loaded frames.

What I mean is that JavaScript can modify an existing SVG structure (DOM) in the browser.
For example you could create an SVG image with a circle:
    <circle cx="50" cy="50" r="50"/>

The if you modify the cx/cy attributes of the <cicle> element,
the circle would move.

We could create an escape sequence that would do that sort of thing.

> I imagine that at least for the qt flavor of domterm I could figure out
> how to enable generation of mouse events from Qt.

That is the wrong way to do it.  Better to use JavaScript events.
(1) It is more portable - and works for all front-ends, not just Qt.
(2) Tying it to Qt doesn't help anyway, since the event still has to be
sent from qtdomterm to the domterm background (server) to gnuplot,
so it has to be encoded in the character stream, regardless.

> The problem would be initial calibration of
> the mapping from raw mouse pixels to the corresponding x/y offset in
> pixels from the plot origin.

One idea is you have a protocol (an escape sequence and/or an element
property) that specifies a key (an identifier) and requests that
mouse events in that image (or generally within that element) will
send an encoding of the event that to the application.  The encoded event
includes the key, mouse coordinates relative to the element origin,
and the button state/action.
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/


More information about the Domterm-discuss mailing list