mhemesath / r2d3

Raphael Rendered, Data Driven Documents
MIT License
546 stars 133 forks source link

Classes do not work for styling in IE7 and IE8 #50

Closed garrypolley closed 11 years ago

garrypolley commented 11 years ago

In attempting to use this library to draw some graphs, the class name are not applied to the vml markup.

I see it in the svg section, but the generated shape tags do not have the styles defined in my classes.

Note this also effects IE9 just using standard D3. So maybe just an IE problem altogether?

mhemesath commented 11 years ago

Class names aren't applied to the VML elements. I found out its a lot cleaner to just applied the class names and ID's on the SVG shadow DOM that you see rather than on the VML elements themselves. I do this for a couple of reasons:

  1. Raphael uses class names on the VML elements as well. This means we have to be careful not to stomp over its class names or the VML will not render properly.
  2. While class names and ids would be consistent, tag names are not. So I decided to maintain the SVG equivalent in a the DOM. D3 then uses Sizzle and queries that DOM as you would expect, but returns the Raphael objects that represent its VML counterparts. T

Also R2D3 should only be used with IE versions that do not have SVG support (IE < 9).

mhemesath commented 11 years ago

Found the issue. R2D3 shims SVG elements much the same way the HTML5 shim does. That means R2D3 needs to be above all the styles. That kinda stinks, so I'll create a small SVGShim to put above the styles so R2D3 can remain at the bottom.

mhemesath commented 11 years ago

Closing this as its invalid.