Ezhil4663 has asked for the wisdom of the Perl Monks concerning the following question:

Can anyone please provide me a simple example that uses svg's mouse action? I couldn't find any good example online. I would like to show a message when I click on a rectangle. I am using SVG module for developing graphics.

Replies are listed 'Best First'.
Re: Mouse action using SVG
by LanX (Saint) on Jul 29, 2016 at 21:23 UTC
    What's the relation to Perl?

    Please show some code and context, this sounds rather like browser and JS related.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      Here is the perl script to draw rectangle using SVG module. In which, I would like to have mouse interactivity. The module supports mouse actions but I am not clear about how to use it.

      $svg->rectangle( x =>$x1, y =>$y1, width => $x2, height => $y2, style => { 'fill' => 'rgb(0, 0, 128)', 'stroke' => 'black', 'stroke-width' => 1, 'stroke-opacity' => 1, 'fill-opacity' => 1, }, );
        >  The module supports mouse actions but I am not clear about how to use it.

        Would you mind to specify "the module" or maybe even link to it?

        There are several SVG modules on cpan,   but I am not clear about it.

        See How (Not) To Ask A Question for further ideas.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!