mhemesath / r2d3

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

Is using DIV supported? - when there is no SVG - #90

Closed babakinks closed 10 years ago

babakinks commented 11 years ago

In this example I am using D3 but there is no SVG in it, it is using DIVs with D3.select. And it doesn't get rendered when I tried it in IE8. But does work in modern browsers. So I am thinking if my code is not using SVG in it, there may be this issue that it can't render it because it is just using DIVs?

   function draw(data) {
        d3.select("body")
                .append("div")
                .attr("class", "chart")
                .selectAll("div.bar")
                .data(data.cash)
                .enter()
                .append("div")
                .attr("class","line");

        d3.selectAll("div.line")
                .append("div")
                .attr("class","label")
                .text(function(d){return d.name});

        d3.selectAll("div.line")
                .append("div")
                .attr("class","bar")
                .style("width", function(d){return d.count/100 + "px";})
                .text(function(d){return Math.round(d.count)});
    }
IPWright83 commented 11 years ago

There may be issues with some of the Javascript that D3 uses. Are you getting any errors in the browser console? Try including Sizzle to provide backwards compatibility for IE8 on the selectors API and see if that works.

Ultimately this isn't really an R2D3 issue if you're not dealing with SVG.

mhemesath commented 11 years ago

HTML should be working, if not its definitely a bug. I can look into it. With that said, this libs primary purpose is to batch SVG rendering, so compatability with HTML isn't tested much at all.

@IPWright83 I already bundle sizzle with R2D3.

babakinks commented 11 years ago

Thanks for comments and feedback. Feel free to close the issue as it is not dealing with SVG rendering.

mhemesath commented 11 years ago

This is still a valid bug....

sun16 commented 10 years ago

This has been resolved by pull request https://github.com/mhemesath/r2d3/pull/139, which solves the underlying problem specified in #103.