UNPKG

metar-plot

Version:
257 lines (256 loc) 29.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WEATHER = exports.getWeatherImgSrc = exports.getWeatherSVG = exports.Weather = void 0; /** * Weather Descriptor */ var Weather = /** @class */ (function () { function Weather() { } return Weather; }()); exports.Weather = Weather; /** * Returns SVG icon * @param key weather abbriviation */ function getWeatherSVG(key) { var weather = exports.WEATHER[key] != null ? exports.WEATHER[key].svg : ""; return "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"65\" height=\"65\" viewBox=\"0 0 500 500\" x=\"140\" y=\"220\">\n <style>\n .wx_graphic {\n stroke: black;\n fill: none;\n stroke-width: 30\n }\n </style>\n " + weather + "\n </svg>"; } exports.getWeatherSVG = getWeatherSVG; /** * Returns a raw base64 src for img tag * @param key * @returns */ function getWeatherImgSrc(key) { var weather = exports.WEATHER[key] != null ? exports.WEATHER[key].svg : ""; var data = btoa(unescape(encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"65\" height=\"65\" viewBox=\"0 0 500 500\">\n <style>\n .wx_graphic {\n stroke: black;\n fill: none;\n stroke-width: 30\n }\n </style>\n " + weather + "\n </svg>"))); return "data:image/svg+xml;base64," + data; } exports.getWeatherImgSrc = getWeatherImgSrc; var BRK_DWN_ARW = "<line class=\"wx_graphic\" x1=\"350\" y1=\"50\" x2=\"175\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"170\" y1=\"245\" x2=\"350\" y2=\"415\"></line>\n <line class=\"wx_graphic\" x1=\"350\" y1=\"415\" x2=\"250\" y2=\"415\"></line>\n <line class=\"wx_graphic\" x1=\"350\" y1=\"425\" x2=\"350\" y2=\"315\"></line>"; var RIGHT_ARROW = "<line class=\"wx_graphic\" x1=\"120\" y1=\"250\" x2=\"430\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"380\" y1=\"250\" x2=\"465\" y2=\"250\" transform=\"rotate(-45, 450, 250)\"></line>\n <line class=\"wx_graphic\" x1=\"380\" y1=\"250\" x2=\"450\" y2=\"250\" transform=\"rotate(45, 450, 250)\"></line>"; var COMMA = "<ellipse\n style=\"fill:black;\"\n cx=\"238\"\n cy=\"178\"\n rx=\"88\"\n ry=\"87\" />\n <path\n class=\"wx_graphic\"\n d=\"m 174,335 c 9,2 19,3 30,3 h 2 c 56,0 101,-34 101,-76 v -68 c 0,-42 -45,-76 -101,-76 h -2\" />"; var STAR = "<rect\n style=\"fill:black\"\n width=\"50\"\n height=\"350\"\n x=\"225\"\n y=\"-25\" />\n <rect\n style=\"fill:black\"\n width=\"50\"\n height=\"350\"\n x=\"235\"\n y=\"-300\"\n transform=\"rotate(55)\" />\n <rect\n style=\"fill:black\"\n width=\"50\" height=\"350\"\n x=\"-10\" y=\"115\"\n transform=\"rotate(-55)\" />"; var DWN_TRI = "<path\n class=\"wx_graphic\" \n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 245,420 175,150 320,146 Z\" />"; var DWN_TRI_SMALL = "<path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 240,435 190,275 290,275 Z\"/>"; var SINE = "<g>\n <path\n class=\"wx_graphic\" \n d=\"m 430,230 a 85,90 0 0 1 -45,80 85,90 0 0 1 -85,0 85,90 0 0 1 -45,-80\"/>\n <path\n class=\"wx_graphic\" \n d=\"m -80,-230 a 85,90 0 0 1 -45,80 85,90 0 0 1 -85,0 85,90 0 0 1 -45,-80\"\n transform=\"rotate(180)\" />\n </g>"; /* SVG Icons */ //DUST OR SAND //Smoke or volcanic ash var FU_VA = "<g id=\"FU_VA\">\n <line class=\"wx_graphic\" x1=\"100\" y1=\"150\" x2=\"100\" y2=\"400\"></line>\n <path class=\"wx_graphic\" d=\"M 100 150 C 115 75 185 75 200 150\"></path>\n <path class=\"wx_graphic\" d=\"M 200 150 C 215 215 285 215 300 150\"></path>\n <path class=\"wx_graphic\" d=\"M 300 150 C 315 75 380 75 400 150\"></path>\n </g>"; //Haze var HZ = "<g id=\"HZ\">\n <ellipse\n class=\"wx_graphic\" \n cx=\"155\"\n cy=\"255\"\n rx=\"90\"\n ry=\"75\" />\n <ellipse\n class=\"wx_graphic\" \n cx=\"340\"\n cy=\"255\"\n rx=\"90\"\n ry=\"75\" />\n </g>"; //Dust or Sand var DU_SA = "<g id=\"DU_SA\">\n <path\n id=\"path342\"\n class=\"wx_graphic\"\n d=\"m 322.61133,125.13086 c -16.56384,-20.34934 -42.43354,-31.823704 -69.45117,-30.804688 -11.39949,0.429681 -22.58631,3.074347 -32.87305,7.771488 -35.54781,16.23274 -54.37418,53.88954 -45.19336,90.39648 9.18079,36.50727 43.87857,61.96066 83.29297,61.10156 m -69.90625,126.18555 c 23.94628,29.96696 67.31576,40.40903 104.10937,25.06641 36.79392,-15.34204 57.03041,-52.30668 48.57813,-88.73438 -8.45193,-36.42761 -43.29946,-62.43592 -83.65235,-62.43359\" />\n </g>"; //Blowing dust or sand var BLDU_BLSA = "<g id=\"BLDU_BLSA\">\n " + DU_SA + "\n <rect\n class=\"wx_graphic\"\n width=\"0.75\"\n height=\"385\"\n x=\"255\"\n y=\"60\" />\n </g>"; //Dust Devil var PO = "<g id=\"PO\">\n <path\n class=\"wx_graphic\" \n d=\"M 371.02339,260.54119 327.623,186.08416 175.04878,186.71893 99.310495,319.1701 l 76.835945,131.81445 152.57421,-0.63281 42.2129,-73.82227\" />\n <path\n class=\"wx_graphic\" \n d=\"M 369.42563,141.09136 326.02524,66.634336 173.45102,67.269101 97.712737,199.72027 174.54868,331.53472 327.1229,330.90191 369.33579,257.07964\" />\n </g>"; //Vicinity sand storm var VCSS = "<g id=\"VCSS\">\n " + DU_SA + "\n <path\n class=\"wx_graphic\"\n d=\"m 130,245 240,-0.0781 -25,-50\" />\n <path\n class=\"wx_graphic\" \n d=\"M 390,200 A 195,190 0 0 1 195,150 195,190 0 0 1 145,-40\"\n transform=\"matrix(0.7,0.7,-0.7,0.7,0,0)\" />\n <path\n class=\"wx_graphic\" \n d=\"M -285,225 A 190,185 0 0 1 -485,185 190,185 0 0 1 -540,-5\"\n transform=\"matrix(-0.65,-0.75,0.75,-0.65,0,0)\"/>\n </g>"; //FOG OR SPEACIAL WEATHER //Mist or light fog var BR = "<g id=\"BR\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"200\" x2=\"450\" y2=\"200\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"300\" x2=\"450\" y2=\"300\"></line>\n </g>"; //More or less continuous shallow fog var MIFG = "<g id=\"MIFG\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"200\" x2=\"200\" y2=\"200\"></line>\n <line class=\"wx_graphic\" x1=\"300\" y1=\"200\" x2=\"450\" y2=\"200\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"300\" x2=\"450\" y2=\"300\"></line>\n </g>\n "; //Vicinity thunderstorm var VCTS = "<g id=\"VCTS\">" + BRK_DWN_ARW + "</g>"; //Virga or precipitation not hitting ground var VIRGA = "<g id=\"VIGRA\">\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"250\"\n rx=\"80\"\n ry=\"80\"/>\n <path\n class=\"wx_graphic\" \n d=\"M 415,310 A 185,190 25 0 1 245,415 185,190 25 0 1 80,305\" />\n </g>"; //Vicinity showers var VCSH = "<g id=\"VCSH\">\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"250\"\n rx=\"80\"\n ry=\"80\" />\n <path\n class=\"wx_graphic\" \n d=\"M 390,200 A 195,190 0 0 1 195,150 195,190 0 0 1 145,-40\"\n transform=\"matrix(0.7,0.7,-0.7,0.7,0,0)\" />\n <path\n class=\"wx_graphic\" \n d=\"M -285,225 A 190,185 0 0 1 -485,185 190,185 0 0 1 -540,-5\"\n transform=\"matrix(-0.65,-0.75,0.75,-0.65,0,0)\"/>\n </g>"; //Thunderstorm with or without precipitation var TS = "<g id=\"TS\">\n " + BRK_DWN_ARW + "\n <line class=\"wx_graphic\" x1=\"355\" y1=\"50\" x2=\"50\" y2=\"50\"></line>\n <line class=\"wx_graphic\" x1=\"60\" y1=\"50\" x2=\"60\" y2=\"440\"></line>\n </g>\n "; //Squalls var SQ = "<g id=\"SQ\">\n <line class=\"wx_graphic\" x1=\"250\" y1=\"450\" x2=\"150\" y2=\"50\"></line>\n <line class=\"wx_graphic\" x1=\"150\" y1=\"50\" x2=\"250\" y2=\"125\"></line>\n <line class=\"wx_graphic\" x1=\"250\" y1=\"125\" x2=\"350\" y2=\"50\"></line>\n <line class=\"wx_graphic\" x1=\"350\" y1=\"50\" x2=\"250\" y2=\"450\"></line>\n </g>"; //Funnel cloud or tornado var FC = "<g id=\"FC\">\n <line class=\"wx_graphic\" x1=\"200\" y1=\"100\" x2=\"200\" y2=\"400\"></line>\n <line class=\"wx_graphic\" x1=\"300\" y1=\"100\" x2=\"300\" y2=\"400\"></line>\n <line class=\"wx_graphic\" x1=\"300\" y1=\"100\" x2=\"375\" y2=\"50\"></line>\n <line class=\"wx_graphic\" x1=\"300\" y1=\"400\" x2=\"375\" y2=\"450\"></line>\n <line class=\"wx_graphic\" x1=\"200\" y1=\"400\" x2=\"125\" y2=\"450\"></line>\n <line class=\"wx_graphic\" x1=\"200\" y1=\"100\" x2=\"125\" y2=\"50\"></line>\n </g>\n "; //BLOWING WEATHER //Sand or dust storm var SS = "<g id=\"SS\">\n " + DU_SA + "\n <path\n class=\"wx_graphic\"\n d=\"m 130,245 240,-0.0781 -25,-50\" />\n </g>"; //Strong sand or dust storm var PLUS_SS = "<g id=\"+SS\">\n " + DU_SA + "\n <path\n class=\"wx_graphic\"\n d=\"m 135,230 c 80,-0.025 150,-0.050 240,-0.078 l -30,-50\"/>\n <path\n class=\"wx_graphic\"\n d=\"m 135,285 240,0.078 -30,50\" />\n </g>"; //Blowing snow var BLSN = "<g id=\"BLSN\">\n <rect\n class=\"wx_graphic\"\n width=\"336.96838\"\n height=\"3.2715375\"\n x=\"74.154854\"\n y=\"248.36423\" />\n <path\n class=\"wx_graphic\"\n d=\"m 370.77355,286.68722 58.29491,-38.25 -58.29491,-34.99609\" />\n <g transform=\"rotate(-90,250,250)\">\n <rect\n class=\"wx_graphic\"\n width=\"335\"\n height=\"5\"\n x=\"75\"\n y=\"250\" />\n <path\n class=\"wx_graphic\"\n d=\"m 370.77355,286.68722 58.29491,-38.25 -58.29491,-34.99609\" />\n </g>\n </g>"; //Drifting snow var DRSN = "<g id=\"DRSN\">\n <rect\n class=\"wx_graphic\"\n width=\"336.96838\"\n height=\"3.2715375\"\n x=\"74.154854\"\n y=\"248.36423\" />\n <path\n class=\"wx_graphic\"\n d=\"m 370.77355,286.68722 58.29491,-38.25 -58.29491,-34.99609\" />\n <g transform=\"rotate(90,250,250)\">\n <rect\n class=\"wx_graphic\"\n width=\"335\"\n height=\"5\"\n x=\"75\"\n y=\"250\" />\n <path\n class=\"wx_graphic\"\n d=\"m 370.77355,286.68722 58.29491,-38.25 -58.29491,-34.99609\" />\n </g>\n </g>\n "; //FOG////////////////////////////////////////////// //Vicinity fog var VCFG = "<g id=\"VCFG\">\n <line class=\"wx_graphic\" x1=\"100\" y1=\"150\" x2=\"400\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"100\" y1=\"250\" x2=\"400\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"100\" y1=\"350\" x2=\"400\" y2=\"350\"></line>\n <path class=\"wx_graphic\" d=\"M 60 135 C 15 165 15 335 65 365\"></path>\n <path class=\"wx_graphic\" d=\"M 435 135 C 485 150 500 345 435 365\"></path>\n </g>"; //Patchy fog var BCFG = "<g id=\"BCFG\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"150\" x2=\"150\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"350\" y1=\"150\" x2=\"450\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"250\" x2=\"450\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"350\" x2=\"150\" y2=\"350\"></line>\n <line class=\"wx_graphic\" x1=\"350\" y1=\"350\" x2=\"450\" y2=\"350\"></line>\n </g>"; //Fog, sky discernable var PRFG = "<g id=\"BCFG\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"150\" x2=\"150\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"350\" y1=\"150\" x2=\"450\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"250\" x2=\"450\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"350\" x2=\"450\" y2=\"350\"></line>\n </g>"; //Fog, sky undiscernable var FG = "<g id=\"FG\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"150\" x2=\"450\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"250\" x2=\"450\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"350\" x2=\"450\" y2=\"350\"></line>\n </g>"; //Freezing fog var FZFG = "<g id=\"FG\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"150\" x2=\"450\" y2=\"150\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"250\" x2=\"450\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"350\" x2=\"450\" y2=\"350\"></line>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"150\" x2=\"250\" y2=\"350\"></line>\n <line class=\"wx_graphic\" x1=\"450\" y1=\"150\" x2=\"250\" y2=\"350\"></line>\n </g>"; //Drizzle //Light drizzle var MIN_DZ = "<g id=\"-DZ\">\n <g transform=\"matrix(0.6,0,0,0.6,20,114)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,203,114)\">" + COMMA + "</g>\n </g>"; //Moderate drizzle var DZ = "<g id=\"DZ\">\n <g transform=\"matrix(0.6,0,0,0.6,18,158)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,201,158)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,106,12)\">" + COMMA + "</g>\n </g>"; //Heavy drizzle var PLUS_DZ = "<g id=\"+DZ\">\n <g transform=\"matrix(0.6,0,0,0.6,20,114)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,203,114)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,108,-31)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,108,261)\">" + COMMA + "</g>\n </g>"; //Light freezing drizzle var MIN_FZDZ = "<g id=\"-FZDZ\">\n <g transform=\"matrix(0.6,0,0,0.6,28,136)\">" + COMMA + "</g>\n " + SINE + "\n </g>"; //Moderate to heavy freezing drizzle var FZDZ = "<g id=\"-DZ\">\n <g transform=\"matrix(0.6,0,0,0.6,28,136)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,204,66)\">" + COMMA + "</g>\n " + SINE + " \n </g>"; //Light drizzle and rain var MIN_DZRA = "<g id=\"-DZRA\">\n <g transform=\"matrix(0.6,0,0,0.6,107,193)\">" + COMMA + "</g>\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"150\"\n rx=\"50\"\n ry=\"55\"/>\n </g>"; //Moderate to heavy drizzle and rain var DZRA = "<g id=\"DZRA\" transform=\"matrix(1,0,0,0.9,0.6,120)\">\n <g transform=\"matrix(0.6,0,0,0.6,105,170)\">" + COMMA + "</g>\n <g transform=\"matrix(0.6,0,0,0.6,105,-140)\">" + COMMA + "</g>\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"150\"\n rx=\"50\"\n ry=\"55\"/>\n </g>"; //RAIN //Light rain var MIN_RA = "<g id=\"-RA\">\n <ellipse\n style=\"fill:#00000\"\n cx=\"130\"\n cy=\"245\"\n rx=\"80\"\n ry=\"80\" />\n <ellipse\n style=\"fill:black\"\n cx=\"370\"\n cy=\"245\"\n rx=\"80\"\n ry=\"80\" />\n </g>"; //Moderate rain var RA = "<g id=\"RA\">\n <ellipse\n style=\"fill:black\"\n cx=\"135\"\n cy=\"355\"\n rx=\"80\"\n ry=\"80\" />\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"145\"\n rx=\"80\"\n ry=\"80\" />\n <ellipse\n style=\"fill:black\"\n cx=\"365\"\n cy=\"355\"\n rx=\"80\"\n ry=\"80\" />\n </g>"; //Heavy rain var PLUS_RA = "<g id=\"+RA\">\n <ellipse\n style=\"fill:black\"\n cx=\"140\"\n cy=\"250\"\n rx=\"80\"\n ry=\"80\" />\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"100\"\n rx=\"80\"\n ry=\"80\" />\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"400\"\n rx=\"80\"\n ry=\"80\" />\n <ellipse\n style=\"fill:black\"\n cx=\"360\"\n cy=\"250\"\n rx=\"80\"\n ry=\"80\" />\n </g>"; //Light freezing rain var MIN_FZRA = "<g id=\"-FZRA\">\n <ellipse\n style=\"fill:black\"\n cx=\"170\"\n cy=\"250\"\n rx=\"50\"\n ry=\"55\"/>\n " + SINE + "\n </g>"; //Moderate to heavy freezing rain var FZRA = "<g id=\"FZRA\">\n <ellipse\n style=\"fill:black\"\n cx=\"170\"\n cy=\"250\"\n rx=\"50\"\n ry=\"55\"/>\n <ellipse\n style=\"fill:black\"\n cx=\"345\"\n cy=\"215\"\n rx=\"50\"\n ry=\"55\"/>\n " + SINE + "\n </g>"; //Light rain and snow var MIN_RASN = "<g id=\"-RASN\" transform=\"translate(-0.45,160)\">\n <g transform=\"matrix(0.45,0,0,0.4,140,140)\">" + STAR + "</g>\n <ellipse\n style=\"fill:black\"\n cx=\"250\"\n cy=\"-15\"\n rx=\"70\"\n ry=\"70\" />\n </g>"; //Moderate to heavy rain and snow var RASN = "<g id=\"RASN\" transform=\"translate(-0.43,155)\">\n <g transform=\"matrix(0.45,0,0,0.4,140,200)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,140,-130)\">" + STAR + "</g>\n <ellipse\n cx=\"250\"\n cy=\"95\"\n rx=\"70\"\n ry=\"70\" />\n </g>"; //SNOW and MISC FROZEN PERCIP //Light snow var MIN_SN = "<g id=\"-SN\" transform=\"translate(-0.435,100)\">\n <g transform=\"matrix(0.45,0,0,0.4,40,90)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,240,90)\">" + STAR + "</g>\n </g>"; //Moderate snow var SN = "<g id=\"SN\" transform=\"translate(-0.435,170)\">\n <g transform=\"matrix(0.45,0,0,0.4,40,90)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,240,90)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,140,-55)\">" + STAR + "</g>\n </g>"; //Heavy snow var PLUS_SN = "<g id=\"+SN\" transform=\"translate(-0.435,100)\">\n <g transform=\"matrix(0.45,0,0,0.4,40,90)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,240,90)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,140,-55)\">" + STAR + "</g>\n <g transform=\"matrix(0.45,0,0,0.4,140,240)\">" + STAR + "</g>\n </g>"; //Snow grains var SG = "<g id=\"SG\">\n <polygon class=\"wx_graphic\" points=\"250 150 150 300 350 300\"></polygon>\n <line class=\"wx_graphic\" x1=\"50\" y1=\"230\" x2=\"197\" y2=\"230\"></line>\n <line class=\"wx_graphic\" x1=\"303\" y1=\"230\" x2=\"450\" y2=\"230\"></line>\n </g>"; //Ice crystals var IC = "<g id=\"IC\">\n <line class=\"wx_graphic\" x1=\"50\" y1=\"250\" x2=\"450\" y2=\"250\"></line>\n <line class=\"wx_graphic\" x1=\"175\" y1=\"175\" x2=\"325\" y2=\"325\"></line>\n <line class=\"wx_graphic\" x1=\"325\" y1=\"175\" x2=\"174\" y2=\"325\"></line> \n </g>"; //Ice pellets var PE_PL = "<g id=\"PE_PL\">\n <polygon class=\"wx_graphic\" points=\"250 150 150 300 350 300\"></polygon>\n <text style=\"fill: black; font-size: 100px;\" x=\"237.271\" y=\"242.526\" dx=\"-18.412\" dy=\"32.137\">\u25CF</text>\n </g>"; //SHOWERY PERCIPITATION //Light rain showers var MIN_SHRA = "<g id=\"MIN_SHRA\">\n <ellipse\n style=\"fill:black\"\n cx=\"245\"\n cy=\"70\"\n rx=\"50\"\n ry=\"50\" />\n " + DWN_TRI + "\n </g>"; //Moderate to heavy rain showers var SHRA = "<g transform=\"translate(3.14,20)\">\n <ellipse\n style=\"fill:black\"\n cx=\"245\"\n cy=\"70\"\n rx=\"50\"\n ry=\"50\" />\n " + DWN_TRI + "\n <rect\n style=\"fill:none;stroke:black;stroke-width:15;\"\n width=\"100\"\n height=\"5\"\n x=\"195\"\n y=\"205\" />\n </g>"; //Light rain and snow showers var MIN_SHRASN = "<g transform=\"translate(9,20)\">\n <ellipse\n style=\"fill:black\"\n cx=\"240\"\n cy=\"195\"\n rx=\"50\"\n ry=\"50\"/>\n " + DWN_TRI_SMALL + "\n <g transform=\"matrix(0.3,0,0,0.3,165,35)\">\n " + STAR + "\n </g>\n </g>"; //Moderate to heavy rain and snow showers var SHRASN = "<g transform=\"translate(9,20)\">\n <ellipse\n style=\"fill:black\"\n cx=\"240\"\n cy=\"195\"\n rx=\"50\"\n ry=\"50\"/>\n " + DWN_TRI_SMALL + "\n <g transform=\"matrix(0.3,0,0,0.3,165,35)\">\n " + STAR + "\n </g>\n <rect\n class=\"fill:black\"\n width=\"70\"\n height=\"20\"\n x=\"205\"\n y=\"305\" />\n </g>"; //Light snow showers var MIN_SHSN = "<g id=\"MIN_SHRA\">\n " + DWN_TRI + "\n <g transform=\"matrix(0.325,0,0,0.3,165,35)\">\n " + STAR + "\n </g>\n </g>"; //Moderate to heavy snow showers var SHSN = "<g id=\"MIN_SHRA\">\n " + DWN_TRI + "\n <g transform=\"matrix(0.325,0,0,0.3,165,35)\">\n " + STAR + "\n </g>\n <rect\n style=\"fill:none;stroke:black;stroke-width:15;\"\n width=\"100\"\n height=\"5\"\n x=\"195\"\n y=\"205\" />\n </g>"; //Light showers with hail, not with thunder var MIN_GR = "<g transform=\"translate(3.1476804,20.168937)\">\n <path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 200,350 80,140 325,140 Z\"\n transform=\"matrix(0.54819594,0,0,1.1522448,135.14291,26.25069)\" />\n <path\n style=\"fill:black;stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 215,106.41301 271.14262,9.7515746 327.2378,105.91474 Z\"\n transform=\"matrix(1.25,0,0,1.2,-90,25)\" />\n </g>"; //Moderate to heavy showers with hail, not with thunder var GR = "<g transform=\"translate(3.1476804,20.168937)\">\n <path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 200,350 80,140 325,140 Z\"\n transform=\"matrix(0.55,0,0,1.15,135,25)\" />\n <path\n style=\"fill:black;stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 215,105 270,10 325,105 Z\"\n transform=\"matrix(1.25,0,0,1.2,-90,25)\" />\n <rect\n style=\"fill:none;stroke:black;stroke-width:15\"\n width=\"95\"\n height=\"5\"\n x=\"200\"\n y=\"235\" />\n </g>"; // THUNDERSTORMS var THUNDER = "<path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\" \n d=\"M 375,425 230,290 355,125 H 125 v 300\"/>\n <path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 250,405 380,425 335,305\"/>"; //Light to moderate thunderstorm with rain var TSRA = " <g transform=\"matrix(0.59808265,0,0,0.58004786,205.87825,107.57905)\">\n <ellipse\n style=\"fill:black\"\n cx=\"75\"\n cy=\"-75\"\n rx=\"70\"\n ry=\"70\" />\n </g>\n " + THUNDER; //Light to moderate thunderstorm with hail var TSGR = "<path\n class=\"wx_graphic\"\n d=\"m 190,45 40,-70 40,70 z\"\n transform=\"matrix(0.8,0,0,0.7,55,60)\" />\n " + THUNDER; //Thunderstorm with heavy rain var PLUS_TSRA = "<g transform=\"matrix(0.6,0,0,0.6,205,105)\">\n <ellipse\n style=\"fill:black\"\n cx=\"75\"\n cy=\"-75\"\n rx=\"70\"\n ry=\"70\" />\n </g>\n <path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"M 235,420 295,350 230,290 355,125 H 125 v 300\" />\n <path\n class=\"wx_graphic\"\n style=\"stroke-linecap:butt;stroke-linejoin:round\"\n d=\"m 240,355 -25,80 80,-20\"/>"; /** * Map of weather abbriviation to SVG data and Full text */ exports.WEATHER = { "FU": { svg: FU_VA, text: "Smoke" }, "VA": { svg: FU_VA, text: "Volcanic Ash" }, "HZ": { svg: HZ, text: "Haze" }, "DU": { svg: DU_SA, text: "Dust" }, "SA": { svg: DU_SA, text: "Sand" }, "BLDU": { svg: BLDU_BLSA, text: "Blowing Dust" }, "BLDA": { svg: BLDU_BLSA, text: "Blowing Sand" }, "PO": { svg: PO, text: "Dust Devil" }, "VCSS": { svg: VCSS, text: "Vicinity Sand Storm" }, "BR": { svg: BR, text: "Mist or light fog" }, "MIFG": { svg: MIFG, text: "Continuous Shallow Fog" }, "VCTS": { svg: VCTS, text: "Vicinity Thunderstorm" }, "VIRGA": { svg: VIRGA, text: "Virga" }, "VCSH": { svg: VCSH, text: "Vicinity showers" }, "TS": { svg: TS, text: "Thunderstorm" }, "SQ": { svg: SQ, text: "Squall" }, "FC": { svg: FC, text: "Funnel Cloud/Tornado" }, "SS": { svg: SS, text: "Sand/Dust Storm" }, "+SS": { svg: PLUS_SS, text: "Strong Sand/Dust Storm" }, "BLSN": { svg: BLSN, text: "Blowing Snow" }, "DRSN": { svg: DRSN, text: "Drifting Snow" }, "VCFG": { svg: VCFG, text: "Vicinity Fog" }, "BCFG": { svg: BCFG, text: "Patchy Fog" }, "PRFG": { svg: PRFG, text: "Fog, Sky Discernable" }, "FG": { svg: FG, text: "Fog, Sky Undiscernable" }, "FZFG": { svg: FZFG, text: "Freezing Fog" }, "-DZ": { svg: MIN_DZ, text: "Light Drizzle" }, "DZ": { svg: DZ, text: "Moderate Drizzle" }, "+DZ": { svg: PLUS_DZ, text: "Heavy Drizzle" }, "-FZDZ": { svg: MIN_FZDZ, text: "Light Freezing Drizzle" }, "FZDZ": { svg: FZDZ, text: "Moderate Freezing Drizzle" }, "+FZDZ": { svg: FZDZ, text: "Heavy Freezing Drizzle" }, "-DZRA": { svg: MIN_DZRA, text: "Light Drizzle & Rain" }, "DZRA": { svg: DZRA, text: "Moderate to Heavy Drizzle & Rain" }, "-RA": { svg: MIN_RA, text: "Light Rain" }, "RA": { svg: RA, text: "Moderate Rain" }, "+RA": { svg: PLUS_RA, text: "Heavy Rain" }, "-FZRA": { svg: MIN_FZRA, text: "Light Freezing Rain" }, "FZRA": { svg: FZRA, text: "Moderate Freezing Rain" }, "+FZRA": { svg: FZRA, text: "Heavy Freezing Rain" }, "-RASN": { svg: MIN_RASN, text: "Light Rain & Snow" }, "RASN": { svg: RASN, text: "Moderate Rain & Snow" }, "+RASN": { svg: RASN, text: "Heavy Rain & Snow" }, "-SN": { svg: MIN_SN, text: "Light Snow" }, "SN": { svg: SN, text: "Moderate Snow" }, "+SN": { svg: PLUS_SN, text: "Heavy Snow" }, "SG": { svg: SG, text: "Snow Grains" }, "IC": { svg: IC, text: "Ice Crystals" }, "PE": { svg: PE_PL, text: "Ice Pellets" }, "PL": { svg: PE_PL, text: "Ice Pellets" }, "-SHRA": { svg: MIN_SHRA, text: "Light rain showers" }, "SHRA": { svg: SHRA, text: "Moderate rain showers" }, "+SHRA": { svg: SHRA, text: "Heavy rain showers" }, "-SHRASN": { svg: MIN_SHRASN, text: "Light rain and snow showers" }, "SHRASN": { svg: SHRASN, text: "Moderate rain and snow showers" }, "+SHRASN": { svg: SHRASN, text: "Heavy rain and snow showers" }, "-SHSN": { svg: MIN_SHSN, text: "Light snow showers" }, "SHSN": { svg: SHSN, text: "Moderate snow showers" }, "+SHSN": { svg: SHSN, text: "Heavy snow showers" }, "-GR": { svg: MIN_GR, text: "Light showers with hail, not with thunder" }, "GR": { svg: GR, text: "Moderate to heavy showers with hail, not with thunder" }, "-TSRA": { svg: TSRA, text: "Light thunderstorm with rain" }, "TSRA": { svg: TSRA, text: "Moderate thunderstorm with rain" }, "-TSGR": { svg: TSGR, text: "Light thunderstorm with hail" }, "TSGR": { svg: TSGR, text: "Moderate thunderstorm with hail" }, "+TSRA": { svg: PLUS_TSRA, text: "Thunderstorm with heavy rain" } }; var RECENT_WEATHER = { REBLSN: "Moderate/heavy blowing snow (visibility significantly reduced)reduced", REDS: "Dust Storm", REFC: "Funnel Cloud", REFZDZ: "Freezing Drizzle", REFZRA: "Freezing Rain", REGP: "Moderate/heavy snow pellets", REGR: "Moderate/heavy hail", REGS: "Moderate/heavy small hail", REIC: "Moderate/heavy ice crystals", REPL: "Moderate/heavy ice pellets", RERA: "Moderate/heavy rain", RESG: "Moderate/heavy snow grains", RESHGR: "Moderate/heavy hail showers", RESHGS: "Moderate/heavy small hail showers", // RESHGS: "Moderate/heavy snow pellet showers", // dual meaning? RESHPL: "Moderate/heavy ice pellet showers", RESHRA: "Moderate/heavy rain showers", RESHSN: "Moderate/heavy snow showers", RESN: "Moderate/heavy snow", RESS: "Sandstorm", RETS: "Thunderstorm", REUP: "Unidentified precipitation (AUTO obs. only)", REVA: "Volcanic Ash", };