[flexcoders] Re: Degrafa to FXG - Clicking Paths?

2010-03-30 Thread charlie.szymanski


Never did get a reply to this.

My final solution was to make the parts of Degrafa that I needed work in Flex 
4. It seems that the Graphics UIComponent sometimes goes nuts if you have too 
many of them (as in, if I put 400-500 congressional districts on the map, only 
about a sixth actually appear, and it dies of slowness, and clicking doesn't 
work properly in any way at all, and in a simple US map a couple of states go 
missing). A bunch of Paths will draw themselves fine, but since it's not a real 
component (it just draws itself in whatever its parent is I think), you can't 
interact with a specific path, just the thing it has been drawn on. So that's 
not really workable for what I'm trying to do.

I could just be doing it all wrong, but it was easier to just fix some Degrafa 
stuff.

I also noticed that the QuietlyScheming Landscape Zoomer doesn't appear to work 
in Flex 4. Rather than figure that out, I tried to create an approximation. 
Thought I'd share it:

http://charlieszymanski.com/flex/Landscape.txt

Hope it helps someone out.

CS



--- In flexcoders@yahoogroups.com, charlie.szymanski char...@... wrote:

 Okay, rather than try to explain this crazily, here's a visual example of 
 something I've done:
 
 http://www.nationaljournal.com/njonline/hc_20100322_8844.php
 
 The graphic loads an SVG file and parses it into Degrafa GeometryGroups (I 
 basically followed their map example here: 
 http://www.degrafa.org/source/DegrafaMapSample/DegrafaMapDemo.html, but made 
 an empty Geography class so I could fill it with path and other data and 
 get it out later). It pushes each GeomtryGroup into a Surface. The Surface 
 listens for a click event, and finds out what GeometryGroup was clicked on 
 using the event.target. The whole thing is wrapped in QuietlyScheming's 
 Landscape component so it can zoom in on the clicked GeometryGroup. 
 
 Trying to port this to Flex 4 / FXG has proven difficult. The only way I can 
 get the SVG to display correctly is to turn my GeometryGroups into Paths 
 (making them Graphics causes layout chaos) and shove them into a single 
 Graphic instance. The problem is that the Paths don't dispatch any events 
 (can't listen for a click, rollover, anything). And as far as I know, there's 
 no way to figure out which Path was clicked on if you're listening to the 
 Graphic instance.
 
 Am I missing something obvious? Does anyone have an idea how I should be 
 thinking about porting this over? Am I doing it wrong entirely? I haven't 
 spent too long on it, but it's proven to be frustrating (Would I be better 
 off fiddling with the Degrafa source to get it to compile under Flex 4?)
 
 Any suggestions welcome.
 
 Charlie





[flexcoders] Degrafa to FXG - Clicking Paths?

2010-03-24 Thread charlie.szymanski
Okay, rather than try to explain this crazily, here's a visual example of 
something I've done:

http://www.nationaljournal.com/njonline/hc_20100322_8844.php

The graphic loads an SVG file and parses it into Degrafa GeometryGroups (I 
basically followed their map example here: 
http://www.degrafa.org/source/DegrafaMapSample/DegrafaMapDemo.html, but made an 
empty Geography class so I could fill it with path and other data and get it 
out later). It pushes each GeomtryGroup into a Surface. The Surface listens for 
a click event, and finds out what GeometryGroup was clicked on using the 
event.target. The whole thing is wrapped in QuietlyScheming's Landscape 
component so it can zoom in on the clicked GeometryGroup. 

Trying to port this to Flex 4 / FXG has proven difficult. The only way I can 
get the SVG to display correctly is to turn my GeometryGroups into Paths 
(making them Graphics causes layout chaos) and shove them into a single Graphic 
instance. The problem is that the Paths don't dispatch any events (can't listen 
for a click, rollover, anything). And as far as I know, there's no way to 
figure out which Path was clicked on if you're listening to the Graphic 
instance.

Am I missing something obvious? Does anyone have an idea how I should be 
thinking about porting this over? Am I doing it wrong entirely? I haven't spent 
too long on it, but it's proven to be frustrating (Would I be better off 
fiddling with the Degrafa source to get it to compile under Flex 4?)

Any suggestions welcome.

Charlie 



[flexcoders] Charting Wildly Varying Numbers in Flex

2007-05-14 Thread charlie.szymanski
I have an interesting issue with a mini charting application I am
trying to create.

You can see my current attempt here:
http://ibiseye.com/?stormID=AT200403active=1season=2004wind=145name=Charleyzoom=5lat=26.3lng=-71.050001

and click Charley Synopsis

Basically, we are using hurricane wind-fields and a giant database of
all the property parcels in the state of Florida to calculate how much
property value was at risk during a given hurricane (this is live
during the season if a storm is forecasted or does go over Florida).

The problem is that the numbers are exceptionally varying in range. If
you look at the bars on that Flex Chart you'll notice we are using the
Logarithmic scale . The reason we had to do this is that the all
data (or even the data within the different categories if the 'all'
data is removed) is usually hugely different in value. This difference
is exasperated by differences in property types. What happens is you
end up with a chart where the bars are barely visible for a number of
the property types (which are even less visible if the chart is not
scaled logarithmically for the all category).

If you mouse over the current chart values, you'll get the actual
dollar value of each bar. It's easy to see (especially in the
Residential type) just how misleading the chart could be. They look
almost the same, but the blue bar is actually 5x greater than the red one.

Has anyone run into this issue before and do you all have any good
ideas of how to get around it? Right now I'm not really even looking
for code, but more of any creative solutions to displaying that
information in a way that isn't misleading (which the current scale
may be -- you have to remember how many old people live in Florida).

Thanks for any insight,

Charlie