Update to IE support - protovis+SVGWeb

134 views
Skip to first unread message

Jamie Love

unread,
Jul 13, 2010, 5:26:23 PM7/13/10
to prot...@googlegroups.com
Hi all,

I've updated protovis+SVGWeb (IE support) - available here:

http://gitorious.org/~jlove/protovis/jloves-protovis

It now uses the latests SVGWeb, which now requires Flash 10. It also
includes support for rotated text (!) and fixes the issues with
wedges.

I ran through the examples, seeing which ones worked (IE):

antibiotics: Ok
antibiotics-scatter: Ok
barley: Ok
cars: Ok
Clock: Ok
Crimea: Ok
Flowers: Ok
group-stack: Ok
Hotel: Ok
Jobs: Ok (better than before - used to go over top border)
Nba: Ok
Sankey: Ok,
Slider: Ok, though flickers
Tipsey: Ok
Wheat: Ok, though without italicised text.


This is excellent news - and while I'd like to take credit for working
long and hard on this - I can't, it is just the improvements in SVGWeb
and Flash 10.1.


Note that while rotated text works, the quality of the text leaves
something to be desired - so if you're looking to use it, be prepared
to tweak a bit to get it looking good.

--
Jamie Love
Looking for custom software development? Contact us at www.nsquaredsoftware.com.

Mike Bostock

unread,
Jul 13, 2010, 5:29:15 PM7/13/10
to prot...@googlegroups.com
Nice work, Jamie. Thanks for the update!

Mike

Pedro Alves

unread,
Jul 23, 2010, 9:48:28 PM7/23/10
to prot...@googlegroups.com, Jamie Love

On 10/07/13 22:26, Jamie Love wrote:
> This is excellent news - and while I'd like to take credit for working
> long and hard on this - I can't, it is just the improvements in SVGWeb
> and Flash 10.1.


Bah! My credits are all to you :D


Excellent news!!!


-pedro

Message has been deleted
Message has been deleted

marco

unread,
Aug 20, 2010, 5:23:32 AM8/20/10
to protovis
Hi i'm using the parallel coordinates plot (cars example) with some
modifications and running pretty well on chrome and FF (with the
library protovis protovis-d3.2.js that there's on the main page of
the
site).
Unfortunately i need it working also on IE (6 and 8) but i can't make
it working. I tried to download the files from "http://gitorious.org/
~jlove/protovis/jloves-protovis" (i also tried to recompile it) but
when i try to use protovis-d3.3.js i get the error "Object doesn't
support this property or method (line379)(protovis-d3.3.js)".
I tried with some examples too (running from a server) but i can see
just a blank page. I tried to use a previous library (another d3.2)
and with that i can run it....
What am i doing wrong? (below there's the page with the car example
that i'm running)
<html>
<head>
<title>Cars</title>
<script type="text/javascript" src="svg.js" data-path="."></
script>
<meta name="svg.render.forceflash" content="true">
<script type="text/javascript" src="protovis-d3.3.js"></script>
<script type="text/javascript" src="cars.js"></script>
<style type="text/css">
#fig {
width: 880px;
height: 460px;
}

#title {
position: absolute;
top: 70px;
left: 200px;
padding: 10px;
background: white;
}

large {
font-size: medium;
}

</style>
</head>
<body><div id="center"><div id="fig">
<script type="text/javascript+protovis">
var dims = [
"cylinders",
"displacement",
"weight",
"horsepower",
"acceleration",
"mpg",
"year",
"origin"
];
/* Sizing and scales. */
var w = 840,
h = 420,
color = pv.Colors.category10(),
x = pv.Scale.ordinal(dims).splitFlush(0, w),
y = pv.dict(dims, function(t) {pv.Scale.linear()
.domain(cars.filter(function(d) {return !isNaN(d[t]);}),
function(d) {return d[t];})
.range(0, h);});
/* The root panel. */
var vis = new pv.Panel()
.width(w)
.height(h)
.margin(20)
.bottom(40);
/* Rule and labels per dimension. */
var rule = vis.add(pv.Rule)
.data(dims)
.left(x)
.strokeStyle(color.by(pv.index))
.lineWidth(2);
rule.anchor("top").add(pv.Label)
.text(function(t) {return y[t].domain()[0];});
rule.anchor("bottom").add(pv.Label)
.text(function(t) {return y[t].domain()[1];});
rule.anchor("bottom").add(pv.Label)
.textStyle(function() {return color(this.index).darker();})
.textMargin(14);
/* Parallel coordinates. */
vis.add(pv.Panel)
.data(cars)
.add(pv.Line)
.data(dims)
.left(function(t, d) {return x(t);})
.bottom(function(t, d) {return y[t](d[t]);})
.strokeStyle("rgba(0, 0, 0, .2)")
.lineWidth(1);
vis.render();
</script>
</div></div></body>
</html>

On 13 Lug, 23:26, Jamie Love <drjl...@gmail.com> wrote:
> Hi all,
>
> I've updated protovis+SVGWeb (IEsupport) - available here:

Jamie Love

unread,
Aug 20, 2010, 5:41:36 AM8/20/10
to prot...@googlegroups.com
Hi there,

I've just tested with IE8, and your example shows up well under IE8 in
my test system here.

Here are some things to try:

1/ I believe that IE 64-bit doesn't work.
2/ Ensure that svg.swf and svg.js are in the same directory as the
html file (given your setup in the example you provide).
3/ Ensure you access the html file through a web server, and not
through opening the file directly.

Can you try a simpler example (e.g. one of the tests in the
jloves-protovis/tests/ directory) and see if they run - the
jloves-protovis/tests/mark/area.html one is easy and should run.

Note that IE6 may not work. I have not tested the svgweb integration under IE6.

Jamie

On Fri, Aug 20, 2010 at 7:14 PM, marco <piov...@esteco.com> wrote:
> Hi i'm using the parallel coordinates plot (cars example) with some
> modifications and running pretty well on chrome and FF (with the
> library protovis protovis-d3.2.js that there's on the main page of the
> site).
> Unfortunately i need it working also on IE (6 and 8) but i can't make
> it working. I tried to download the files from "http://gitorious.org/
> ~jlove/protovis/jloves-protovis" (i also tried to recompile it) but
> when i try to use protovis-d3.3.js i get the error "Object doesn't
> support this property or method (line379)(protovis-d3.3.js)".
> I tried with some examples too (running from a server) but i can see
> just a blank page. I tried to use a previous library (another d3.2)

> and with that i can run the example area chart (but not the car one).


> What am i doing wrong? (below there's the page with the car example
> that i'm running)
>

[snip]

marco

unread,
Aug 20, 2010, 6:34:46 AM8/20/10
to protovis
this is super-weird... The svg.swf and svg.js are in the same
directory as the html file (with svg.htc too), i'm using a web server
and i tried with a IE 32bit (i was using 64) but the graph is not
showing up. I tried with the "area.html" example as you suggested but
nothing also with that one, no errors but blank page... i'm kinda
lost..

Btw, the example "area.html" is using protovis-d3.2.js ....

On 20 Ago, 11:41, Jamie Love <drjl...@gmail.com> wrote:
> Hi there,
>
> I've just tested with IE8, and your example shows up well under IE8 in
> my test system here.
>
> Here are some things to try:
>
> 1/ I believe thatIE64-bit doesn't work.
> 2/ Ensure that svg.swf and svg.js are in the same directory as the
> html file (given your setup in the example you provide).
> 3/ Ensure you access the html file through a web server, and not
> through opening the file directly.
>
> Can you try a simpler example (e.g. one of the tests in the
> jloves-protovis/tests/  directory) and see if they run - the
> jloves-protovis/tests/mark/area.html one is easy and should run.
>
> Note that IE6 may not work. I have not tested the svgweb integration under IE6.
>
> Jamie
>
>
>
>
>
> On Fri, Aug 20, 2010 at 7:14 PM, marco <pioves...@esteco.com> wrote:
> > Hi i'm using the parallel coordinates plot (cars example) with some
> > modifications and running pretty well on chrome and FF (with the
> > library protovis protovis-d3.2.js that there's on the main page of the
> > site).
> > Unfortunately i need it working also onIE(6 and 8) but i can't make

Jamie Love

unread,
Aug 20, 2010, 6:49:37 AM8/20/10
to prot...@googlegroups.com
IE8 has some decent developer tools - pressing F12 should show them
up. Does the IE8 console show anything in particular?
I presume you tried the area.html example after changing the link to
protovis-d3.3.js?

> --
> You received this message because you are subscribed to the Google Groups "protovis" group.
> To post to this group, send email to prot...@googlegroups.com.
> To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Rick Otten

unread,
Aug 20, 2010, 7:12:00 AM8/20/10
to prot...@googlegroups.com
Could it be your flash version?

I know that most of Jamie's examples don't work with IE7 and the flash
version I am _stuck_ with at work. I don't have the option of
experimenting with other versions to see if it makes a difference.

(I don't run Windows at home.)

> this is super-weird... The svg.swf and svg.js are in the same
> directory as the html file (with svg.htc too), i'm using a web server
> and i tried with a IE 32bit (i was using 64) but the graph is not
> showing up. I tried with the "area.html" example as you suggested but
> nothing also with that one, no errors but blank page... i'm kinda
> lost..
>
> Btw, the example "area.html" is using protovis-d3.2.js ....
>

--
Rick Otten
rot...@windfish.net
O=='=+


marco

unread,
Aug 20, 2010, 8:14:36 AM8/20/10
to protovis
jamie: i didn't know that IE has a developer tool (good to know)... I
did try the area example changing the library
from 3.2 to 3.3 and what i get is the same error "property or method
not supported by the object (protovis-d3.3.js, line 370 character
9)" :(

rick: i'm using the latest flash version but i don't think is that...
i can run the cars example using protovis-d3.2.js and with the script
below i'm checking that SVG is loaded without problems before doing
anything else:

<script type="text/javascript">
window.onload = function() {
var svg = document.createElementNS(svgns, 'svg');
svg.setAttribute('width', '300');
svg.setAttribute('height', '300');

svg.addEventListener('SVGLoad', function(evt) {
alert('loaded!');
}, false);
svgweb.appendChild(svg, document.body);
}
</script>

On 20 Ago, 13:12, "Rick Otten" <rot...@windfish.net> wrote:
> Could it be your flash version?
>
> I know that most of Jamie's examples don't work with IE7 and the flash
> version I am _stuck_ with at work.  I don't have the option of
> experimenting with other versions to see if it makes a difference.
>
> (I don't run Windows at home.)
>
> > this is super-weird... The svg.swf and svg.js are in the same
> > directory as the html file (with svg.htc too), i'm using a web server
> > and i tried with aIE32bit (i was using 64) but the graph is not

Jason Davies

unread,
Aug 20, 2010, 8:26:55 AM8/20/10
to prot...@googlegroups.com
Looking at line 370 of Jamie's protovis-d3.3.js, could it be due to IE not supporting window.addEventListener?

See https://developer.mozilla.org/en/DOM/element.addEventListener#Internet_Explorer for the alternative, using window.attachEvent.

--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protovis?hl=en.


--
Jason Davies


Jason Davies

unread,
Aug 20, 2010, 8:29:12 AM8/20/10
to prot...@googlegroups.com
You'll want to replace line 370, which is currently:

window.addEventListener( "SVGLoad", listener, false );

with something like:

if ( document.addEventListener ) {
    window.addEventListener( "SVGLoad", listener, false );
} else if ( document.attachEvent ) {
    window.attachEvent( "SVGLoad", listener);

marco

unread,
Aug 20, 2010, 9:12:36 AM8/20/10
to protovis
thumb up for you jason, i'm still having a blank page but at least
there's no more the error at line 370...

On 20 Ago, 14:29, Jason Davies <ja...@jasondavies.com> wrote:
> You'll want to replace line 370, which is currently:
>
> window.addEventListener( "SVGLoad", listener, false );
>
> with something like:
>
> if ( document.addEventListener ) {
>     window.addEventListener( "SVGLoad", listener, false );} else if ( document.attachEvent ) {
>
>     window.attachEvent( "SVGLoad", listener);
>
> }
>
> On 20 Aug 2010, at 13:26, Jason Davies wrote:
>
>
>
>
>
> > Looking at line 370 of Jamie's protovis-d3.3.js, could it be due to IE not supporting window.addEventListener?
>
> > Seehttps://developer.mozilla.org/en/DOM/element.addEventListener#Interne...for the alternative, using window.attachEvent.
> >> For more options, visit this group athttp://groups.google.com/group/protovis?hl=en.
>
> > --
> > Jason Davies
>
> >www.jasondavies.com
>
> > --
> > You received this message because you are subscribed to the Google Groups "protovis" group.
> > To post to this group, send email to prot...@googlegroups.com.
> > To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/protovis?hl=en.
>
> --
> Jason Davies
>
> www.jasondavies.com
Message has been deleted

marco

unread,
Aug 20, 2010, 11:27:25 AM8/20/10
to protovis
I know i'm asking maybe too much but i have a million dollar question
now:
in the original "cars" example there's the line:

.visible(function(d) {return dims.every(function(t){return (d[t] >=
filter[t].min) && (d[t] <= filter[t].max);});})

is used to draw just the lines with values (d[t]) that are all into
the domain (filter[t].min, filter[t].max).

NOW THE QUESTION: i can run the cars example on IE6 and IE8 using the
library protovis-d3.2 made for IE and specifying the script type="text/
javascript+protovis". The problem is that if i try to use the function
"every" the browser shows a blank page without errors. If i take it
out (doing something like ".visible(true)") the graph is visible.
Is that because "every" is a javascript function and i'm using
"javascript+protovis" as script type (the system tries to find the
definition of the function in the protovis library but not in the
javascript one)?
I tried also to write " .visible(Array.every(function(d){....})" but
is not working either... any suggestions?


On 20 Ago, 15:12, marco <pioves...@esteco.com> wrote:
> thumb up for you jason, i'm still having a blank page but at least
> there's no more the error at line 370...
>
> On 20 Ago, 14:29, Jason Davies <ja...@jasondavies.com> wrote:
>
>
>
> > You'll want to replace line 370, which is currently:
>
> > window.addEventListener( "SVGLoad", listener, false );
>
> > with something like:
>
> > if ( document.addEventListener ) {
> >     window.addEventListener( "SVGLoad", listener, false );} else if ( document.attachEvent ) {
>
> >     window.attachEvent( "SVGLoad", listener);
>
> > }
>
> > On 20 Aug 2010, at 13:26, Jason Davies wrote:
>
> > > Looking at line 370 of Jamie's protovis-d3.3.js, could it be due toIEnot supporting window.addEventListener?
>
> > > Seehttps://developer.mozilla.org/en/DOM/element.addEventListener#Interne...the alternative, using window.attachEvent.
>
> > > On 20 Aug 2010, at 13:14, marco wrote:
>
> > >> jamie: i didn't know thatIEhas a developer tool (good to know)... I

Jamie Love

unread,
Aug 20, 2010, 7:27:05 PM8/20/10
to prot...@googlegroups.com
Hi Rick,

What version of flash are you needing to use?

The latest version of SVGWeb is flash 10, but an earlier one uses
flash 9 - the commit you'd want is this:

http://gitorious.org/~jlove/protovis/jloves-protovis/commit/45e2984421b64d822a554eab5b201405ffc61f54

> --
> You received this message because you are subscribed to the Google Groups "protovis" group.
> To post to this group, send email to prot...@googlegroups.com.
> To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/protovis?hl=en.
>
>

--

Jamie Love

unread,
Aug 20, 2010, 7:42:44 PM8/20/10
to prot...@googlegroups.com
Thanks Jason,

I've fixed this and pushed the fix to gitorious.

--

Jamie Love

unread,
Aug 20, 2010, 7:48:16 PM8/20/10
to prot...@googlegroups.com
Hi there,

So it's now working in IE? great!

The 'every' function call is quite possibly something that isn't
supported by all browsers - I don't know why it might work when using
javascript+protovis - that shouldn't matter.

The easiest way to make it work is to add the following code into your
file prior to the graph code:

if (!Array.prototype.every)
{
Array.prototype.every = function(fun /*, thisp*/)
{
var len = this.length;
if (typeof fun != "function")
throw new TypeError();

var thisp = arguments[1];
for (var i = 0; i < len; i++)
{
if (i in this &&
!fun.call(thisp, this[i], i, this))
return false;
}

return true;
};
}


(from http://www.tutorialspoint.com/javascript/array_every.htm)

On Sat, Aug 21, 2010 at 3:15 AM, marco <piov...@esteco.com> wrote:
> I know... i'm probably asking too much but i have a million dollar
> question now:
> i can run the cars example on IE6 and IE8 using the protovis-d3.2.js
> library for IE and specifying the script type="text/javascript
> +protovis".
> As you probably all know for the "line" object there's a parameter
> called "visible", setting that with a function let us show or not some
> of the lines. In the original cars example there's the line:


>
> .visible(function(d) {return dims.every(function(t){return (d[t] >=
> filter[t].min) && (d[t] <= filter[t].max);});})
>

> this is used to draw just the lines with values (d[t]) that are into


> the domain (filter[t].min, filter[t].max)
>

> NOW THE PROBLEM: With the mentioned d3.2 version of the library when i
> use "dims.every" the result is a blank page without any error... Is
> that because "every" is a javascript function and i'm using the script
> type "javascript+protovis" (the system tries to find it in the
> protovis library only and not in the javascript one)?
> I tried to write Array.every(dims, (function(d){......}) but is not
> working either.... any suggestions?


>
>
> On 20 Ago, 15:12, marco <pioves...@esteco.com> wrote:

>> thumb up for you jason, i'm still having a blank page but at least
>> there's no more the error at line 370...
>>
>> On 20 Ago, 14:29, Jason Davies <ja...@jasondavies.com> wrote:
>>
>>
>>
>> > You'll want to replace line 370, which is currently:
>>
>> > window.addEventListener( "SVGLoad", listener, false );
>>
>> > with something like:
>>
>> > if ( document.addEventListener ) {
>> >     window.addEventListener( "SVGLoad", listener, false );} else if ( document.attachEvent ) {
>>
>> >     window.attachEvent( "SVGLoad", listener);
>>
>> > }
>>
>> > On 20 Aug 2010, at 13:26, Jason Davies wrote:
>>

>> > > Looking at line 370 of Jamie's protovis-d3.3.js, could it be due toIEnot supporting window.addEventListener?
>>

>> > > Seehttps://developer.mozilla.org/en/DOM/element.addEventListener#Interne...the alternative, using window.attachEvent.


>>
>> > > On 20 Aug 2010, at 13:14, marco wrote:
>>

>> > >> jamie: i didn't know thatIEhas a developer tool (good to know)... I

--

marco

unread,
Aug 23, 2010, 3:21:48 AM8/23/10
to protovis
jamie, the graph is working with IE6 and IE8 (i dunno 7) but only with
protovis-d3.2, at least in my computer... when i try to use 3.3 i get
only a blank page without any error.
Anyway with 3.2 there are some problems with the properties: margin,
event("all"), color and pv.Behavior (zoom, pan and point). Are these
things working on 3.3? any suggestion about what i can try to do to
have 3.3 working?

On 21 Ago, 01:48, Jamie Love <drjl...@gmail.com> wrote:
> Hi there,
>
> So it's now working inIE? great!
>
> The 'every' function call is quite possibly something that isn't
> supported by all browsers -  I don't know why it might work when using
> javascript+protovis  - that shouldn't matter.
>
> The easiest way to make it work is to add the following code into your
> file prior to the graph code:
>
> if (!Array.prototype.every)
> {
>   Array.prototype.every = function(fun /*, thisp*/)
>   {
>     var len = this.length;
>     if (typeof fun != "function")
>       throw new TypeError();
>
>     var thisp = arguments[1];
>     for (var i = 0; i < len; i++)
>     {
>       if (i in this &&
>           !fun.call(thisp, this[i], i, this))
>         return false;
>     }
>
>     return true;
>   };
>
> }
>
> (fromhttp://www.tutorialspoint.com/javascript/array_every.htm)
>
>
>
>
>
> On Sat, Aug 21, 2010 at 3:15 AM, marco <pioves...@esteco.com> wrote:
> > I know... i'm probably asking too much but i have a million dollar
> > question now:
> > i can run the cars example on IE6 and IE8 using the protovis-d3.2.js
> > library forIEand specifying the script type="text/javascript
> >> > > Seehttps://developer.mozilla.org/en/DOM/element.addEventListener#Interne...alternative, using window.attachEvent.
> > For more options, visit this group athttp://groups.google.com/group/protovis?hl=en.

Mike Bostock

unread,
Aug 23, 2010, 11:38:34 AM8/23/10
to prot...@googlegroups.com
3.3 has not yet been released. I should probably move it to a separate branch to avoid confusion.

Mike

Jamie Love

unread,
Aug 23, 2010, 5:34:04 PM8/23/10
to prot...@googlegroups.com

I have kept my clone (jloves-protovis) almost-up-to-date with what's in the original, and I haven't branched either. This means that there is no "official" release for protovis-v3.2 with IE support via SVGWeb from me.

If you branch my git repository now, you get the 3.3 development code, and a newer version of SVGWeb.

If you want the 3.2 release (which has a slightly older version of SVGWeb), you can clone the same repository, and revert back to commit fba9dc272a443cf9fdb984676a7732a6a082f4c0, which should give you 3.2.

Jamie Love

unread,
Aug 23, 2010, 5:36:53 PM8/23/10
to prot...@googlegroups.com
3.2 didn't have the later version of SVGWeb, which had many bug fixes, new feature support and performance improvements.

I can only surmise two possibilities as to why it's not working with 3.3

  - You don't have flash 10
  - Your protovis code is trying to use a method that 3.3 has removed, such as 'size' (which is now shapeSize).

Those things you mention work better on 3.3 (because of the new SVGWeb), but are not perfect. The architecture involved in it means that interaction can be unimpressive.

marco

unread,
Aug 24, 2010, 3:13:26 AM8/24/10
to protovis
Flash is ok, is one of the first things i checked but it can be that
i'm using wrong names for some functions, there's any document about
these changes? because i can't find anything in the repository...

marco

unread,
Aug 24, 2010, 4:16:16 AM8/24/10
to protovis
Has the library protovis-d.3.3 a default path for svg? because i
actually found something strange: with protovis-d3.3 if i change the
source position and the data-path of of the svg lib with one that is
not correct the system doesn't show any log error. If i do that with
protovis-d3.2 i get a log error (as it has to be)... Can that be why i
can't see the graph with 3.3? I'm specifying the svg path before
including protovis-d3.3 and this one somehow override the correct one
with the default one??

Jamie Love

unread,
Aug 24, 2010, 7:05:23 PM8/24/10
to prot...@googlegroups.com
The integration for SVGWeb hasn't changed between protovis 3.2 and 3.3 - so the data path would change.

But, SVGWeb did change, and they did make some changes to how it is loaded, but they shouldn't affect you if you use the latest protovis code. 

Is it possible to zip up the whole example that is failing for you, and email it to me directly? I can then look at it in detail.

--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Jamie Love

unread,
Aug 24, 2010, 7:06:59 PM8/24/10
to prot...@googlegroups.com
On Tue, Aug 24, 2010 at 7:13 PM, marco <piov...@esteco.com> wrote:
Flash is ok, is one of the first things i checked but it can be that
i'm using wrong names for some functions, there's any document about
these changes? because i can't find anything in the repository...


I'm afraid not. The way I found them was just trying my graphs under Chrome and fixing the errors when it complained about functions not existing.

As Mike has mentioned elsewhere - 3.3 is not released so that sort of documentation isn't written yet. 

Jamie Love

unread,
Aug 25, 2010, 5:09:14 AM8/25/10
to prot...@googlegroups.com
Ok, it turns out that SVGWeb, while it says to listen for the SVGLoad event, really doesn't work if you do. This was important in your case because you're using the javascript+protovis simplification.

I've fixed the Gitorious codebase, so feel free to check out the latest update.

Sorry for the bother. I'm sure I tested the approach I used a lot. Maybe it worked in some cases.
Jamie

On Wed, Aug 25, 2010 at 6:55 PM, marco <piov...@esteco.com> wrote:
I sent you the e-mail with the example... thanks a lot for your help..
> > protovis+u...@googlegroups.com<protovis%2Bunsubscribe@googlegroups.c om>

> > .
> > For more options, visit this group at
> >http://groups.google.com/group/protovis?hl=en.
>
> --
> Jamie Love
> Looking for custom software development? Contact us atwww.nsquaredsoftware.com.

marco

unread,
Aug 25, 2010, 8:36:44 AM8/25/10
to protovis
thumb-up, now is working!! thanks..
> > <protovis%2Bunsubscr...@googlegroups.c om>

bartt

unread,
Oct 11, 2010, 1:33:32 PM10/11/10
to protovis
Jamie,

I found that your last commit
(40c6f5ffe4b15a3df4723b1de6a55d8730f44c95) where you tried to simplify
onload handling to not listen for SVGLoad wasn't correct. All the
examples linked from tests/index.html failed to work in IE7&8.

After some digging I came to realize that SVGweb adds addEventListener
to IE. I patched pv-internals to use addEventListener when using
svgweb as the renderer. Now the tests are working. You'll find my
patch over at http://github.com/bartt/protovis/commit/07a35461dee8be57a145c676f183dae94a835034.

Would you be so kind to pull this patch?

Thanks,

Bart Teeuwisse

On Aug 25, 5:36 am, marco <pioves...@esteco.com> wrote:
> thumb-up, now is working!! thanks..
>
> On 25 Ago, 11:09,JamieLove<drjl...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Ok, it turns out that SVGWeb, while it says to listen for the SVGLoad event,
> > really doesn't work if you do. This was important in your case because
> > you're using the javascript+protovis simplification.
>
> > I've fixed the Gitorious codebase, so feel free to check out the latest
> > update.
>
> > Sorry for the bother. I'm sure I tested the approach I used a lot. Maybe it
> > worked in some cases.
> >Jamie
>
> > On Wed, Aug 25, 2010 at 6:55 PM, marco <pioves...@esteco.com> wrote:
> > > I sent you the e-mail with the example... thanks a lot for your help..
>
> > > On 25 Ago, 01:05,JamieLove<drjl...@gmail.com> wrote:
> > > > The integration for SVGWeb hasn't changed between protovis 3.2 and 3.3 -
> > > so
> > > > the data path would change.
>
> > > > But, SVGWeb did change, and they did make some changes to how it is
> > > loaded,
> > > > but they shouldn't affect you if you use the latest protovis code.
>
> > > > Is it possible to zip up the whole example that is failing for you, and
> > > > email it to me directly? I can then look at it in detail.
>
> > > > On Tue, Aug 24, 2010 at 8:16 PM, marco <pioves...@esteco.com> wrote:
> > > > > Has the library protovis-d.3.3 a default path for svg? because i
> > > > > actually found something strange: with protovis-d3.3 if i change the
> > > > > source position and the data-path of of the svg lib with one that is
> > > > > not correct the system doesn't show any log error. If i do that with
> > > > > protovis-d3.2 i get a log error (as it has to be)... Can that be why i
> > > > > can't see the graph with 3.3? I'm specifying the svg path before
> > > > > including protovis-d3.3 and this one somehow override the correct one
> > > > > with the default one??
>
> > > > > On 24 Ago, 09:13, marco <pioves...@esteco.com> wrote:
> > > > > > Flash is ok, is one of the first things i checked but it can be that
> > > > > > i'm using wrong names for some functions, there's any document about
> > > > > > these changes? because i can't find anything in the repository...
>
> > > > > protovis+u...@googlegroups.com<protovis%2Bunsubscr...@googlegroups.c om>

Jamie Love

unread,
Oct 11, 2010, 9:34:31 PM10/11/10
to prot...@googlegroups.com
Right, that's putting it back to what I had before.

I've reverted the commit, back to what it was, just as you have.  I haven't been able to test this (I'm travelling).

I'm not sure why I committed it, if it does fail so obviously - I'm sure I tested it at the them. Maybe I tested the wrong thing.

Jamie

To unsubscribe from this group, send email to protovis+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Jan van Gemert

unread,
Oct 12, 2010, 1:46:07 PM10/12/10
to protovis
Hi Jamie,

Sorry to bother you while traveling, but i've just started looking
into this, and downloaded your gitorious code just now (030c7eac).
For me, none of the examples linked from tests/index.html work.
Neither in FF nor IE.
(i just updated my flash to the latest version, and i checked that the
examples work that svgweb itself links to)

When running the examples in your package in FF I just get a white
screen while the log only says: "Forcing Flash SVG viewer for this
browser".
If i remove the svgweb code and run the protovis code directly in FF
it does work.

I will check some older versions of your source and try to find out if
the problem is not somewhere on my side.

Jan


On Oct 12, 3:34 am, Jamie Love <drjl...@gmail.com> wrote:
> Right, that's putting it back to what I had before.
>
> I've reverted the commit, back to what it was, just as you have.  I haven't
> been able to test this (I'm travelling).
>
> I'm not sure why I committed it, if it does fail so obviously - I'm sure I
> tested it at the them. Maybe I tested the wrong thing.
>
> Jamie
>
> On Tue, Oct 12, 2010 at 12:33 AM, bartt <bart.teeuwi...@thecodemill.biz>wrote:
>
>
>
> > Jamie,
>
> > I found that your last commit
> > (40c6f5ffe4b15a3df4723b1de6a55d8730f44c95) where you tried to simplify
> > onload handling to not listen for SVGLoad wasn't correct. All the
> > examples linked from tests/index.html failed to work in IE7&8.
>
> > After some digging I came to realize that SVGweb adds addEventListener
> > to IE. I patched pv-internals to use addEventListener when using
> > svgweb as the renderer. Now the tests are working. You'll find my
> > patch over at
> >http://github.com/bartt/protovis/commit/07a35461dee8be57a145c676f183d...
> > .
> > > > > > > protovis+u...@googlegroups.com<protovis%2Bunsu...@googlegroups.com>
> > <protovis%2Bunsubscr...@googlegroups.c om>
> > > > > <protovis%2Bunsubscr...@googlegroups.c om>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/protovis?hl=en.
>
> > > > > > --
> > > > > >JamieLove
> > > > > > Looking for custom software development? Contact us
> > > > > atwww.nsquaredsoftware.com.
>
> > > > --
> > > >JamieLove
> > > > Looking for custom software development? Contact us
> > atwww.nsquaredsoftware.com.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "protovis" group.
> > To post to this group, send email to prot...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > protovis+u...@googlegroups.com<protovis%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/protovis?hl=en.
>
> --

Jamie Love

unread,
Oct 12, 2010, 7:26:12 PM10/12/10
to prot...@googlegroups.com
Hiya,

I'll have to have a look at it later in the week when I get home - It's strange because it has been working for me for a long time, in FF and IE.

Still, something must be wrong. It requires flash 10 of course, but that's the latest.

Maybe try reverting to commit 2db01e91acd616e89c2ae68a5534d2be0b11e833. That was probably the last version I remember actively testing and deploying to our production systems.

Jamie

To unsubscribe from this group, send email to protovis+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Jan van Gemert

unread,
Oct 13, 2010, 12:19:45 PM10/13/10
to protovis
Sorry! My bad. I forgot to put it on a webserver. It's working now.
Thanks a lot for this.
Jan

On Oct 13, 1:26 am, Jamie Love <drjl...@gmail.com> wrote:
> Hiya,
>
> I'll have to have a look at it later in the week when I get home - It's
> strange because it has been working for me for a long time, in FF and IE.
>
> Still, something must be wrong. It requires flash 10 of course, but that's
> the latest.
>
> Maybe try reverting to commit 2db01e91acd616e89c2ae68a5534d2be0b11e833. That
> was probably the last version I remember actively testing and deploying to
> our production systems.
>
> Jamie
>
> > <protovis%2Bunsu...@googlegroups.com<protovis%252Buns...@googlegroups.com>
>
> > > > <protovis%2Bunsubscr...@googlegroups.c om>
> > > > > > > <protovis%2Bunsubscr...@googlegroups.c om>
> > > > > > > > > .
> > > > > > > > > For more options, visit this group at
> > > > > > > > >http://groups.google.com/group/protovis?hl=en.
>
> > > > > > > > --
> > > > > > > >JamieLove
> > > > > > > > Looking for custom software development? Contact us
> > > > > > > atwww.nsquaredsoftware.com.
>
> > > > > > --
> > > > > >JamieLove
> > > > > > Looking for custom software development? Contact us
> > > > atwww.nsquaredsoftware.com.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "protovis" group.
> > > > To post to this group, send email to prot...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > protovis+u...@googlegroups.com<protovis%2Bunsu...@googlegroups.com>
> > <protovis%2Bunsu...@googlegroups.com<protovis%252Buns...@googlegroups.com>

Jamie Love

unread,
Oct 17, 2010, 3:11:34 AM10/17/10
to prot...@googlegroups.com
Great to hear,

let me know if anything else is an issue.

idearat

unread,
Oct 27, 2010, 11:32:19 PM10/27/10
to protovis
So I've been running into a consistent issue with protovis + svgweb
integration where I get an empty (white screen) as many folks have
previously reported.

After some digging I think I've tracked the problem to the
pv.SvgScene.panel function around line 6103 in the protovis-d3.3.js
file.

The section of that code with the if (pv.renderer() == "svgweb") block
follows the advice for SVGWeb integration which says to a)
addEventListener('SVGLoad', ...) and to use svgweb.appendChild(). The
problem is that the svgweb.appendChild call immediately turns around
and invokes any event listeners on the newly appended nodes...and the
"frag" can still be empty at that point. This can be confirmed in a
debugger's stack trace.

To repair this, at least for my application, I added a new var at the
top of the function below the var g =... line and prior to the scene
rendering for loop:

// Set a flag our event handler for SVGWeb can use to know when to
// activate. Otherwise it waits until the graph is fully rendered.
var complete = false;

I then changed the event handler logic itself to:

g.addEventListener('SVGLoad', function() {
var that = this;
var func = function() {
that.appendChild(frag);
for (var j = 0; j < pv.Scene.events.length; j++) {
that.addEventListener(pv.Scene.events[j],
pv.SvgScene.dispatch, false);
}
scenes.$g = that;
};

if (complete) {
func();
} else {
window.setTimeout(func, 100);
}
}, false);

This new version effectively says run the (now embedded in func)
handler logic immediately if complete, otherwise keep resubmitting it
via setTimeout every 100ms until we've completed the scene graph.

I finally added a line just prior to the return e; line at the end of
the function of:

// Let any SVGWeb event handler know the scene graph is complete.
complete = true;

I've run this through a number of graphs within a complex application
with PHP, JQuery, YUI and other libs in the mix and it consistently
draws the graphs with no more white/blank display.

Hope this helps.

Thanks for all your great work on getting the initial versions of this
running!!!

ss

Jamie Love

unread,
Oct 28, 2010, 3:56:09 AM10/28/10
to prot...@googlegroups.com
Thanks there,

I'll add this code to the protovis+SVGWeb version.

--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

Jamie Love

unread,
Nov 3, 2010, 5:05:44 AM11/3/10
to prot...@googlegroups.com
Hiya

I've integrated your change into the git code repository. If at all possible, can you see if it continues to work for you?

Ta
Jamie

On Thu, Oct 28, 2010 at 4:32 PM, idearat <scott.s...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "protovis" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protovis+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/protovis?hl=en.

KC

unread,
Dec 2, 2010, 8:09:44 AM12/2/10
to protovis
I'm trying to use the latest code from the git repository and I'm
running into an issue with the SVGLoad workaround... I'm getting
"Object doesn't support this property or method" in IE8 when
g.addEventListener is called. Has anyone else seen this problem? Am
I doing something stupid here?

Any help is much appreciated!

Thanks,
KC
> > protovis+u...@googlegroups.com<protovis%2Bunsubscribe@googlegroups.c om>
> > .

Scott Shattuck

unread,
Dec 2, 2010, 1:37:16 PM12/2/10
to prot...@googlegroups.com
One frustration I've got with how the integration code works is that addEventListener is patched onto the window object and targeted svg containers by SVGWeb...not the best choice of names IMHO since it contributes to a lot of confusion.

All that aside, there was a race condition I was encountering with IE where the container patch wasn't happening prior to the callback being invoked...and I'd see errors of the kind you appear to be getting. I'd verify that you've got all the proper 'fu' on the target svg element, that you're following the documentation for SVGWeb on how to set up the load event triggers, etc. Other than that I'm afraid I'd be doing what you likely are...using the IE dev tools to dig through it.

Good luck!

ss


To unsubscribe from this group, send email to protovis+u...@googlegroups.com.

Kamala Ferris

unread,
Dec 2, 2010, 1:40:41 PM12/2/10
to prot...@googlegroups.com
I'll take a look at all the set-up and check the timing - thanks for the tip!

:-) KC
Reply all
Reply to author
Forward
0 new messages