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

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

问题描述

有谁知道d3等价于jQuery属性选择器:

Does anyone know the d3 equivalent to jQuery attribute selector:

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

我想要能够使用.transition()等d3方法。谢谢!

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

推荐答案

D3和jQuery都是一样的;基本功能由 W3C选择器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天全站免登陆