Browse Source

squish temp chart, make precep chat rectangular

master
Nathan Bergey 6 years ago
parent
commit
8fb3bb8d05
  1. 6
      src/data.js
  2. 4
      src/index.js
  3. 6
      src/render.js

6
src/data.js

@ -70,7 +70,11 @@ export function readxml(xmldoc) {
coverage: cloudCover[i] coverage: cloudCover[i]
}) })
precipData.push({ precipData.push({
date: midpointTime,
date: startTimes[i],
probability: precip[i]
})
precipData.push({
date: endTimes[i],
probability: precip[i] probability: precip[i]
}) })
} }

4
src/index.js

@ -26,8 +26,8 @@ const render = function (data) {
const height = canvas.node().getBoundingClientRect().height const height = canvas.node().getBoundingClientRect().height
const calHeight = 20 const calHeight = 20
const astroHeight = 50
const tempHeight = 300
const astroHeight = 45
const tempHeight = 200
const cloudHeight = height - (calHeight +tempHeight + astroHeight) const cloudHeight = height - (calHeight +tempHeight + astroHeight)
render_calendar(canvas, width, calHeight, 0, data) render_calendar(canvas, width, calHeight, 0, data)

6
src/render.js

@ -293,7 +293,7 @@ export function render_temperature(canvas, width, height, offset, data) {
bottom: 5, bottom: 5,
right: 0 right: 0
} }
const yrange = [-15, 45]
const yrange = [-5, 40]
const chart = new Chart(canvas, width, height, offset, margin, data, yrange) const chart = new Chart(canvas, width, height, offset, margin, data, yrange)
const line = d3.line() const line = d3.line()
@ -302,8 +302,8 @@ export function render_temperature(canvas, width, height, offset, data) {
.curve(d3.curveBasis) .curve(d3.curveBasis)
chart.draw_yAxisTitle('Temperature') chart.draw_yAxisTitle('Temperature')
chart.set_yAxisTic(-10, '-10 °C')
chart.draw_xGrid( -10, 'guide')
//chart.set_yAxisTic(-10, '-10 °C')
//chart.draw_xGrid( -10, 'guide')
chart.set_yAxisTic( 0, '0 °C') chart.set_yAxisTic( 0, '0 °C')
chart.draw_xGrid( 0, 'zero') chart.draw_xGrid( 0, 'zero')
chart.set_yAxisTic( 12, '12 °C') chart.set_yAxisTic( 12, '12 °C')

Loading…
Cancel
Save