5

I am working with d3.js for Data visualization. I am getting the warning shown in the following image.enter image description here Does anyone have the idea why is this happening and how can I solve this? The message shown in the error is following

mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Bergi
  • 630,263
  • 148
  • 957
  • 1,375
  • Does this happen when you load the library, or does it come from your usage? Which line triggers this message? – Bergi Feb 23 '15 at 14:51
  • See [this post](http://stackoverflow.com/q/23807805/1048572) on what the message means and by what kind of code it is caused. – Bergi Feb 23 '15 at 14:52
  • The error is shown when I launch the page and no data are shown –  Feb 23 '15 at 14:53
  • Here is the [jsfiddle](http://jsfiddle.net/ovsvL4g9/) . Where can such error occur in my code? –  Feb 23 '15 at 15:02
  • That fiddle doesn't even import d3?! In what browser are you getting this warning? – Bergi Feb 23 '15 at 15:04
  • I am getting the error in firefox. But the error is not showing in chrome –  Feb 23 '15 at 15:07
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71506/discussion-between-shawana-tabassum-and-bergi). –  Feb 23 '15 at 15:09

1 Answers1

8

Does anyone have the idea why is this happening

Looks like it's d3's fault. They seem to use it to subclass arrays here:

// Until ECMAScript supports array subclassing, prototype injection works well.
var d3_subclass = function(object, prototype) {
  object.__proto__ = prototype;
};

how can I solve this?

Ignore the warning. Or file a bug against have a look at this issue of d3.js.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375