mirror of
https://github.com/netbymatt/nexrad-level-2-plot.git
synced 2026-11-28 18:28:05 -08:00
add jsdoc
This commit is contained in:
1 parent
248b9f7353
commit
48721a7aef
2 files changed
+13
-1
No files matched your search
+7
-1
@@ -1,6 +1,12 @@
|
||||
const { draw, canvas } = require('./draw');
|
||||
const { writePngToFile } = require('./utils/file');
|
||||
|
||||
/**
|
||||
* Plot level 2 data
|
||||
* @param {Level2Data} data output from the nexrad-level-2-data library
|
||||
* @param {String[]} _products Options are REF, VEL, SW , ZDR, PHI and RHO
|
||||
* @param {object} options Plotting options
|
||||
* @returns Canvas
|
||||
*/
|
||||
const plot = (data, _products, options) => {
|
||||
// store result
|
||||
const result = {};
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
const fs = require('fs');
|
||||
// write a canvas to a Png file
|
||||
/**
|
||||
* Write a Canvas to the specified file
|
||||
* @param {string} fileName Path to write output to, passed to fs.createWriteStream
|
||||
* @param {Canvas} data Canvas provided by the plot() function
|
||||
* @returns Promise
|
||||
*/
|
||||
const writePngToFile = (fileName, data) => new Promise((resolve, reject) => {
|
||||
// the draw function will return false if no data was found, short circuit the output here
|
||||
if (!data.canvas) {
|
||||
|
||||
Reference in new issue
Block a user