add jsdoc

This commit is contained in:
Matt Walsh committed 2021-08-26 09:04:11 -05:00
1 parent 248b9f7353
commit 48721a7aef
2 files changed
+13 -1

No files matched your search

+7 -1
View File
@@ -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 = {};
+6
View File
@@ -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) {