D3 v3到v5需要了解的变化

v3 → v5 改动

js url
<script src="https://d3js.org/d3.v3.js"></script>

<script src="https://d3js.org/d3.v5.js"></script>
style
selection.style({
    width:'100%',
    height:'30px'
})
//修改如下
selection.style('width','100%')
        .style('height','30px');

attr
selection.attr({
    width:'100%',
    height:'30px'
})
//修改如下
selection.attr('width','100%')
        .attr('height','30px');
selectAll
v3:
 d3.selectAll(selector) → Array

v5:
 d3.selectAll(selector) → Object

  d3.selectAll(selector).nodes() 获取 Array

d3.scale.linear
d3.scale.linear ↦ d3.scaleLinear
d3.scale.sqrt ↦ d3.scaleSqrt
d3.scale.pow ↦ d3.scalePow
d3.scale.log ↦ d3.scaleLog
d3.scale.quantize ↦ d3.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值