and would like to know about feasibility and potential approaches to
make it usable by people using IE < 9
Thanks for any help!
Jeff
If you get SvgWeb working with D3, it would be great if you could
follow up on this thread - https://github.com/mbostock/d3/issues/73
Thanks.
My primary question is:
Is svgweb really the best approach?
svgweb is impressive, but from what I've seen so far, svgweb is only
going to work for a very limited number of cases.
Where is the activity going in d3 development to render in ie8? Is
svgweb where (and should be where) the energy is?
I've experimented with integrating d3 and svgweb and would like to know
why you think this isn't working:
https://gist.github.com/1275742
The svgweb portion is working: Here it is rendered on my server:
http://jeffpflueger.com/multi_media/runvis/circle_test.php - can view in
ie8 and other browsers. on bl.ocks.org server, could be that MIME types
aren't added and/or that the data-path needs to be local and not a URL.
What isn't working is that svgweb isn't finding svg output from d3.
Any ideas why that is?
Thanks for the help on this,
Jeff
> My primary question is:
> Is svgweb really the best approach?
The technique I'd most like to try is to do all the drawing with
Raphael instead of raw SVG -- the number of projects where I can
ignore IE8- is not yet large enough.
I think it's a big project, though, even just to make sure select()
and company work normally.
-n
-n
Example: using d3 to make the path string for Raphael:
// make the path string in d3
// no map in ie8, so using jQuery.map:
var data = jQuery.map(profile, function(d) {
return [ {dis: d.dis, ele: d.ele}];
} );
var profile_line = d3.svg.line()
.x(function(d) { return x(d.dis); })
.y(function(d) { return y(d.ele); });
// draw the profile with Raphael
var path = paper.path(profile_line(data)).attr({stroke:'#000000',
"stroke-width":'2', "stroke-linejoin": "round" });
- Requiring a rare plug-in download (Google Frames) isn't a great
solution in my opinion. Unless it were a plug-in as widely adopted as,
say, Flash
- From my experience, svgweb definitely is not a solution at this point
for anything but the most basic renderings.
Sounds like you should get yourself a VM running IE9 so you can test
yourself. As others have mentioned, D3 works in IE9, with the usual
caveats of cross-browser development. Unfortunately, the only way to
guarantee that your visualisation works in IE9 is to test it. Likewise
for other browsers; each has its quirks, some more than others.
--
Jason Davies, http://www.jasondavies.com/
I will forge ahead then with playing with d3/Raphael interoperability
and share what I come up with.
> - Requiring a rare plug-in download (Google Frames) isn't a great solution
> in my opinion. Unless it were a plug-in as widely adopted as, say, Flash
That was what I thought, too, until I tried it yesterday. Chrome Frame
no longer requires admin privileges and takes about twelve seconds to
install. It's a viable solution in a lot of environments -- and *much*
easier than doing something crazy with Raphael.
I certainly only advocate it in IE8-; your code should Just Work in
every other (modern) browser. A few tips that have helped me:
* jslint. Even if you need to make it ignore whitespace errors, it
catches so much stuff that makes browsers cry. And in my experience,
IE tends to be more strict in its implementation of the ECMAScript
spec than others. 'use strict' makes 'em work more similarly.
* If you're using console.log at all, do a check and define it in your
script. Don't rely on yourself commenting out all its uses.
* Get a copy of 'Javascript: The Good Parts' and read it once a year or so.
-n
Here is the example: http://seeruns.com/runvis_final.php
Here are some notes of thing I learned about using d3, raphael and
jquery together to create visualizations for modern browsers as well as
IE7 and IE8:
http://jeffpflueger.com/content/d3-data-driven-documents-and-internet-explorer
Here are some notes of thing I learned about using d3, raphael and jquery together to create visualizations for modern browsers as well as IE7 and IE8:
http://jeffpflueger.com/content/d3-data-driven-documents-and-internet-explorer
M10,20L30,40
in order to
to create a path.d3.geo.path
function appears to
project geographic coordinates into SVG path data - but I haven't
messed with it.You can pass a function to select and selectAll, which is then used
directly to select elements (rather than using querySelector). Maybe
that would work?
Mike
At the moment I only need a line chart so I'll start with this and
build from that. I already have a very basic version going and will
check it into git when its usable.