Silverlight ExCanvas

57 views
Skip to first unread message

Nicolas Garcia Belmonte

unread,
May 11, 2009, 7:49:15 AM5/11/09
to google-excanvas
Hi,

First of all, thanks very much for this library. I've been using it
with an InfoVis library I'm coding (at http://thejit.org) and it works
great.

I'd like to know more about the excanvas silverlight project:


- Do you know what are the main API/usage differences between this
library and the excanvas (regular) _r3 library?
- Why the silverlight project isn't also hosted at google code?
- Do you know how this library compares in performance with the
"regular" excanvas library?
- At SourceForge: (http://excanvas.svn.sourceforge.net/viewvc/excanvas/
silverlight/excanvas.js?view=log) the project seems abandoned (last
commit was 14 moths ago). Is that so? am I missing something?

Any other information you could give me about this project would be
really great.

Thanks for putting so much effort in this library.

Fabien Ménager

unread,
May 11, 2009, 8:04:56 AM5/11/09
to google-excanvas
Hello,
- I think the differences are the ones indicated at the beginning of
the file :
* Doing a transformation during a path (ie lineTo, transform, lineTo)
will
not work corerctly because the transform is done to the whole path
(ie
transform, lineTo, lineTo)
* Patterns are not yet implemented.
The text methods have been added in the VML version too, but it not
present in both the Silverlight version and r3.
- It is http://code.google.com/p/explorercanvas/source/browse/trunk/silverlight/excanvas.js
- It performs better, but I think there are a few problems with
gradients, and it lacks the features mentioned at the first point.
- It is not abandoned, but the main developers wanted to merge it into
a single file, to be easier to maintain and to use.

Erik or Emil could tell you more than I did.
For all these reasons, I recommend you to use the VML (standard)
version of the lib.

Fabien

On 11 mai, 13:49, Nicolas Garcia Belmonte <phil...@gmail.com> wrote:
> Hi,
>
> First of all, thanks very much for this library. I've been using it
> with an InfoVis library I'm coding (athttp://thejit.org) and it works

Erik Arvidsson

unread,
May 11, 2009, 11:20:55 AM5/11/09
to google-...@googlegroups.com
It is not abandoned. We moved the hosting from sourceforge to google
code and we have the entire revision history at google code.

The main issue with the silverlight implementation is probably the
lack of events and integration with the rest of your page.

The plan is to merge the VML and the Silverlight version into one file
and have some compile time constants for people that do not want one
ore the other.

The path bug Fabien mentioned can be fixed. I was just too lazy when I
did the initial version.
--
erik

Ryan Schmidt

unread,
May 19, 2009, 6:53:26 AM5/19/09
to google-...@googlegroups.com

On May 11, 2009, at 10:20, Erik Arvidsson wrote:

> The main issue with the silverlight implementation is probably the
> lack of events and integration with the rest of your page.

Could you elaborate on what you mean by these two points? I didn't
see anything about that in the headers of the excanvas.js files. Are
there tickets filed about these issues that I could look at for more
info?


> The plan is to merge the VML and the Silverlight version into one file
> and have some compile time constants for people that do not want one
> ore the other.

For my project, which uses ExplorerCanvas, I had planned to use
Microsoft's silverlight.js script to detect whether Silverlight was
present, and, based on that, load either the VML or Silverlight
version of excanvas.js, because while the Silverlight version fixes
two issues I have with the VML version, I don't want to require users
to install Silverlight.

http://code.google.com/p/canviz/issues/detail?id=43

But based on your above comment, the VML and Silverlight versions of
excanvas.js will be merged into a single script, which sounds like a
great idea to me. Should I assume that there still will be a
mechanism to select whether one wants the VML or Silverlight
implementation? Will you be including code to detect whether
Silverlight is installed and auto-select the best version of
ExCanvas, or would that still be up to my project to implement? Do
you need any help with combining the two versions, or are there still
other tasks you want to finish before combining them?

Erik Arvidsson

unread,
May 19, 2009, 11:46:08 AM5/19/09
to google-...@googlegroups.com
On Tue, May 19, 2009 at 03:53, Ryan Schmidt <googl...@ryandesign.com> wrote:
>
>
> On May 11, 2009, at 10:20, Erik Arvidsson wrote:
>
>> The main issue with the silverlight implementation is probably the
>> lack of events and integration with the rest of your page.
>
> Could you elaborate on what you mean by these two points? I didn't
> see anything about that in the headers of the excanvas.js files. Are
> there tickets filed about these issues that I could look at for more
> info?

Events

SilverLight is a plugin and therefore it is a black box where events
inside the plugin are not exposed to the outside of the plugin. I
think the simplest way to describe this is with an example. Assume
that you add a listener to the click event on the canvas element, or
any of the ancestors of the canvas element. When the user clicks on
the canvas the listener is supposed to be called.

To solve that we should listen to "all" events inside SilverLight and
redispatch them on the canvas element (I'll file a bug).

Integration:

Once again the ugly nature of plugins is raising its head. Since
SilverLight is a plugin you cannot apply CSS layering and effects to
it. For example the -ms-filter CSS property will not work on it and
things like displaying other content on top of it is is troublesome.
There are also issues with focus.

There are things we can do to make it less ugly. We can use a
windowless plugin and we can make I think that setting tabIndex to -1
might work but it might also require other hacks to prevent focus from
getting stuck in the plugin.

>> The plan is to merge the VML and the Silverlight version into one file
>> and have some compile time constants for people that do not want one
>> ore the other.
>
> For my project, which uses ExplorerCanvas, I had planned to use
> Microsoft's silverlight.js script to detect whether Silverlight was
> present, and, based on that, load either the VML or Silverlight
> version of excanvas.js, because while the Silverlight version fixes
> two issues I have with the VML version, I don't want to require users
> to install Silverlight.
>
> http://code.google.com/p/canviz/issues/detail?id=43
>
> But based on your above comment, the VML and Silverlight versions of
> excanvas.js will be merged into a single script, which sounds like a
> great idea to me. Should I assume that there still will be a
> mechanism to select whether one wants the VML or Silverlight
> implementation? Will you be including code to detect whether
> Silverlight is installed and auto-select the best version of
> ExCanvas, or would that still be up to my project to implement? Do
> you need any help with combining the two versions, or are there still
> other tasks you want to finish before combining them?

The goal is to detect SilverLight and use that if available. I
recommend you to not use the silverlight.js file provided by
Microsoft. It is bloated as hell and you only need a few lines (not
thousand) to get SilverLight working in IE.

We also want to have 3 "compilation" targets. SilverLight+VML, VML and
SilverLight. The code will contain both SilverLight and VML but
wrapped in constant if statements so we can preprocess the code to
generate versions with VML and SilverLight respectively.

Before merging the files I think we should at least solve the event
issue in the SilverLight version. Once that is done we can go ahead
and create a branch and work on the branch for a while.

--
erik

Reply all
Reply to author
Forward
0 new messages