Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making d3.js compatible with IE8/IE9

I am using a Leaderboard from the following link

http://labs.juiceanalytics.com/leaderboard/index.html#2a65db98c6f451b7f071b630694bc350

In this leaderboard d3.js and d3.csv.js are being used. This leaderboard is working fine for me in all the browsers except IE8 and IE9. For these browsers some error in scriptting is there with d3.js. I have searched it out well on internet but i didn't find any promising solution to make it work with IE8 or IE9. The error which it is showing is that "Object can't find the .map() method", which is used in d3.js. Glad if somebody can help me out in this.

like image 760
Hitesh Avatar asked May 30 '13 05:05

Hitesh


People also ask

Is D3 js still relevant?

The JavaScript ecosystem has completely changed during this time, in terms of libraries, best practices and even language features. Nevertheless, D3 is still here. And it's more popular than ever.

What is better than D3 JS?

D3. Js top competitors and alternatives include Zoho Analytics, Alteryx, Sisense, Data Virtuality Logical Data Warehouse, Adverity and Easy Insight.

How do I import D3 into JavaScript?

Install D3 by running npm install d3 --save . Import D3 to App. js by adding import * as d3 from d3 . You need to use import * (“import everything”) since D3 has no default exported module.

Does D3 need jQuery?

d3 does not directly use jQuery, so the jQuery library of functions is not directly accessible in d3 by default.


1 Answers

The author of d3 recommends using aight HTML5 shim/polyfill bundle for compatibility.

The .map method in question is part of EcmaScript5 - and therefore not available in IE8.

Mozilla provides a function you can drop in to get this functionality. Good luck with IE8!

like image 179
minikomi Avatar answered Sep 26 '22 00:09

minikomi