为了账号安全,请及时绑定邮箱和手机立即绑定

为g元素添加属性无效

import React from 'react';

import * as d3 from 'd3'


import './Dthree.css'


class Dthree extends React.Component{

constructor(props){

super(props)

this.useD3 = this.useD3.bind(this)

}

componentDidMount(){

this.useD3()

}

useD3() {

const svg1 = d3.select('#container')

.append('svg')

.attr("width", 500)

.attr("height", 250)


const g = d3.select('svg')

.append('g')

.attr('transform', 'translate(50,50)')

.style('width','50px')


}

render () {

return (

<div id='container'>

</div>

)

}

}


export default Dthree


正在回答

1 回答

添加的那个属性无效你要说清楚啊 ?

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

为g元素添加属性无效

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号