Giter Club home page Giter Club logo

geoglows-javascript-package's Introduction

GEOGloWS-JavaScript-Package

| NPM npm npm GitHub forks Coveralls github

This is a version for the npm package for the API that is held for the GEOGloWS project, which uses the ERA-5 dataset from ECMWF. The application retrieves different plots using Plotly.js. This plots belong to a particular reach_id from a river, so plots are linked to a reach_id. The provided plots are:

  1. Forecast Records
  2. 52 Forecast Ensembles(Ensemble 52 is in high resolution)
  3. Forecast Statistics with return periods
  4. Historical Records with return periods
  5. Seasonal Flow

A demo application was prepared to show that the forecast, historical and seasonal data plots can be retrieved for any reach_id. The following codePen shows an application that contains all the streams for the country of Peru. The plots are retrieved when one clicks on an stream. Hydroviewer Peru

Documentation-use

GEOGloWS

The GEOGloWS object contains the functions that retrieve plots for the forecast, historical, seasonal average of a reach_id of a given stream. Therefore, it contains three Properties: Forecast, Historical, and Seasonal. In order to invoke the GEOGloWS object, you can do it in two ways: using the CDN in the HTML or installing it via NPM.

The CDN for the use of the package is:
https://unpkg.com/[email protected]/dist/geoglows.min.js

If the CDN link is going to be used it is necesarry to use the following structure: GEOGloWS.forecast, GEOGloWS.historical, GEOGloWS.seasonal. After, the methods for each one of the different objects can be used. For example, GEOGloWS.forecast.graph_fr() will call the function graph_fr that will retrieve the forecast records.

The NPM command to install the package is
npm i geoglows

If the NPM isntallation is going to be use then a simple require will work.

var foo = require("geoglows");
foo.GEOGLOWS.forecast.graph_fr();

Forecast

The FORECAST object contains the functions that are realted to the forcast of a reach_id of a given stream.

Type: Object

Properties

  • graph_fr Function Gives a Plot of the forecast Records for a given reach_id of an stream
  • graph_emsembles Function Gives a Plot of the forecast ensembles for a given reach_id of an stream. It gives 52 ensembles.
  • graph_stats Function Gives a Plot of the forecsast statistics and the last week of the forecast records.

graph_fr

Retrieves a plot of the forecast Records for a given reach_id of an stream. It gives 2 weeks of the forecst records. In addition, the function lets customize the width, heigh, and title of the graph if needed. The retrieved plots are plotted using Plotly, so a button to download data has been added to the plots

Parameters

  • reachid number reach_id of an specific stream
  • htmlElement string It is the id of the HTML element.
  • title string it is the title of the grah (optional).
  • rp boolean -Tells the function to add the return periods to the plot of the Forecast Records.(optional).
  • width string Especifies the width of the plot.(optional).
  • height string Especifies the height of the plot.(optional).

graph_emsembles

Retrieves a plot of the forecast ensembles for a given reach_id of an stream. It gives 52 ensembles. The ensemble 52 is the only one that comes in high resolution. In addition, You can especify which ensembles do you want. For exmaple, the array [2,4,6,7] will give you the ensembles 2,4,6, and 7. The default is to give all all the ensembles. The function also lets customize the width, heigh, and title of the graph if needed. The retrieved plots are plotted using Plotly, so a button to download data has been added to the plots

Parameters

  • reachid number reach_id of an specific stream
  • htmlElement string It is the id of the HTML element.
  • arrayEnsemble array It is the array that contains the number of ensembles that will be given (optional).
  • title string it is the title of the grah (optional).
  • width string Especifies the width of the plot.(optional).
  • height string Especifies the height of the plot.(optional).

graph_stats

Retrieves a plot of the forecast statisitics of the given reach_id. These statistcis are Maximun, Minimun, 25% percentile, 75% percentile, and Mean. The function also lets customize the width, heigh, and title of the graph if needed. The retrieved plots are plotted using Plotly, so a button to download data has been added to the plots

Parameters

  • reachid number reach_id of an specific stream
  • htmlElement string It is the id of the HTML element.
  • title string it is the title of the grah (optional).
  • rp boolean -Tells the function to add the return periods to the plot of the Forecast Records.(optional).
  • width string Especifies the width of the plot.(optional).
  • height string Especifies the height of the plot.(optional).

Historical

The HISTORICAL object contains the functions that are related to the Historical data of a reach_id of a given stream.

Type: Object

Properties

  • graph Function Retrieves a plot of the historical data of the given reach_id.

graph

Retrieves the plot related to the Historical Records for a given reach_id of an stream. In addition, the function lets customize the width, heigh, and title of the graph if needed. The retrieved plots are plotted using Plotly, so a button to download data has been added to the plots

Parameters

  • reachid number reach_id of an specific stream
  • htmlElement string It is the id of the HTML element.
  • title string it is the title of the grah (optional).
  • rp boolean -Tells the function to add the return periods to the plot of the Forecast Records.(optional).
  • width string Especifies the width of the plot.(optional).
  • height string Especifies the height of the plot.(optional).

Seasonal

The SEASONAL object contains the functions that are related to the plots of the Seasonal average data of a reach_id of a given stream.

Type: Object

Properties

  • graph Function Retrieves a plot of the historical data of the given reach_id.

graph

Retrieves the plot related to the Seasonal Average Data for a given reach_id of an stream. In addition, the function lets customize the width, heigh, and title of the graph if needed. The retrieved plots are plotted using Plotly, so a button to download data has been added to the plots

Parameters

  • reachid number reach_id of an specific stream
  • htmlElement string It is the id of the HTML element.
  • title string it is the title of the grah (optional).
  • width string Especifies the width of the plot.(optional).
  • height string Especifies the height of the plot.(optional).

geoglows-javascript-package's People

Contributors

romer8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.