Skip to content

Visualization of weather data in SPA using Node.js, AJAX, jQuery, HTML, CSS, and XSLT.

Notifications You must be signed in to change notification settings

rijan-chapagain/weather-forecast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

weather-forecast

Visualization of weather data in SPA using Node.js, AJAX, jQuery, HTML, CSS, and XSLT.

Installation

Use the package manager npm to install node modules.

npm install

Usage

    // download data files based on user inputs year
    // pipe data to save downloaded data
    const file = fs.createWriteStream(`../data/${year}`);
    http.get(url, function(res) {        
        res.pipe(downloadPath);
    });


    // read and compare the downloaded data file and actual data file using buffer
    // if there is problem in downloading then display results from actual data file
    const downloadPathBuffer = Buffer.from(fs.readFileSync(`../downloads/${year}`));
    const dataPathBuffer = Buffer.from(fs.readFileSync(`../data/${year}`));

    var checkBuffer = downloadPathBuffer.includes(dataPathBuffer);
    
    if(checkBuffer)
    {
        readDataFile(downloadPath, callbackResult => {
            processing.calculation(request, response, callbackResult);
        });   
    }
    else
    {
        readDataFile(dataPath, callbackResult => {
            processing.calculation(request, response, callbackResult);
        });
    }

    // store avgWs, currentWs and currentsr in JSON object array in month-1 position
    weatherObjArray[month-1] = {'avgWs':avgWs, 'totalWs': currentws,'totalSr': currentsr};

Description

This application is a part of the university assessment of the unit ICT375 (Advance Web Programming).

Purpose

Purpose of weather_forecast app is to read data from the data file, convert XML into JSON format and display data of user-requested timeframe(2007-2016) and measures(solar rad, wind speed, both) in users choice of format(graph, table, both).

About

Visualization of weather data in SPA using Node.js, AJAX, jQuery, HTML, CSS, and XSLT.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published