d3-selection
选择允许对文档对象模型 (DOM) 进行强大的数据驱动转换:设置 attributes、styles、properties、HTML 或 text 内容,等等。使用 数据连接 的 enter 和 exit 选择,你还可以使用 add 或 remove 元素来对应数据。
¥Selections allow powerful data-driven transformation of the document object model (DOM): set attributes, styles, properties, HTML or text content, and more. Using the data join’s enter and exit selections, you can also add or remove elements to correspond to data.
请参阅以下之一:
¥See one of:
选择元素 - 查询 DOM 元素。
¥Selecting elements - querying for DOM elements.
修改元素 - 修改所选元素的属性。
¥Modifying elements - modifying attributes of selected elements.
连接数据 - 将数据连接到选定元素以进行可视化。
¥Joining data - joining data to selected elements for visualization.
处理事件 - 声明用于交互的事件监听器。
¥Handling events - declaring event listeners for interaction.
控制流 - 在选定元素上迭代。
¥Control flow - iterating over selected elements.
局部变量 - 将状态附加到元素。
¥Local variables - attaching state to elements.
命名空间 - 处理 XML 命名空间。
¥Namespaces - dealing with XML namespaces.
更多信息,请参阅 Observable 上的 d3-selection 集合。
¥For more, see the d3-selection collection on Observable.