3

I am trying to create my first streamgraph with D3.js. I am starting with a working example which incorporates a tooltip from code posted on-line, http://bl.ocks.org/WillTurman/4631136:

enter image description here

When I copy the index.html and data.csv files to my PC (Windows 7), I am able to see the streamgraph in a browser (Firefox). However, I get a JS warning, "Use of Mutation Events is deprecated. Use MutationObserver instead."

What lines of code correspond to the Mutation Event? And how should I edit them to use a MutationObserver instead?

I am new to D3 and javascript. Although I found some discussion of mutation events and MutationObservers on-line, I didn't see any examples that were basic enough for me to understand and apply to my situation. I would appreciate any tips.

VividD
  • 10,456
  • 6
  • 64
  • 111
Jean V. Adams
  • 4,634
  • 2
  • 29
  • 46

1 Answers1

2

This is something that will need to be changed in the D3 source. As a user (and certainly as a beginner), you don't need to worry about this -- the warning is only relevant to the developers. Feel free to open an issue about this.

Lars Kotthoff
  • 107,425
  • 16
  • 204
  • 204
  • 7
    With all due respect I would like to say that... This answer does not show any light to the question asked. A better explanation or even an example to differentiate both MutationEvent and MutationObserver will be much appreciated. – Clain Dsilva Jan 14 '14 at 04:14
  • 2
    There are explanations on the internet that are much better than what I can provide here (e.g. [here](http://msdn.microsoft.com/en-us/library/ie/dn265032(v=vs.85).aspx)). In the context of D3, this is used all over the place, so the question on how to change them is quite a big one. I tried to give an answer that helps OP, who was concerned about the warning. Do feel free to add another answer though. – Lars Kotthoff Jan 14 '14 at 09:21