這個d3.brushY()函數在D3.js中用於沿y維創建一個新的一維畫筆。
用法:
d3.brushY();
參數:該函數不接受任何參數。
返回值:此函數沿y軸返回新創建的一維筆刷
例:在此示例中,我們將使用此方法在SVG元素上創建一維筆刷以及大小為600×600像素的y軸筆刷。
HTML
<!DOCTYPE html>
<html>
<head>
<title>
D3.js | d3.brushY() Function
</title>
<script src =
"https://d3js.org/d3.v4.min.js">
</script>
</head>
<body>
<svg width=600 height=600 id="brush"></svg>
<script>
// Selecting SVG element
d3.select("#brush")
// Creating a brush along y-axis
// using the d3.brush function
.call( d3.brushY()
// Initialise the brush area:start at
// 0,0 and finishes at given width,height
.extent( [ [0,0], [600,600] ] )
)
</script>
</body>
</html>
輸出:
相關用法
- p5.js int()用法及代碼示例
- PHP pow( )用法及代碼示例
- PHP pos()用法及代碼示例
- p5.js str()用法及代碼示例
- PHP dir()用法及代碼示例
- CSS var()用法及代碼示例
- p5.js tan()用法及代碼示例
- PHP ord()用法及代碼示例
- PHP min( )用法及代碼示例
- p5.js pan()用法及代碼示例
- d3.js zip()用法及代碼示例
- d3.js d3.map.set()用法及代碼示例
- p5.js hex()用法及代碼示例
- d3.js d3.set.has()用法及代碼示例
注:本文由純淨天空篩選整理自taran910大神的英文原創作品 D3.js brushY() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。