On Fri, Feb 19, 2021 at 8:46 AM Ian Clark <[email protected]> wrote:
> To expand on a bald answer, let me focus a little. Suppose I've found a
> nice svg of a Cadillac dashboard. I want to hack it so that I can
> programmatically give it an integer value (arising from a computation in J)
> to set the position of the steering wheel. That spotlights my requirement
> right now, and maybe for evermore. Generalize it to rocketship sprites,
> wriggling worms, watch-this-space text boxes, moving arrows and beating
> hearts. You get the idea.

The first step, there, would be to see if you can manually edit the
dashboard svg to represent a different integer value.

For example, perhaps it represents an analog dashboard and the
speedometer is some sort of path element, full of coordinates. You
probably would not want to rebuild a new path for every different
integer value of speed to be represented -- instead you would probably
want to add a matrix transform on that path. This might take a bit of
study.

Once you had that, though, conceptually speaking, you might then use
javascript to replace that transform element with one which is
appropriate to whatever speed you wanted to represent.

Anyways... the prettier the result is, the more distracting elements
you'll have to cope with when adding utility. It's definitely doable,
but it's partially a matter of how much time you want to dedicate to
the effort.

(If you want more specific advice, I think we'd have to be able to see
the svg itself so that we could work on it.)

I hope this helps,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to