@idmui/basic 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Sign/src/index.vue.d.ts +8 -2
- package/dist/index.js +60 -56
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(U,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("moment"),require("vue"),require("@idm-plugin/geo"),require("@idm-plugin/meteo"),require("echarts"),require("mapbox-gl"),require("@idmwx/idmui-gl3")):typeof define=="function"&&define.amd?define(["exports","moment","vue","@idm-plugin/geo","@idm-plugin/meteo","echarts","mapbox-gl","@idmwx/idmui-gl3"],w):(U=typeof globalThis<"u"?globalThis:U||self,w(U["idmui-basic"]={},U.moment,U.Vue,U["@idm-plugin/geo"],U["@idm-plugin/meteo"],U.echarts,U["mapbox-gl"],U["@idmwx/idmui-gl3"]))})(this,function(U,w,e,X,r2,_6,c2,v2){"use strict";function S6(l){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const d=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(a,t,d.get?d:{enumerable:!0,get:()=>l[t]})}}return a.default=l,Object.freeze(a)}const j=S6(_6),x4="",v1=(l,a)=>{const t=l.__vccOpts||l;for(const[d,c]of a)t[d]=c;return t},E6={name:"IdmSign",props:{report:{type:String,default:void 0}},methods:{computeUTCTime(l,a){return w.utc(l).format(a)}}},V6={class:"idm-sign-section"},L6={class:"left-section"},H6={class:"issued-text"},B6={class:"right-section"},C6={class:"tracking-number"};function A6(l,a,t,d,c,i){var h,m,g,p;return e.openBlock(),e.createElementBlock("div",V6,[e.createElementVNode("div",L6,[a[3]||(a[3]=e.createElementVNode("img",{src:"https://osshz.idmwx.com/asset/logo/logo.svg",alt:""},null,-1)),e.createElementVNode("div",H6,[a[0]||(a[0]=e.createTextVNode("Issued by ",-1)),a[1]||(a[1]=e.createElementVNode("b",null,"ORM",-1)),a[2]||(a[2]=e.createTextVNode(" on ",-1)),e.createElementVNode("b",null,e.toDisplayString(i.computeUTCTime(l.issued,"YYYY-MM-DD")),1)])]),e.createElementVNode("div",B6,[a[6]||(a[6]=e.createElementVNode("div",{class:"signature-info"},[e.createTextVNode(" This document is signed electronically. Validation and authentication can be obtained from "),e.createElementVNode("a",{href:"https://nop.ormwx.com/trust",target:"_blank",class:"link"},"trust.ormwx.com"),e.createTextVNode(" by using the Unique Tracking Number. ")],-1)),e.createElementVNode("div",C6,[e.createElementVNode("div",null,[a[4]||(a[4]=e.createTextVNode("VN: ",-1)),e.createElementVNode("b",null,e.toDisplayString(((m=(h=t.report)==null?void 0:h.voyage)==null?void 0:m.number)||"-"),1)]),e.createElementVNode("div",null,[a[5]||(a[5]=e.createTextVNode("ID: ",-1)),e.createElementVNode("b",null,e.toDisplayString(((p=(g=t.report)==null?void 0:g.report)==null?void 0:p.certified)||"-"),1)])]),a[7]||(a[7]=e.createElementVNode("div",{class:"note"}," Please note: The verified report only indicates that it was generated by ORM within a specific temporal context. Final conclusions should be based on the latest report. ",-1)),a[8]||(a[8]=e.createElementVNode("div",{class:"contact"},[e.createTextVNode(" For any questions about the statement, contact "),e.createElementVNode("a",{href:"mailto:op@ormwx.com",class:"link"},"op@ormwx.com"),e.createTextVNode(". ")],-1))])])}const N2=v1(E6,[["render",A6],["__scopeId","data-v-9d0d1fe3"]]),T6={install(l){l.component("IdmSign",N2)}},w4="",I6={name:"IdmBrand",props:{name:{type:String,default:"Weather Forecast Report"},issued:{type:String,default:void 0},locale:{type:String,default:"en"}},methods:{computeUTCTime(l,a){return w.utc(l).format(a)}}},W6={class:"idm-brand-section"},P6={class:"title-box"},O6={class:"issue-box"};function R6(l,a,t,d,c,i){return e.openBlock(),e.createElementBlock("div",W6,[a[0]||(a[0]=e.createElementVNode("div",{class:"logo-box"},[e.createElementVNode("a",{href:"https://nop.ormwx.com/",target:"_blank"},[e.createElementVNode("img",{src:"https://osshz.idmwx.com/asset/logo/logo.svg",alt:""})])],-1)),e.createElementVNode("div",P6,e.toDisplayString(t.name),1),e.createElementVNode("div",O6,[e.createElementVNode("div",null,e.toDisplayString(t.locale==="en"?"Mail to":"联系我们")+": op@ormwx.com",1),e.createElementVNode("div",null,e.toDisplayString(t.locale==="en"?"Issued":"发布时间")+": "+e.toDisplayString(i.computeUTCTime(t.issued,"MMM-DD, YYYY")),1)])])}const D2=v1(I6,[["render",R6],["__scopeId","data-v-46871d08"]]),G6={install(l){l.component("IdmBrand",D2)}},z4="",$6={name:"IdmMeteo",components:{IdmBrand:D2},props:{model:{type:String,default:"meteo"}}},j6={class:"orm-meteo-source"},Y6={key:0,class:"section"},U6={key:1,class:"section"};function Z6(l,a,t,d,c,i){var m,g;const h=e.resolveComponent("IdmBrand");return e.openBlock(),e.createElementBlock("div",j6,[e.createVNode(h,{name:"Data Sources",issued:"2026-01-01"}),["gfs","meteo"].includes((m=t.model)==null?void 0:m.toLowerCase())?(e.openBlock(),e.createElementBlock("div",Y6,[...a[0]||(a[0]=[e.createStaticVNode('<div class="title" data-v-d940c680>Data from NOAA (National Oceanic and Atmospheric Administration)</div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="flex-start" data-v-d940c680><a href="https://www.noaa.gov/about-our-agency" data-v-d940c680><img style="width:60px;" src="https://img.idmwx.com/asset/noaa_digital_logo.svg" alt="" data-v-d940c680></a></div><div class="content" data-v-d940c680> NOAA is an agency that enriches life through science. Our reach goes from the surface of the sun to the depths of the ocean floor as we work to keep the public informed of the changing environment around them. NOAA’s dedicated scientists use cutting-edge research and high-tech instrumentation to provide citizens, planners, emergency managers and other decision makers with reliable information they need, when they need it. </div></div></div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast" target="_blank" data-v-d940c680>Wind</a></div><div class="content" data-v-d940c680> The Global Forecast System (GFS) is a National Centers for Environmental Prediction (NCEP) weather forecast model that generates data for dozens of atmospheric and land-soil variables, including temperatures, winds, precipitation, soil moisture, and atmospheric ozone concentration. The system couples four separate models (atmosphere, ocean model, land/soil model, and sea ice) that work together to accurately depict weather conditions. </div></div></div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://polar.ncep.noaa.gov/waves/Model_Description.pdf" target="_blank" data-v-d940c680>Wave</a></div><div class="content" data-v-d940c680> The NCEP/EMC global deterministic wave model is now unified with the Global Forecast System (GFS). The WAVEWATCH III wave model is one-way coupled with the atmospheric forecast model. The wave model uses three native computational grids: 1) Arctic Polar 9km resolution from 50N to 90N, 2) Global Core 10min resolution from 15S to 52.5N and 3) Southern Ocean 15min resolution from 10.5S to 79.5S. There are 4 post-processed grids: West Coast, Eastern Pacific, Atlantic Ocean all with 0.16deg resolution and a Global grid with 0.25 deg of resolution. </div></div></div>',4)])])):e.createCommentVNode("",!0),["ec","ecmwf","meteo"].includes((g=t.model)==null?void 0:g.toLowerCase())?(e.openBlock(),e.createElementBlock("div",U6,[...a[1]||(a[1]=[e.createStaticVNode('<div class="title" data-v-d940c680>Data from ECMWF(European Centre for Medium-Range Weather Forecasts)</div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="flext-start" data-v-d940c680><a href="https://www.ecmwf.int/en/forecasts/documentation-and-support/changes-ecmwf-model" target="_blank" data-v-d940c680><img src="https://img.idmwx.com/asset/ecmwf_logo.svg" alt="" data-v-d940c680></a></div><div class="content" data-v-d940c680> ECMWF Integrated Forecasting System (IFS), which includes a sophisticated data assimilation system and global numerical model of the Earth system, as well as supporting infrastructure to make forecast products available to our Member and Co-operating States and other users. The data assimilation system combines the latest weather observations with a recent forecast to obtain the best possible estimate of the current state of the Earth system – known as an analysis. The Earth system model has a model of the atmosphere at its heart, coupled to models of other Earth system components, such as the ocean. Starting from the analysis, our Earth system model is then used to forecast the likely evolution of the weather and some other aspects of the Earth system. </div></div><div class="block" data-v-d940c680><div class="flex-end" data-v-d940c680><a href="https://marine.copernicus.eu/about/" target="_blank" data-v-d940c680><img src="https://img.idmwx.com/asset/copermicus_marine_service_logo.png" alt="" data-v-d940c680></a></div><div class="content" data-v-d940c680> The Copernicus Marine Service is the marine component of the European Union’s Copernicus Programme. It provides regular and science-based information on the state of the Ocean at both global and regional scales. This includes data on the physical Ocean (Blue Ocean), sea ice (White Ocean), and Ocean biogeochemistry (Green Ocean). Funded by the European Commission and implemented by Mercator Ocean International, the service supports the implementation of EU policies and International legal Commitments related to Ocean Governance. It also aims to meet the growing demand for reliable Ocean knowledge across society, and to foster sustainable development in the Ocean sectors by providing state-of-the-art Ocean data and forecasts. </div></div></div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://codes.ecmwf.int/grib/param-db/165" target="_blank" data-v-d940c680>Wind</a></div><div class="content" data-v-d940c680> The wind is provided as two orthogonal vectors that can be used to calculate the total speed and direction. 10u is the eastward component of the 10m wind. It is the horizontal speed of air moving towards the east, at a height of ten metres above the surface of the Earth, in metres per second. 10v is the northward component of the 10m wind. It is the horizontal speed of air moving towards the north, at a height of ten metres above the surface of the Earth, in metres per second. </div></div><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://www.ecmwf.int/en/about/media-centre/focus/2020/fact-sheet-ocean-wave-forecasting" target="_blank" data-v-d940c680>Waves</a></div><div class="content" data-v-d940c680> ECMWF ocean wave model (ECWAM) is based on a statistical description of surface waves. It covers both the open ocean and coastal waters. The surface wave field is simplified and represented by a spectrum of waves according to frequency (or wavelength) and direction of propagation. Waves are also divided into those generated by local wind (wind sea waves) and waves which have travelled away from where they were generated (swell). The wave model then simulates how the wave spectrum evolves in space and time by representing how the wind generates waves, how different waves interact with each other, and how wave energy gradually dissipates. </div></div><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://marine.copernicus.eu/sites/default/files/wp-content/uploads/2019/04/Poster_SMOC_EGU2018APRIL.pdf" target="_blank" data-v-d940c680>Currents</a></div><div class="content" data-v-d940c680> SMOC (Surface and Merged Ocean Currents) is a composite surface current product that combines data from the CMEMS modeling systems to reproduce the net velocity felt by a body at sea surface. In SMOC, the total current is obtained by adding together the contributions of the oceanic general circulation, tides and waves. Three independent systems are used to compute the SMOC product: the CMEMS global high resolution (1/12°) real time forecasting system, the CMEMS global waves (1/10°) forecasting system and the FES tidal model. We present here the characteristics of the product together with some validation work based on comparison with observations: firstly, with drifting buoys in Eulerian and Lagrangian mode, and secondly, with in-situ current measurement and coastal radar data. SMOC is distributed on the global domain, with a horizontal resolution of 1/12° and with an hourly frequency. All horizontal components and their sum are provided, so that the user can select and focus on each component individually. SMOC data are computed daily, using one day of hindcast for the previous day, and five days of forecast ahead from the date of production. </div></div></div>',3)])])):e.createCommentVNode("",!0)])}const M2=v1($6,[["render",Z6],["__scopeId","data-v-d940c680"]]),q6={install(l){l.component("IdmMeteo",M2)}},X6={name:"IdmLoading",props:{loading:{type:Boolean,default:!1},text:{type:String,default:"Loading..."}},emits:["timeout"],watch:{loading:{handler(){this.loading&&setTimeout(()=>{this.$emit("timeout",!1)},5e3)},immediate:!0}}},J6={key:0,style:{width:"100%",height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function Q6(l,a,t,d,c,i){return t.loading?(e.openBlock(),e.createElementBlock("div",J6,[...a[0]||(a[0]=[e.createElementVNode("img",{style:{height:"60px"},src:"https://osshz.idmwx.com/asset/loading.gif",alt:""},null,-1)])])):e.createCommentVNode("",!0)}const d2=v1(X6,[["render",Q6]]),K6={install(l){l.component("IdmLoading",d2)}},k4="",e3={name:"IdmForecast",components:{IdmLoading:d2},props:{reportData:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},theme:{type:String,default:"light"},locale:{type:String,default:"en"}},data(){return{positionGmt:void 0,meteogramData:void 0,hourlyTableData:[]}},computed:{computeHourLT(){return l=>{if(l){const a=w.tz(l,this.positionGmt);return`${a==null?void 0:a.format("HH")}`}return"-"}},computeUTCTime(){return(l,a="MMM-DD/HHmm[Z], YYYY")=>{if(l){const t=w(l).utc();return`${t==null?void 0:t.format(a)}`}return"-"}},computeMMMDDHHmmLT(){return(l,a)=>{if(l){const t=w.tz(l,a);return`${t==null?void 0:t.format("MMM-DD/HHmm")}`}return"-"}},computeTzTime(){return(l,a)=>{if(l){const t=w.tz(l,a);return`${t==null?void 0:t.format("yyyy-MM-DD")}`}return"-"}},computeLat(){return(l,a=4)=>X.LngLatHelper.lat2pretty(l,a).pretty},computeLng(){return(l,a=4)=>X.LngLatHelper.lng2pretty(l,a).pretty},roundPrecision(){return(l,a=4)=>isNaN(l)||l===null||l===void 0||isNaN(a)?"-":X.LngLatHelper.roundPrecision(l,a)}},watch:{"reportData.version":{handler(){var l,a,t,d;(l=this.reportData)!=null&&l.version&&(this.positionGmt=(d=(t=(a=this.reportData)==null?void 0:a.weather)==null?void 0:t[0])==null?void 0:d.timezone,this.handleRender())},immediate:!0}},methods:{handleRender(){this.$nextTick(()=>{this.disposeEcharts(),this.handleMeteogramData(this.reportData),this.initHourlyTableData(this.reportData)})},handleMeteogramData(l){var p;const a=l.forecastDays||7,t=l.interval||3,d=a>7?6:a>3?3:t,c=l.datetime||((p=this.reportData)==null?void 0:p.etime);this.meteogramData={xDates:[],dates:[],hours:[],temperatures:[],weatherIcons:[],weatherNames:[],visibility:[],windspeed:[],windGusts:[],windDir:[],windDirIcons:[],windSpeedReferMax:[],precip:[],sigWaveHeight:[],swellHeight:[],waveHeightRefer:[],markarea:[],gridOffset:{l:4,r:4},singleAxisOffset:{}};let i={start:void 0,end:void 0};const h=this.theme==="dark"?"rgba(159, 255, 126, 1)":"rgba(54, 212, 0, 1)",m="data:image/svg+xml;base64,"+window.btoa(`<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="${h}" p-id="10798"></path></svg>`),g=new Image(64,64);g.src=m,g.onload=async()=>{var u,f,L,_,S,H,k,F,N,C,T,I,x,E,P,O,M,z,D,s,R,r,Z,Y,G,J,Q,K,e1,t1,a1,l1,i1,q,v,A,h1,m1,p1,r1,n1,o,x1,S1,E1,V1,L1,H1,B1,C1,A1,T1,I1,W1,P1,O1,R1,G1,$1,j1,Y1;const b=(f=(u=w.tz(c,this.positionGmt))==null?void 0:u.set({hour:0,minute:0,second:0,millisecond:0}))==null?void 0:f.format();for(let o1=0;o1<a*24;o1++)if(o1%t===0){const k1=w(b).clone().add(o1,"h").format();(L=this.meteogramData)==null||L.dates.push(k1);const W=((_=r2.Meteo2Assist.pickHourly(l,k1))==null?void 0:_[0])||{};(H=this.meteogramData)==null||H.temperatures.push(this.roundPrecision((S=W==null?void 0:W.weather)==null?void 0:S.temp,0)),(F=this.meteogramData)==null||F.visibility.push(this.roundPrecision((k=W==null?void 0:W.weather)==null?void 0:k.visibility,1)),(T=this.meteogramData)==null||T.windspeed.push(this.roundPrecision((C=(N=W.weather)==null?void 0:N.wind)==null?void 0:C.kts,1)),(E=this.meteogramData)==null||E.windGusts.push(this.roundPrecision((x=(I=W==null?void 0:W.weather)==null?void 0:I.wind)==null?void 0:x.gusts,1)),(P=this.meteogramData)==null||P.windSpeedReferMax.push(16),(z=this.meteogramData)==null||z.sigWaveHeight.push(this.roundPrecision((M=(O=W==null?void 0:W.wave)==null?void 0:O.sig)==null?void 0:M.height)),(R=this.meteogramData)==null||R.swellHeight.push(this.roundPrecision((s=(D=W==null?void 0:W.wave)==null?void 0:D.swell)==null?void 0:s.height)),(r=this.meteogramData)==null||r.waveHeightRefer.push(1.5);const e2=t===1?"sum1Hours":"sum3Hours";if((G=this.meteogramData)==null||G.precip.push(this.roundPrecision((Y=(Z=W==null?void 0:W.weather)==null?void 0:Z.precip)==null?void 0:Y[e2],1)),t<24&&o1%12===0&&o1%24!==0||t>=24&&o1%24===0?(Q=this.meteogramData)==null||Q.xDates.push((J=w.tz(k1,this.positionGmt))==null?void 0:J.format("MMM-DD")):(K=this.meteogramData)==null||K.xDates.push(""),o1%d===0?(e1=this.meteogramData)==null||e1.hours.push(this.computeHourLT(k1)):(t1=this.meteogramData)==null||t1.hours.push(""),o1%12===0?((a1=W.weather)!=null&&a1.url?(i1=this.meteogramData)==null||i1.weatherIcons.push({symbol:"image://"+((l1=W.weather)==null?void 0:l1.url),symbolSize:30}):this.meteogramData.weatherIcons.push({symbol:"image://",symbolSize:0}),(v=this.meteogramData)==null||v.weatherNames.push((q=W.weather)==null?void 0:q.name)):((A=this.meteogramData)==null||A.weatherIcons.push({symbol:"image://",symbolSize:0}),(h1=this.meteogramData)==null||h1.weatherNames.push("")),o1%d===0?(r1=this.meteogramData)==null||r1.windDir.push((p1=(m1=W.weather)==null?void 0:m1.wind)==null?void 0:p1.bearing):(n1=this.meteogramData)==null||n1.windDir.push(void 0),o1%d===0){const w1=document.createElement("canvas"),F1=w1.getContext("2d");w1.width=g.width,w1.height=g.height;const s1=((x1=(o=W.weather)==null?void 0:o.wind)==null?void 0:x1.bearing)*(Math.PI/180);F1.translate(w1.width/2,w1.height/2),F1.rotate(s1),F1.translate(-g.width/2,-g.height/2),F1.drawImage(g,0,0,64,64);const N1=w1.toDataURL();this.meteogramData.windDirIcons.push({symbol:"image://"+N1,symbolSize:16})}else this.meteogramData.windDirIcons.push({symbol:"image://",symbolSize:0});(S1=W==null?void 0:W.weather)!=null&&S1.isDay?i.end===void 0&&i.start>=0&&(i.end=o1):i.start===void 0&&(i.start=o1),(i.start>=0&&i.end>=0||i.start>=0&&o1===a*24-1)&&((A1=this.meteogramData)==null||A1.markarea.push([{x:((E1=this.meteogramData)==null?void 0:E1.gridOffset.l)+i.start/(a*24)*(100-((V1=this.meteogramData)==null?void 0:V1.gridOffset.l)-((L1=this.meteogramData)==null?void 0:L1.gridOffset.r))+"%"},{x:((H1=this.meteogramData)==null?void 0:H1.gridOffset.l)+(i.end+1)/(a*24)*(100-((B1=this.meteogramData)==null?void 0:B1.gridOffset.l)-((C1=this.meteogramData)==null?void 0:C1.gridOffset.r))+"%"}]),i={start:void 0,end:void 0})}this.meteogramData.singleAxisOffset.l=((T1=this.meteogramData)==null?void 0:T1.gridOffset.l)+.5/((W1=(I1=this.meteogramData)==null?void 0:I1.dates)==null?void 0:W1.length)*(100-((P1=this.meteogramData)==null?void 0:P1.gridOffset.l)-((O1=this.meteogramData)==null?void 0:O1.gridOffset.r))+"%",this.meteogramData.singleAxisOffset.r=((R1=this.meteogramData)==null?void 0:R1.gridOffset.r)+.5/(($1=(G1=this.meteogramData)==null?void 0:G1.dates)==null?void 0:$1.length)*(100-((j1=this.meteogramData)==null?void 0:j1.gridOffset.l)-((Y1=this.meteogramData)==null?void 0:Y1.gridOffset.r))+"%",this.$nextTick(()=>{this.initMeteogramEchart(l)})}},initMeteogramEchart(l){var S,H,k,F,N,C,T,I,x,E,P,O,M,z,D,s,R,r,Z,Y,G,J,Q,K,e1,t1,a1,l1,i1,q,v,A,h1,m1,p1,r1,n1,o,x1,S1,E1,V1,L1,H1,B1,C1,A1,T1,I1,W1,P1,O1,R1,G1,$1,j1,Y1,o1,k1,W,e2,w1,F1,a2,s1,N1,B,i2,M1,t2,n2,o2,s2,h2,m2,p2,g2;l.forecastDays;const a=l.interval||3;let t,d={grid:{show:!0,bottom:"0%",top:"0%",left:`${this.meteogramData.gridOffset.l}%`,right:`${this.meteogramData.gridOffset.r}%`,borderColor:this.theme==="dark"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.4)",borderWidth:1,z:1,zlevel:1},tooltip:{trigger:"item",show:!0,position:"right",formatter:y=>{const z1=y==null?void 0:y.dataIndex;return y.seriesName==="Weather Icons"?`<strong>${this.meteogramData.weatherNames[z1]}</strong>`:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:(S=this.meteogramData)==null?void 0:S.dates,show:!1},singleAxis:[{left:(k=(H=this.meteogramData)==null?void 0:H.singleAxisOffset)==null?void 0:k.l,right:(N=(F=this.meteogramData)==null?void 0:F.singleAxisOffset)==null?void 0:N.r,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:(C=this.meteogramData)==null?void 0:C.dates,top:"50%",height:"2%"}],series:[{name:"Weather Icons",type:"scatter",singleAxisIndex:0,coordinateSystem:"singleAxis",data:(T=this.meteogramData)==null?void 0:T.weatherIcons,symbolSize:24}]};document.getElementById("weatherIconsEchart")&&(t=j.init(document.getElementById("weatherIconsEchart")),t.setOption(d));let c=Math.max(...this.meteogramData.temperatures.filter(y=>typeof y=="number"&&!isNaN(y))),i=Math.min(...this.meteogramData.temperatures.filter(y=>typeof y=="number"&&!isNaN(y))),h=Math.floor(i/5)*5,m=Math.ceil(c/5)*5,g=Math.ceil((m-h)/5);h=Math.floor((h-2*g)/5)*5,m=Math.ceil((m+1)/5)*5,g=Math.ceil((m-h)/5);let p="",b=[];a===1?(p=this.locale==="zhHans"?"1小时降水 ( mm ) ":"Precip.1h ( mm ) ",b=[{gte:8,color:"rgba(248, 1, 1, 1)",label:this.locale==="zhHans"?"暴雨,>7.9mm":"Rainstorm, >7.9mm"},{gte:4,lte:7.9,color:"rgba(190, 226, 2, 18)",label:this.locale==="zhHans"?"大雨,<=7.9mm":"Heavy, <=7.9mm"},{gte:2,lte:3.9,color:"rgba(3, 248, 103, 1)",label:this.locale==="zhHans"?"中雨,<=3.9mm":"Moderate, <=3.9mm"},{lt:2,color:"rgba(172, 210, 255, 1)",label:this.locale==="zhHans"?"小雨,<2mm":"Light, <2mm"}]):(p=this.locale==="zhHans"?"3小时降水 ( mm ) ":"Precip.3h ( mm ) ",b=[{gte:25,color:"rgba(248, 1, 1, 1)",label:this.locale==="zhHans"?"暴雨,>24.9mm":"Rainstorm, >24.9mm"},{gte:10,lte:24.9,color:"rgba(190, 226, 2, 18)",label:this.locale==="zhHans"?"大雨,<=24.9mm":"Heavy, <=24.9mm"},{gte:5,lte:9.9,color:"rgba(3, 248, 103, 1)",label:this.locale==="zhHans"?"中雨,<=9.9mm":"Moderate, <=9.9mm"},{lt:5,color:"rgba(172, 210, 255, 1)",label:this.locale==="zhHans"?"小雨,<5mm":"Light, <5mm"}]);let u;d={title:{text:this.locale==="zhHans"?"天气情况":"Weather Conditions",top:"10px",left:0,textStyle:{fontWeight:"500",fontSize:16,color:this.theme==="dark"?"rgba(255, 255, 255, 1)":"rgba(28,31,35,1)"}},grid:{show:!0,bottom:"20%",top:"70px",left:`${this.meteogramData.gridOffset.l}%`,right:`${this.meteogramData.gridOffset.r}%`,borderColor:this.theme==="dark"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.4)",borderWidth:1,z:1,zlevel:1},tooltip:{trigger:"axis",show:!0,position:"right",formatter:y=>{var U1,Z1,q1,X1,J1,Q1,$,y2,f2,b2,u2,x2,w2,z2,k2,F2;const z1=(U1=y==null?void 0:y.find(c1=>c1.seriesType==="bar"))==null?void 0:U1.dataIndex;if(y.find(c1=>c1.seriesType==="scatter"))return!1;{let c1="";const K1=(Z1=y==null?void 0:y.find(g1=>g1.seriesName==="Precipitation"||g1.seriesName==="降水"))==null?void 0:Z1.value;return a===1?(K1<2?c1="rgba(172, 210, 255, 1)":K1<=3.9?c1="rgba(3, 248, 103, 1)":K1<=7.9?c1="rgba(190, 226, 2, 18)":K1>7.9?c1="rgba(248, 1, 1, 1)":c1="rgba(172, 210, 255, 1)",`<div style="font-size: 13px;"><strong>${w.tz((q1=this.meteogramData)==null?void 0:q1.dates[z1],this.positionGmt).format("MMM-DD/HHmm[LT]")}</strong></div>
|
|
1
|
+
(function(U,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("moment"),require("vue"),require("@idm-plugin/geo"),require("@idm-plugin/meteo"),require("echarts"),require("mapbox-gl"),require("@idmwx/idmui-gl3")):typeof define=="function"&&define.amd?define(["exports","moment","vue","@idm-plugin/geo","@idm-plugin/meteo","echarts","mapbox-gl","@idmwx/idmui-gl3"],w):(U=typeof globalThis<"u"?globalThis:U||self,w(U["idmui-basic"]={},U.moment,U.Vue,U["@idm-plugin/geo"],U["@idm-plugin/meteo"],U.echarts,U["mapbox-gl"],U["@idmwx/idmui-gl3"]))})(this,function(U,w,e,X,r2,_6,c2,v2){"use strict";function S6(l){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const d=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(a,t,d.get?d:{enumerable:!0,get:()=>l[t]})}}return a.default=l,Object.freeze(a)}const j=S6(_6),x4="",v1=(l,a)=>{const t=l.__vccOpts||l;for(const[d,c]of a)t[d]=c;return t},E6={name:"IdmSign",props:{issued:{type:String,default:""},report:{type:Object,default:()=>({})}},methods:{computeUTCTime(l,a){return w.utc(l).format(a)}}},V6={class:"idm-sign-section"},L6={class:"left-section"},H6={class:"issued-text"},B6={class:"right-section"},C6={class:"tracking-number"};function A6(l,a,t,d,c,i){var h,m,g,p;return e.openBlock(),e.createElementBlock("div",V6,[e.createElementVNode("div",L6,[a[3]||(a[3]=e.createElementVNode("img",{src:"https://osshz.idmwx.com/asset/logo/logo.svg",alt:""},null,-1)),e.createElementVNode("div",H6,[a[0]||(a[0]=e.createTextVNode("Issued by ",-1)),a[1]||(a[1]=e.createElementVNode("b",null,"ORM",-1)),a[2]||(a[2]=e.createTextVNode(" on ",-1)),e.createElementVNode("b",null,e.toDisplayString(i.computeUTCTime(t.issued,"YYYY-MM-DD")),1)])]),e.createElementVNode("div",B6,[a[6]||(a[6]=e.createElementVNode("div",{class:"signature-info"},[e.createTextVNode(" This document is signed electronically. Validation and authentication can be obtained from "),e.createElementVNode("a",{href:"https://nop.ormwx.com/trust",target:"_blank",class:"link"},"trust.ormwx.com"),e.createTextVNode(" by using the Unique Tracking Number. ")],-1)),e.createElementVNode("div",C6,[e.createElementVNode("div",null,[a[4]||(a[4]=e.createTextVNode("VN: ",-1)),e.createElementVNode("b",null,e.toDisplayString(((m=(h=t.report)==null?void 0:h.voyage)==null?void 0:m.number)||"-"),1)]),e.createElementVNode("div",null,[a[5]||(a[5]=e.createTextVNode("ID: ",-1)),e.createElementVNode("b",null,e.toDisplayString(((p=(g=t.report)==null?void 0:g.report)==null?void 0:p.certified)||"-"),1)])]),a[7]||(a[7]=e.createElementVNode("div",{class:"note"}," Please note: The verified report only indicates that it was generated by ORM within a specific temporal context. Final conclusions should be based on the latest report. ",-1)),a[8]||(a[8]=e.createElementVNode("div",{class:"contact"},[e.createTextVNode(" For any questions about the statement, contact "),e.createElementVNode("a",{href:"mailto:op@ormwx.com",class:"link"},"op@ormwx.com"),e.createTextVNode(". ")],-1))])])}const N2=v1(E6,[["render",A6],["__scopeId","data-v-ab0dcb10"]]),T6={install(l){l.component("IdmSign",N2)}},w4="",I6={name:"IdmBrand",props:{name:{type:String,default:"Weather Forecast Report"},issued:{type:String,default:void 0},locale:{type:String,default:"en"}},methods:{computeUTCTime(l,a){return w.utc(l).format(a)}}},W6={class:"idm-brand-section"},P6={class:"title-box"},O6={class:"issue-box"};function R6(l,a,t,d,c,i){return e.openBlock(),e.createElementBlock("div",W6,[a[0]||(a[0]=e.createElementVNode("div",{class:"logo-box"},[e.createElementVNode("a",{href:"https://nop.ormwx.com/",target:"_blank"},[e.createElementVNode("img",{src:"https://osshz.idmwx.com/asset/logo/logo.svg",alt:""})])],-1)),e.createElementVNode("div",P6,e.toDisplayString(t.name),1),e.createElementVNode("div",O6,[e.createElementVNode("div",null,e.toDisplayString(t.locale==="en"?"Mail to":"联系我们")+": op@ormwx.com",1),e.createElementVNode("div",null,e.toDisplayString(t.locale==="en"?"Issued":"发布时间")+": "+e.toDisplayString(i.computeUTCTime(t.issued,"MMM-DD, YYYY")),1)])])}const D2=v1(I6,[["render",R6],["__scopeId","data-v-46871d08"]]),G6={install(l){l.component("IdmBrand",D2)}},z4="",$6={name:"IdmMeteo",components:{IdmBrand:D2},props:{model:{type:String,default:"meteo"}}},j6={class:"orm-meteo-source"},Y6={key:0,class:"section"},U6={key:1,class:"section"};function Z6(l,a,t,d,c,i){var m,g;const h=e.resolveComponent("IdmBrand");return e.openBlock(),e.createElementBlock("div",j6,[e.createVNode(h,{name:"Data Sources",issued:"2026-01-01"}),["gfs","meteo"].includes((m=t.model)==null?void 0:m.toLowerCase())?(e.openBlock(),e.createElementBlock("div",Y6,[...a[0]||(a[0]=[e.createStaticVNode('<div class="title" data-v-d940c680>Data from NOAA (National Oceanic and Atmospheric Administration)</div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="flex-start" data-v-d940c680><a href="https://www.noaa.gov/about-our-agency" data-v-d940c680><img style="width:60px;" src="https://img.idmwx.com/asset/noaa_digital_logo.svg" alt="" data-v-d940c680></a></div><div class="content" data-v-d940c680> NOAA is an agency that enriches life through science. Our reach goes from the surface of the sun to the depths of the ocean floor as we work to keep the public informed of the changing environment around them. NOAA’s dedicated scientists use cutting-edge research and high-tech instrumentation to provide citizens, planners, emergency managers and other decision makers with reliable information they need, when they need it. </div></div></div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://www.ncei.noaa.gov/products/weather-climate-models/global-forecast" target="_blank" data-v-d940c680>Wind</a></div><div class="content" data-v-d940c680> The Global Forecast System (GFS) is a National Centers for Environmental Prediction (NCEP) weather forecast model that generates data for dozens of atmospheric and land-soil variables, including temperatures, winds, precipitation, soil moisture, and atmospheric ozone concentration. The system couples four separate models (atmosphere, ocean model, land/soil model, and sea ice) that work together to accurately depict weather conditions. </div></div></div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://polar.ncep.noaa.gov/waves/Model_Description.pdf" target="_blank" data-v-d940c680>Wave</a></div><div class="content" data-v-d940c680> The NCEP/EMC global deterministic wave model is now unified with the Global Forecast System (GFS). The WAVEWATCH III wave model is one-way coupled with the atmospheric forecast model. The wave model uses three native computational grids: 1) Arctic Polar 9km resolution from 50N to 90N, 2) Global Core 10min resolution from 15S to 52.5N and 3) Southern Ocean 15min resolution from 10.5S to 79.5S. There are 4 post-processed grids: West Coast, Eastern Pacific, Atlantic Ocean all with 0.16deg resolution and a Global grid with 0.25 deg of resolution. </div></div></div>',4)])])):e.createCommentVNode("",!0),["ec","ecmwf","meteo"].includes((g=t.model)==null?void 0:g.toLowerCase())?(e.openBlock(),e.createElementBlock("div",U6,[...a[1]||(a[1]=[e.createStaticVNode('<div class="title" data-v-d940c680>Data from ECMWF(European Centre for Medium-Range Weather Forecasts)</div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="flext-start" data-v-d940c680><a href="https://www.ecmwf.int/en/forecasts/documentation-and-support/changes-ecmwf-model" target="_blank" data-v-d940c680><img src="https://img.idmwx.com/asset/ecmwf_logo.svg" alt="" data-v-d940c680></a></div><div class="content" data-v-d940c680> ECMWF Integrated Forecasting System (IFS), which includes a sophisticated data assimilation system and global numerical model of the Earth system, as well as supporting infrastructure to make forecast products available to our Member and Co-operating States and other users. The data assimilation system combines the latest weather observations with a recent forecast to obtain the best possible estimate of the current state of the Earth system – known as an analysis. The Earth system model has a model of the atmosphere at its heart, coupled to models of other Earth system components, such as the ocean. Starting from the analysis, our Earth system model is then used to forecast the likely evolution of the weather and some other aspects of the Earth system. </div></div><div class="block" data-v-d940c680><div class="flex-end" data-v-d940c680><a href="https://marine.copernicus.eu/about/" target="_blank" data-v-d940c680><img src="https://img.idmwx.com/asset/copermicus_marine_service_logo.png" alt="" data-v-d940c680></a></div><div class="content" data-v-d940c680> The Copernicus Marine Service is the marine component of the European Union’s Copernicus Programme. It provides regular and science-based information on the state of the Ocean at both global and regional scales. This includes data on the physical Ocean (Blue Ocean), sea ice (White Ocean), and Ocean biogeochemistry (Green Ocean). Funded by the European Commission and implemented by Mercator Ocean International, the service supports the implementation of EU policies and International legal Commitments related to Ocean Governance. It also aims to meet the growing demand for reliable Ocean knowledge across society, and to foster sustainable development in the Ocean sectors by providing state-of-the-art Ocean data and forecasts. </div></div></div><div class="body" data-v-d940c680><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://codes.ecmwf.int/grib/param-db/165" target="_blank" data-v-d940c680>Wind</a></div><div class="content" data-v-d940c680> The wind is provided as two orthogonal vectors that can be used to calculate the total speed and direction. 10u is the eastward component of the 10m wind. It is the horizontal speed of air moving towards the east, at a height of ten metres above the surface of the Earth, in metres per second. 10v is the northward component of the 10m wind. It is the horizontal speed of air moving towards the north, at a height of ten metres above the surface of the Earth, in metres per second. </div></div><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://www.ecmwf.int/en/about/media-centre/focus/2020/fact-sheet-ocean-wave-forecasting" target="_blank" data-v-d940c680>Waves</a></div><div class="content" data-v-d940c680> ECMWF ocean wave model (ECWAM) is based on a statistical description of surface waves. It covers both the open ocean and coastal waters. The surface wave field is simplified and represented by a spectrum of waves according to frequency (or wavelength) and direction of propagation. Waves are also divided into those generated by local wind (wind sea waves) and waves which have travelled away from where they were generated (swell). The wave model then simulates how the wave spectrum evolves in space and time by representing how the wind generates waves, how different waves interact with each other, and how wave energy gradually dissipates. </div></div><div class="block" data-v-d940c680><div class="title" data-v-d940c680><a href="https://marine.copernicus.eu/sites/default/files/wp-content/uploads/2019/04/Poster_SMOC_EGU2018APRIL.pdf" target="_blank" data-v-d940c680>Currents</a></div><div class="content" data-v-d940c680> SMOC (Surface and Merged Ocean Currents) is a composite surface current product that combines data from the CMEMS modeling systems to reproduce the net velocity felt by a body at sea surface. In SMOC, the total current is obtained by adding together the contributions of the oceanic general circulation, tides and waves. Three independent systems are used to compute the SMOC product: the CMEMS global high resolution (1/12°) real time forecasting system, the CMEMS global waves (1/10°) forecasting system and the FES tidal model. We present here the characteristics of the product together with some validation work based on comparison with observations: firstly, with drifting buoys in Eulerian and Lagrangian mode, and secondly, with in-situ current measurement and coastal radar data. SMOC is distributed on the global domain, with a horizontal resolution of 1/12° and with an hourly frequency. All horizontal components and their sum are provided, so that the user can select and focus on each component individually. SMOC data are computed daily, using one day of hindcast for the previous day, and five days of forecast ahead from the date of production. </div></div></div>',3)])])):e.createCommentVNode("",!0)])}const M2=v1($6,[["render",Z6],["__scopeId","data-v-d940c680"]]),q6={install(l){l.component("IdmMeteo",M2)}},X6={name:"IdmLoading",props:{loading:{type:Boolean,default:!1},text:{type:String,default:"Loading..."}},emits:["timeout"],watch:{loading:{handler(){this.loading&&setTimeout(()=>{this.$emit("timeout",!1)},5e3)},immediate:!0}}},J6={key:0,style:{width:"100%",height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function Q6(l,a,t,d,c,i){return t.loading?(e.openBlock(),e.createElementBlock("div",J6,[...a[0]||(a[0]=[e.createElementVNode("img",{style:{height:"60px"},src:"https://osshz.idmwx.com/asset/loading.gif",alt:""},null,-1)])])):e.createCommentVNode("",!0)}const d2=v1(X6,[["render",Q6]]),K6={install(l){l.component("IdmLoading",d2)}},k4="",e3={name:"IdmForecast",components:{IdmLoading:d2},props:{reportData:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},theme:{type:String,default:"light"},locale:{type:String,default:"en"}},data(){return{positionGmt:void 0,meteogramData:void 0,hourlyTableData:[]}},computed:{computeHourLT(){return l=>{if(l){const a=w.tz(l,this.positionGmt);return`${a==null?void 0:a.format("HH")}`}return"-"}},computeUTCTime(){return(l,a="MMM-DD/HHmm[Z], YYYY")=>{if(l){const t=w(l).utc();return`${t==null?void 0:t.format(a)}`}return"-"}},computeMMMDDHHmmLT(){return(l,a)=>{if(l){const t=w.tz(l,a);return`${t==null?void 0:t.format("MMM-DD/HHmm")}`}return"-"}},computeTzTime(){return(l,a)=>{if(l){const t=w.tz(l,a);return`${t==null?void 0:t.format("yyyy-MM-DD")}`}return"-"}},computeLat(){return(l,a=4)=>X.LngLatHelper.lat2pretty(l,a).pretty},computeLng(){return(l,a=4)=>X.LngLatHelper.lng2pretty(l,a).pretty},roundPrecision(){return(l,a=4)=>isNaN(l)||l===null||l===void 0||isNaN(a)?"-":X.LngLatHelper.roundPrecision(l,a)}},watch:{"reportData.version":{handler(){var l,a,t,d;(l=this.reportData)!=null&&l.version&&(this.positionGmt=(d=(t=(a=this.reportData)==null?void 0:a.weather)==null?void 0:t[0])==null?void 0:d.timezone,this.handleRender())},immediate:!0}},methods:{handleRender(){this.$nextTick(()=>{this.disposeEcharts(),this.handleMeteogramData(this.reportData),this.initHourlyTableData(this.reportData)})},handleMeteogramData(l){var p;const a=l.forecastDays||7,t=l.interval||3,d=a>7?6:a>3?3:t,c=l.datetime||((p=this.reportData)==null?void 0:p.etime);this.meteogramData={xDates:[],dates:[],hours:[],temperatures:[],weatherIcons:[],weatherNames:[],visibility:[],windspeed:[],windGusts:[],windDir:[],windDirIcons:[],windSpeedReferMax:[],precip:[],sigWaveHeight:[],swellHeight:[],waveHeightRefer:[],markarea:[],gridOffset:{l:4,r:4},singleAxisOffset:{}};let i={start:void 0,end:void 0};const h=this.theme==="dark"?"rgba(159, 255, 126, 1)":"rgba(54, 212, 0, 1)",m="data:image/svg+xml;base64,"+window.btoa(`<svg t="1740383449285" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10797" width="200" height="200"><path d="M133.8 579l-44.4-44.4c-18.8-18.8-18.8-49.2 0-67.8L478 78c18.8-18.8 49.2-18.8 67.8 0l388.6 388.6c18.8 18.8 18.8 49.2 0 67.8L890 578.8c-19 19-50 18.6-68.6-0.8L592 337.2V912c0 26.6-21.4 48-48 48h-64c-26.6 0-48-21.4-48-48V337.2L202.4 578.2c-18.6 19.6-49.6 20-68.6 0.8z" fill="${h}" p-id="10798"></path></svg>`),g=new Image(64,64);g.src=m,g.onload=async()=>{var u,f,L,_,S,H,k,F,N,C,T,I,x,E,P,O,M,z,D,s,R,r,Z,Y,G,J,Q,K,e1,t1,a1,l1,i1,q,v,A,h1,m1,p1,r1,n1,o,x1,S1,E1,V1,L1,H1,B1,C1,A1,T1,I1,W1,P1,O1,R1,G1,$1,j1,Y1;const b=(f=(u=w.tz(c,this.positionGmt))==null?void 0:u.set({hour:0,minute:0,second:0,millisecond:0}))==null?void 0:f.format();for(let o1=0;o1<a*24;o1++)if(o1%t===0){const k1=w(b).clone().add(o1,"h").format();(L=this.meteogramData)==null||L.dates.push(k1);const W=((_=r2.Meteo2Assist.pickHourly(l,k1))==null?void 0:_[0])||{};(H=this.meteogramData)==null||H.temperatures.push(this.roundPrecision((S=W==null?void 0:W.weather)==null?void 0:S.temp,0)),(F=this.meteogramData)==null||F.visibility.push(this.roundPrecision((k=W==null?void 0:W.weather)==null?void 0:k.visibility,1)),(T=this.meteogramData)==null||T.windspeed.push(this.roundPrecision((C=(N=W.weather)==null?void 0:N.wind)==null?void 0:C.kts,1)),(E=this.meteogramData)==null||E.windGusts.push(this.roundPrecision((x=(I=W==null?void 0:W.weather)==null?void 0:I.wind)==null?void 0:x.gusts,1)),(P=this.meteogramData)==null||P.windSpeedReferMax.push(16),(z=this.meteogramData)==null||z.sigWaveHeight.push(this.roundPrecision((M=(O=W==null?void 0:W.wave)==null?void 0:O.sig)==null?void 0:M.height)),(R=this.meteogramData)==null||R.swellHeight.push(this.roundPrecision((s=(D=W==null?void 0:W.wave)==null?void 0:D.swell)==null?void 0:s.height)),(r=this.meteogramData)==null||r.waveHeightRefer.push(1.5);const e2=t===1?"sum1Hours":"sum3Hours";if((G=this.meteogramData)==null||G.precip.push(this.roundPrecision((Y=(Z=W==null?void 0:W.weather)==null?void 0:Z.precip)==null?void 0:Y[e2],1)),t<24&&o1%12===0&&o1%24!==0||t>=24&&o1%24===0?(Q=this.meteogramData)==null||Q.xDates.push((J=w.tz(k1,this.positionGmt))==null?void 0:J.format("MMM-DD")):(K=this.meteogramData)==null||K.xDates.push(""),o1%d===0?(e1=this.meteogramData)==null||e1.hours.push(this.computeHourLT(k1)):(t1=this.meteogramData)==null||t1.hours.push(""),o1%12===0?((a1=W.weather)!=null&&a1.url?(i1=this.meteogramData)==null||i1.weatherIcons.push({symbol:"image://"+((l1=W.weather)==null?void 0:l1.url),symbolSize:30}):this.meteogramData.weatherIcons.push({symbol:"image://",symbolSize:0}),(v=this.meteogramData)==null||v.weatherNames.push((q=W.weather)==null?void 0:q.name)):((A=this.meteogramData)==null||A.weatherIcons.push({symbol:"image://",symbolSize:0}),(h1=this.meteogramData)==null||h1.weatherNames.push("")),o1%d===0?(r1=this.meteogramData)==null||r1.windDir.push((p1=(m1=W.weather)==null?void 0:m1.wind)==null?void 0:p1.bearing):(n1=this.meteogramData)==null||n1.windDir.push(void 0),o1%d===0){const w1=document.createElement("canvas"),F1=w1.getContext("2d");w1.width=g.width,w1.height=g.height;const s1=((x1=(o=W.weather)==null?void 0:o.wind)==null?void 0:x1.bearing)*(Math.PI/180);F1.translate(w1.width/2,w1.height/2),F1.rotate(s1),F1.translate(-g.width/2,-g.height/2),F1.drawImage(g,0,0,64,64);const N1=w1.toDataURL();this.meteogramData.windDirIcons.push({symbol:"image://"+N1,symbolSize:16})}else this.meteogramData.windDirIcons.push({symbol:"image://",symbolSize:0});(S1=W==null?void 0:W.weather)!=null&&S1.isDay?i.end===void 0&&i.start>=0&&(i.end=o1):i.start===void 0&&(i.start=o1),(i.start>=0&&i.end>=0||i.start>=0&&o1===a*24-1)&&((A1=this.meteogramData)==null||A1.markarea.push([{x:((E1=this.meteogramData)==null?void 0:E1.gridOffset.l)+i.start/(a*24)*(100-((V1=this.meteogramData)==null?void 0:V1.gridOffset.l)-((L1=this.meteogramData)==null?void 0:L1.gridOffset.r))+"%"},{x:((H1=this.meteogramData)==null?void 0:H1.gridOffset.l)+(i.end+1)/(a*24)*(100-((B1=this.meteogramData)==null?void 0:B1.gridOffset.l)-((C1=this.meteogramData)==null?void 0:C1.gridOffset.r))+"%"}]),i={start:void 0,end:void 0})}this.meteogramData.singleAxisOffset.l=((T1=this.meteogramData)==null?void 0:T1.gridOffset.l)+.5/((W1=(I1=this.meteogramData)==null?void 0:I1.dates)==null?void 0:W1.length)*(100-((P1=this.meteogramData)==null?void 0:P1.gridOffset.l)-((O1=this.meteogramData)==null?void 0:O1.gridOffset.r))+"%",this.meteogramData.singleAxisOffset.r=((R1=this.meteogramData)==null?void 0:R1.gridOffset.r)+.5/(($1=(G1=this.meteogramData)==null?void 0:G1.dates)==null?void 0:$1.length)*(100-((j1=this.meteogramData)==null?void 0:j1.gridOffset.l)-((Y1=this.meteogramData)==null?void 0:Y1.gridOffset.r))+"%",this.$nextTick(()=>{this.initMeteogramEchart(l)})}},initMeteogramEchart(l){var S,H,k,F,N,C,T,I,x,E,P,O,M,z,D,s,R,r,Z,Y,G,J,Q,K,e1,t1,a1,l1,i1,q,v,A,h1,m1,p1,r1,n1,o,x1,S1,E1,V1,L1,H1,B1,C1,A1,T1,I1,W1,P1,O1,R1,G1,$1,j1,Y1,o1,k1,W,e2,w1,F1,a2,s1,N1,B,i2,M1,t2,n2,o2,s2,h2,m2,p2,g2;l.forecastDays;const a=l.interval||3;let t,d={grid:{show:!0,bottom:"0%",top:"0%",left:`${this.meteogramData.gridOffset.l}%`,right:`${this.meteogramData.gridOffset.r}%`,borderColor:this.theme==="dark"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.4)",borderWidth:1,z:1,zlevel:1},tooltip:{trigger:"item",show:!0,position:"right",formatter:y=>{const z1=y==null?void 0:y.dataIndex;return y.seriesName==="Weather Icons"?`<strong>${this.meteogramData.weatherNames[z1]}</strong>`:!1}},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:(S=this.meteogramData)==null?void 0:S.dates,show:!1},singleAxis:[{left:(k=(H=this.meteogramData)==null?void 0:H.singleAxisOffset)==null?void 0:k.l,right:(N=(F=this.meteogramData)==null?void 0:F.singleAxisOffset)==null?void 0:N.r,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:(C=this.meteogramData)==null?void 0:C.dates,top:"50%",height:"2%"}],series:[{name:"Weather Icons",type:"scatter",singleAxisIndex:0,coordinateSystem:"singleAxis",data:(T=this.meteogramData)==null?void 0:T.weatherIcons,symbolSize:24}]};document.getElementById("weatherIconsEchart")&&(t=j.init(document.getElementById("weatherIconsEchart")),t.setOption(d));let c=Math.max(...this.meteogramData.temperatures.filter(y=>typeof y=="number"&&!isNaN(y))),i=Math.min(...this.meteogramData.temperatures.filter(y=>typeof y=="number"&&!isNaN(y))),h=Math.floor(i/5)*5,m=Math.ceil(c/5)*5,g=Math.ceil((m-h)/5);h=Math.floor((h-2*g)/5)*5,m=Math.ceil((m+1)/5)*5,g=Math.ceil((m-h)/5);let p="",b=[];a===1?(p=this.locale==="zhHans"?"1小时降水 ( mm ) ":"Precip.1h ( mm ) ",b=[{gte:8,color:"rgba(248, 1, 1, 1)",label:this.locale==="zhHans"?"暴雨,>7.9mm":"Rainstorm, >7.9mm"},{gte:4,lte:7.9,color:"rgba(190, 226, 2, 18)",label:this.locale==="zhHans"?"大雨,<=7.9mm":"Heavy, <=7.9mm"},{gte:2,lte:3.9,color:"rgba(3, 248, 103, 1)",label:this.locale==="zhHans"?"中雨,<=3.9mm":"Moderate, <=3.9mm"},{lt:2,color:"rgba(172, 210, 255, 1)",label:this.locale==="zhHans"?"小雨,<2mm":"Light, <2mm"}]):(p=this.locale==="zhHans"?"3小时降水 ( mm ) ":"Precip.3h ( mm ) ",b=[{gte:25,color:"rgba(248, 1, 1, 1)",label:this.locale==="zhHans"?"暴雨,>24.9mm":"Rainstorm, >24.9mm"},{gte:10,lte:24.9,color:"rgba(190, 226, 2, 18)",label:this.locale==="zhHans"?"大雨,<=24.9mm":"Heavy, <=24.9mm"},{gte:5,lte:9.9,color:"rgba(3, 248, 103, 1)",label:this.locale==="zhHans"?"中雨,<=9.9mm":"Moderate, <=9.9mm"},{lt:5,color:"rgba(172, 210, 255, 1)",label:this.locale==="zhHans"?"小雨,<5mm":"Light, <5mm"}]);let u;d={title:{text:this.locale==="zhHans"?"天气情况":"Weather Conditions",top:"10px",left:0,textStyle:{fontWeight:"500",fontSize:16,color:this.theme==="dark"?"rgba(255, 255, 255, 1)":"rgba(28,31,35,1)"}},grid:{show:!0,bottom:"20%",top:"70px",left:`${this.meteogramData.gridOffset.l}%`,right:`${this.meteogramData.gridOffset.r}%`,borderColor:this.theme==="dark"?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.4)",borderWidth:1,z:1,zlevel:1},tooltip:{trigger:"axis",show:!0,position:"right",formatter:y=>{var U1,Z1,q1,X1,J1,Q1,$,y2,f2,b2,u2,x2,w2,z2,k2,F2;const z1=(U1=y==null?void 0:y.find(c1=>c1.seriesType==="bar"))==null?void 0:U1.dataIndex;if(y.find(c1=>c1.seriesType==="scatter"))return!1;{let c1="";const K1=(Z1=y==null?void 0:y.find(g1=>g1.seriesName==="Precipitation"||g1.seriesName==="降水"))==null?void 0:Z1.value;return a===1?(K1<2?c1="rgba(172, 210, 255, 1)":K1<=3.9?c1="rgba(3, 248, 103, 1)":K1<=7.9?c1="rgba(190, 226, 2, 18)":K1>7.9?c1="rgba(248, 1, 1, 1)":c1="rgba(172, 210, 255, 1)",`<div style="font-size: 13px;"><strong>${w.tz((q1=this.meteogramData)==null?void 0:q1.dates[z1],this.positionGmt).format("MMM-DD/HHmm[LT]")}</strong></div>
|
|
2
2
|
<div style="display: ${(X1=this.meteogramData)!=null&&X1.weatherNames[z1]?"block":"none"}; font-size: 13px;">
|
|
3
3
|
<span>${this.locale==="zhHans"?"天气":"Weather"} : </span><strong>${(J1=this.meteogramData)==null?void 0:J1.weatherNames[z1]}</strong>
|
|
4
4
|
</div>
|