|
@@ -1,7 +1,7 @@
|
1
|
1
|
var d3 = require("d3");
|
2
|
2
|
|
3
|
3
|
module.exports = {
|
4
|
|
- wave: curve(d3.curveCardinal.tension(0)),
|
|
4
|
+ wave: curve(d3.curveCardinal.tension(0.1)),
|
5
|
5
|
pixel: curve(d3.curveStep),
|
6
|
6
|
roundBars: bars(true),
|
7
|
7
|
bars: bars(),
|
|
@@ -28,7 +28,7 @@ function curve(interpolator) {
|
28
|
28
|
var x = d3.scalePoint()
|
29
|
29
|
.padding(0.1)
|
30
|
30
|
.domain(d3.range(data.length))
|
31
|
|
- .rangeRound([0, options.width]);
|
|
31
|
+ .rangeRound([options.waveLeft, options.waveRight]);
|
32
|
32
|
|
33
|
33
|
var height = d3.scaleLinear()
|
34
|
34
|
.domain([0, 1])
|
|
@@ -46,8 +46,8 @@ function curve(interpolator) {
|
46
|
46
|
|
47
|
47
|
}).reverse();
|
48
|
48
|
|
49
|
|
- top.unshift([0, baseline]);
|
50
|
|
- top.push([options.width, baseline]);
|
|
49
|
+ top.unshift([options.waveLeft, baseline]);
|
|
50
|
+ top.push([options.waveRight, baseline]);
|
51
|
51
|
|
52
|
52
|
// Fill waveform
|
53
|
53
|
context.beginPath();
|
|
@@ -80,7 +80,7 @@ function bars(round) {
|
80
|
80
|
.paddingInner(0.5)
|
81
|
81
|
.paddingOuter(0.01)
|
82
|
82
|
.domain(d3.range(data.length))
|
83
|
|
- .rangeRound([0, options.width]);
|
|
83
|
+ .rangeRound([options.waveLeft, options.waveRight]);
|
84
|
84
|
|
85
|
85
|
var height = d3.scaleLinear()
|
86
|
86
|
.domain([0, 1])
|
|
@@ -119,7 +119,7 @@ function bricks(rainbow) {
|
119
|
119
|
.paddingInner(0.1)
|
120
|
120
|
.paddingOuter(0.01)
|
121
|
121
|
.domain(d3.range(data.length))
|
122
|
|
- .rangeRound([0, options.width]);
|
|
122
|
+ .rangeRound([options.waveLeft, options.waveRight]);
|
123
|
123
|
|
124
|
124
|
var height = d3.scaleLinear()
|
125
|
125
|
.domain([0, 1])
|