You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Andreas Neumann <ne...@karto.baug.ethz.ch> on 2003/10/18 20:27:57 UTC

delayed mouse-over effect for first time of mouse-over

still refering to http://www.carto.net/geog234/lab3/lab3_end.svg

I notice that for the first mouse-over effect in the above example, it takes
very long, until the first mouse-over event reacts. On my pretty new MacOSX G4
laptop it takes initally 3-4 seconds until the first of the mouse-events occurs
- later it takes less than a second until the other mouseover-events react.

Again, I currently don't have a PC with Windows/Linux to test for seeing the
difference.

Andreas

--     
The only thing that stands between a man and what he wants from
life is often merely the will to try it and the faith to believe
that it is possible ...
-- M. DeVos
    
----------------------------------------------     
Andreas Neumann - Department of Cartography     
Swiss Federal Institute of Technology (ETH)     
ETH Hoenggerberg, CH-8093  Zurich, Switzerland     
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153     
e-mail: neumann@karto.baug.ethz.ch     
www: http://www.karto.ethz.ch/neumann/     
SVG.Open/Carto.net: http://www.svgopen.org/     

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: delayed mouse-over effect for first time of mouse-over

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
Just downloaded CVS version and tried it with the US example. Yes, the delay has
gone and also the mouse-over feels much "snappier" now!

Good work, thanks a lot!


>     We were always using Bounding Box first it's just that the Bounding
> Box was computed on the unioned sensitive region, and doing the
> geometric
> union was being very slow for complex data (I believe it is generally
> an O(N^2) operation in the number of edges).  We now do the union of
> the bounding rects of the geometry that would be unioned.

ok - did not understand it in the first run.

Looking forward to test more examples with Batik now.

Andreas

--     
The only thing that stands between a man and what he wants from
life is often merely the will to try it and the faith to believe
that it is possible ...
-- M. DeVos
    
----------------------------------------------     
Andreas Neumann - Department of Cartography     
Swiss Federal Institute of Technology (ETH)     
ETH Hoenggerberg, CH-8093  Zurich, Switzerland     
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153     
e-mail: neumann@karto.baug.ethz.ch     
www: http://www.karto.ethz.ch/neumann/     
SVG.Open/Carto.net: http://www.svgopen.org/     

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: delayed mouse-over effect for first time of mouse-over

Posted by Thomas DeWeese <Th...@Kodak.com>.
Andreas Neumann wrote:

>>    It is the building of the sensitive regions.  I have a quick fix
>> that uses a faster computation of the 'sensitive' bounding boxes and then
>> when
> 
> good to hear. - yes, to use the bounding box first is definitely a good idea.

    We were always using Bounding Box first it's just that the Bounding
Box was computed on the unioned sensitive region, and doing the geometric
union was being very slow for complex data (I believe it is generally
an O(N^2) operation in the number of edges).  We now do the union of
the bounding rects of the geometry that would be unioned.

> just take your time. It's not that urgent for me - but it would help me in the
> long run ...

   The 'complete' fix is now in CVS (as of a few days ago).  We no longer
calculate the union for any normal case.  This makes the highlighting
significantly faster as we don't have to rebuild the union shape when the
fill/stroke changes anymore.

> I meanwhile checked out the CVS version - which was much easier than expected
> and tested your bug-fix from yesterday regarding the toggling of the raster
> image. Works fine now.

    Good to hear.




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: delayed mouse-over effect for first time of mouse-over

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
>     It is the building of the sensitive regions.  I have a quick fix
> that
> uses a faster computation of the 'sensitive' bounding boxes and then
> when

good to hear. - yes, to use the bounding box first is definitely a good idea.

> the BBox is penetrated the true sensitive region is computed.  This
> eliminates
> the initial 'pause' - however some of the states take over 400ms to
> generate
> the sensitive region (Texas in particular).  This is because we do

yes - the difference in geometry size is enormous - but that's the nature of
cartography. You might have very simple path-elements and in the same file very
complex path-elements.

> actually
> do a geometric union of the fill/stroke (and markers) to get this
> region*.
> 
>     I will try and deliver the code tonight.

just take your time. It's not that urgent for me - but it would help me in the
long run ...

I meanwhile checked out the CVS version - which was much easier than expected
and tested your bug-fix from yesterday regarding the toggling of the raster
image. Works fine now.

Andreas

--     
The only thing that stands between a man and what he wants from
life is often merely the will to try it and the faith to believe
that it is possible ...
-- M. DeVos
    
----------------------------------------------     
Andreas Neumann - Department of Cartography     
Swiss Federal Institute of Technology (ETH)     
ETH Hoenggerberg, CH-8093  Zurich, Switzerland     
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153     
e-mail: neumann@karto.baug.ethz.ch     
www: http://www.karto.ethz.ch/neumann/     
SVG.Open/Carto.net: http://www.svgopen.org/     

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: delayed mouse-over effect for first time of mouse-over

Posted by Thomas DeWeese <Th...@Kodak.com>.
Andreas Neumann wrote:
>>    There is a similar delay.  [...] It might also be the building of
>>'sensitivity' regions. Do you run much code 'onload'?
> 
> 
> yes - I run quite a bit "onload" - I color the states geometry and dynamically
> create the circles using .createElementNS()
> 
> But I don't have the impression that it is the problem of "onload" or starting
> the javascript engine, since the delay is always, no matter how long I wait
> until I start mouse-over the states geometry. 

    It is the building of the sensitive regions.  I have a quick fix that
uses a faster computation of the 'sensitive' bounding boxes and then when
the BBox is penetrated the true sensitive region is computed.  This eliminates
the initial 'pause' - however some of the states take over 400ms to generate
the sensitive region (Texas in particular).  This is because we do actually
do a geometric union of the fill/stroke (and markers) to get this region*.

    I will try and deliver the code tonight.

[*]   There may be ways to get the same effect for less cost, but it's
tricky with markers and winding-rule considerations.


> At this time "onload" is executed
> already long ago and the js-engine should have been started. If you would wait 5
>  minutes after onload the effect still appears.
> 
> It must be something different ... once the first mouse-over event occured it is
> much more responsive!
> 
> Andreas
> 
> 
> --     
> The only thing that stands between a man and what he wants from
> life is often merely the will to try it and the faith to believe
> that it is possible ...
> -- M. DeVos
>     
> ----------------------------------------------     
> Andreas Neumann - Department of Cartography     
> Swiss Federal Institute of Technology (ETH)     
> ETH Hoenggerberg, CH-8093  Zurich, Switzerland     
> Phone: ++41-1-633 3031, Fax: ++41-1-633 1153     
> e-mail: neumann@karto.baug.ethz.ch     
> www: http://www.karto.ethz.ch/neumann/     
> SVG.Open/Carto.net: http://www.svgopen.org/     
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: delayed mouse-over effect for first time of mouse-over

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
>     There is a similar delay.  I don't really know what it
> is, I suspect it is the JavaScript interpreter really
> getting up and running. It might also be the building of
> 'sensitivity' regions. Do you run much code 'onload'?

yes - I run quite a bit "onload" - I color the states geometry and dynamically
create the circles using .createElementNS()

But I don't have the impression that it is the problem of "onload" or starting
the javascript engine, since the delay is always, no matter how long I wait
until I start mouse-over the states geometry. At this time "onload" is executed
already long ago and the js-engine should have been started. If you would wait 5
 minutes after onload the effect still appears.

It must be something different ... once the first mouse-over event occured it is
much more responsive!

Andreas


--     
The only thing that stands between a man and what he wants from
life is often merely the will to try it and the faith to believe
that it is possible ...
-- M. DeVos
    
----------------------------------------------     
Andreas Neumann - Department of Cartography     
Swiss Federal Institute of Technology (ETH)     
ETH Hoenggerberg, CH-8093  Zurich, Switzerland     
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153     
e-mail: neumann@karto.baug.ethz.ch     
www: http://www.karto.ethz.ch/neumann/     
SVG.Open/Carto.net: http://www.svgopen.org/     

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: delayed mouse-over effect for first time of mouse-over

Posted by Thomas DeWeese <Th...@Kodak.com>.
Andreas Neumann wrote:

> still refering to http://www.carto.net/geog234/lab3/lab3_end.svg
> 
> I notice that for the first mouse-over effect in the above 
> example, it takes very long, until the first mouse-over event 
> reacts. On my pretty new MacOSX G4 laptop it takes initally 
> 3-4 seconds until the first of the mouse-events occurs
> - later it takes less than a second until the other 
> mouseover-events react.
> 
> Again, I currently don't have a PC with Windows/Linux to test 
> for seeing the difference.

    There is a similar delay.  I don't really know what it
is, I suspect it is the JavaScript interpreter really
getting up and running. It might also be the building of
'sensitivity' regions. Do you run much code 'onload'?




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org