[英]How do I use mutationobserver instead of mutation events?
I am trying to create my first streamgraph with D3.js. 我正在尝试用D3.js创建我的第一个流程图。 I am starting with a working example which incorporates a tooltip from code posted on-line, http://bl.ocks.org/WillTurman/4631136 :
我从一个工作示例开始,该示例包含来自在线发布的代码的工具提示, http : //bl.ocks.org/WillTurman/4631136 :
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). 当我将
index.html
和data.csv
文件复制到我的PC(Windows 7)时,我能够在浏览器(Firefox)中看到流图。 However, I get a JS warning, " Use of Mutation Events is deprecated. Use MutationObserver instead. " 但是,我得到一个JS警告,“ 不推荐使用Mutation事件。请改用MutationObserver。 ”
What lines of code correspond to the Mutation Event? 哪些代码行对应于Mutation事件? And how should I edit them to use a MutationObserver instead?
我应该如何编辑它们以使用MutationObserver呢?
I am new to D3 and javascript. 我是D3和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.
虽然我发现了一些关于突变事件和MutationObservers的在线讨论,但我没有看到任何基本的例子让我理解并适用于我的情况。 I would appreciate any tips.
我会很感激任何提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.