|
@ -1,6 +1,6 @@ |
|
|
var d3 = require('d3') |
|
|
var d3 = require('d3') |
|
|
import {readxml} from './data.js' |
|
|
import {readxml} from './data.js' |
|
|
import {render_calendar, render_nights, render_astronomy, render_temperature, render_clouds} from './render.js' |
|
|
|
|
|
|
|
|
import {render_calendar, render_nights, render_astronomy, render_temperature, render_clouds, render_rain} from './render.js' |
|
|
import './style.sass' |
|
|
import './style.sass' |
|
|
|
|
|
|
|
|
const canvas = d3.select('svg') |
|
|
const canvas = d3.select('svg') |
|
@ -28,13 +28,15 @@ const render = function (data) { |
|
|
const calHeight = 20 |
|
|
const calHeight = 20 |
|
|
const astroHeight = 45 |
|
|
const astroHeight = 45 |
|
|
const tempHeight = 200 |
|
|
const tempHeight = 200 |
|
|
const cloudHeight = height - (calHeight +tempHeight + astroHeight) |
|
|
|
|
|
|
|
|
const cloudHeight = 300 |
|
|
|
|
|
const rainHeight = height - (calHeight + astroHeight + tempHeight + cloudHeight) |
|
|
|
|
|
|
|
|
render_calendar(canvas, width, calHeight, 0, data) |
|
|
render_calendar(canvas, width, calHeight, 0, data) |
|
|
render_nights(canvas, width, height - calHeight, calHeight, data) |
|
|
render_nights(canvas, width, height - calHeight, calHeight, data) |
|
|
render_astronomy(canvas, width, astroHeight, calHeight, data) |
|
|
render_astronomy(canvas, width, astroHeight, calHeight, data) |
|
|
render_temperature(canvas, width, tempHeight, calHeight + astroHeight, data) |
|
|
render_temperature(canvas, width, tempHeight, calHeight + astroHeight, data) |
|
|
render_clouds(canvas, width, cloudHeight, calHeight + astroHeight + tempHeight, data) |
|
|
render_clouds(canvas, width, cloudHeight, calHeight + astroHeight + tempHeight, data) |
|
|
|
|
|
render_rain(canvas, width, rainHeight, calHeight + astroHeight + tempHeight + cloudHeight, data) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
d3.xml(url).then(function(xmldoc) { |
|
|
d3.xml(url).then(function(xmldoc) { |
|
|