|
|
@ -330,11 +330,15 @@ export function render_clouds(canvas, width, height, offset, data) { |
|
|
|
const yrange = [0, 100] |
|
|
|
const chart = new Chart(canvas, width, height, offset, margin, data, yrange) |
|
|
|
|
|
|
|
const line = d3.line() |
|
|
|
const cloudLine = d3.line() |
|
|
|
.x(function(d) { return chart.xRange(d.date) }) |
|
|
|
.y(function(d) { return chart.yRange(d.coverage) }) |
|
|
|
.curve(d3.curveBasis) |
|
|
|
|
|
|
|
const precipLine = d3.line() |
|
|
|
.x(function(d) { return chart.xRange(d.date) }) |
|
|
|
.y(function(d) { return chart.yRange(d.probability) }) |
|
|
|
|
|
|
|
chart.set_yAxisTic( 0, '0%') |
|
|
|
chart.set_yAxisTic( 50, '50%') |
|
|
|
chart.draw_xGrid( 50, 'guide') |
|
|
@ -344,6 +348,11 @@ export function render_clouds(canvas, width, height, offset, data) { |
|
|
|
canvas.append('path') |
|
|
|
.data([data.clouds]) |
|
|
|
.attr('class', 'clouds') |
|
|
|
.attr('d', line) |
|
|
|
.attr('d', cloudLine) |
|
|
|
canvas.append('path') |
|
|
|
.data([data.precip]) |
|
|
|
.attr('class', 'precip') |
|
|
|
.attr('d', precipLine) |
|
|
|
|
|
|
|
chart.draw_xAxisLineBottom() |
|
|
|
} |