D3 等效于 jQuery 属性选择器 [英] D3 Equivalent to jQuery Attribute selector

查看:23
本文介绍了D3 等效于 jQuery 属性选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道 d3 相当于 jQuery 属性选择器:

Does anyone know the d3 equivalent to jQuery attribute selector:

$('[attribute="name"]')

我希望能够使用 d3 方法,例如 .transition().谢谢!

I want to be able to use d3 methods such as .transition(). Thanks!

推荐答案

在 D3 和 jQuery 中都是一样的;底层功能由 W3C Selectors API 提供,因此请参阅关于属性选择器的文档.例如,d3.select("[id=body]") 等价于 d3.select("#body").

It's the same in both D3 and jQuery; the underlying functionality is provided by the W3C Selectors API, so see the documentation on attribute selectors. For example, d3.select("[id=body]") is equivalent to d3.select("#body").

这篇关于D3 等效于 jQuery 属性选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆