gmmoraesbr / flot

Automatically exported from code.google.com/p/flot
0 stars 0 forks source link

Patch to work with FlashCanvas library (Flash back-end) #368

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
FlashCanvas (http://code.google.com/p/flashcanvas/) is a canvas emulation 
library similar to ExplorerCanvas; it uses Flash as a back-end while 
ExplorerCanvas uses VML. Although it has APIs compatible with ExplorerCanvas, 
the current version of flot does not work with FlashCanvas.

So, I created a patch that enables flot to work with either emulation library. 
This patch is against SVN r259.

This patch modifies the timing of when G_vmlCanvasManager.initElement() is 
called. The current version of flot calls initElement() just after a Canvas 
element is created. But in order to embed Flash, we should call initElement() 
after appending the Canvas element to DOM.

Here's a demo of FlashCanvas. This demo uses patched flot 0.6.

http://flashcanvas.net/examples/people.iola.dk/olau/flot/examples/

Original issue reported on code.google.com by revu...@gmail.com on 23 Jun 2010 at 8:09

Attachments:

GoogleCodeExporter commented 8 years ago
Hm, interesting! It seems to work pretty well.

I'll have a look at this when I get a bit more time. I should add something to 
the documentation too, I think, excanvas has some annoying bugs.

Original comment by olau%iol...@gtempaccount.com on 16 Aug 2010 at 9:44

GoogleCodeExporter commented 8 years ago
Thanks, I'm trying this out as well.  

The difference is quite noticeable with complex charts.  It cut down the 
rendering time for one of my pages from ~10 seconds to ~5.  

Not only that, but afterwards the page is more responsive in general.  It seems 
like the usage of VML bogs down IE, making all user interaction more slow and 
choppy, including DOM changes and even scrolling.

ExplorerCanvas appears to outperform it for very simple charts, though.  For my 
project, I may try a combination - excanvas when showing few, simple charts, 
and flashcanvas when showing complex or many charts.  

Original comment by michael.hixson@gmail.com on 21 Aug 2010 at 2:13

GoogleCodeExporter commented 8 years ago
I recently added some modifications to FlashCanvas library so that we could 
call G_vmlCanvasManager.initElement() method before appendChild():
http://code.google.com/p/flashcanvas/source/detaiyl?r=110

That means flot now works with FlashCanvas library without any patch if you use 
the latest trunk version of FlashCanvas.

But it is still preferable to apply this patch. Because the modification in 
FlashCanvas is a quick-fix solution, some features, such as resizing a canvas, 
will not work without this patch.

Original comment by revu...@gmail.com on 21 Aug 2010 at 8:09

GoogleCodeExporter commented 8 years ago
Okay, thanks for the update!

I've committed a patch now for appending before initing. I wish the excanvas 
API was less silly.

I've also mentioned Flashcanvas in the README. I was thinking about moving the 
examples to Flashcanvas, but the general Flash crank up time and perhaps also 
your license split has made me recommend people try it for big charts instead 
for now. If my recommendation can give you a couple of customers and save me 
some head aches, that would be great. :)

Original comment by olau%iol...@gtempaccount.com on 14 Dec 2010 at 5:44