@idmui/spot 0.3.0 → 0.3.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/index.js +75 -60
- package/dist/index.umd.cjs +8 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import me from "moment";
|
|
2
|
-
import
|
|
2
|
+
import he from "moment-timezone";
|
|
3
3
|
import { Search as He } from "@element-plus/icons-vue";
|
|
4
4
|
import { LngLatHelper as ve } from "@idm-plugin/geo";
|
|
5
5
|
import * as pe from "echarts";
|
|
@@ -7,8 +7,8 @@ import { markRaw as Pe, resolveComponent as ye, openBlock as i, createElementBlo
|
|
|
7
7
|
import be from "axios";
|
|
8
8
|
class De {
|
|
9
9
|
static pickHourly(e, t) {
|
|
10
|
-
var n, s, f, L, z,
|
|
11
|
-
const re = typeof t == "string" ? me(t) : t, ie = e == null ? void 0 : e.weather, se = e == null ? void 0 : e.marine, le = me((s = (n = ie == null ? void 0 : ie[0]) == null ? void 0 : n.hourly) == null ? void 0 : s.date).utc(), c = le.clone().add((z = (L = (f = ie == null ? void 0 : ie[0]) == null ? void 0 : f.hourly) == null ? void 0 : L.time) == null ? void 0 : z.at(0), "h"), ue = le.clone().add((b = (
|
|
10
|
+
var n, s, f, L, z, E, Q, b, M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe, Ae, ae, r, ge, de, we, C, ne, d, $, ee, g, te;
|
|
11
|
+
const re = typeof t == "string" ? me(t) : t, ie = e == null ? void 0 : e.weather, se = e == null ? void 0 : e.marine, le = me((s = (n = ie == null ? void 0 : ie[0]) == null ? void 0 : n.hourly) == null ? void 0 : s.date).utc(), c = le.clone().add((z = (L = (f = ie == null ? void 0 : ie[0]) == null ? void 0 : f.hourly) == null ? void 0 : L.time) == null ? void 0 : z.at(0), "h"), ue = le.clone().add((b = (Q = (E = ie == null ? void 0 : ie[0]) == null ? void 0 : E.hourly) == null ? void 0 : Q.time) == null ? void 0 : b.at(-1), "h"), m = [];
|
|
12
12
|
if (re.isBetween(c, ue, "millisecond", "[]")) {
|
|
13
13
|
const p = re.utc().diff(c, "h", !1);
|
|
14
14
|
let ce, Be;
|
|
@@ -61,8 +61,8 @@ class De {
|
|
|
61
61
|
wd: {
|
|
62
62
|
height: (ae = B.wind_wave_height) == null ? void 0 : ae.at(p),
|
|
63
63
|
degree: (r = B.wind_wave_direction) == null ? void 0 : r.at(p),
|
|
64
|
-
bearing: ((
|
|
65
|
-
period: (
|
|
64
|
+
bearing: ((ge = B.wind_wave_direction) == null ? void 0 : ge.at(p)) !== null ? (((de = B.wind_wave_direction) == null ? void 0 : de.at(p)) + 180) % 360 : null,
|
|
65
|
+
period: (we = B.wind_wave_period) == null ? void 0 : we.at(p),
|
|
66
66
|
peakPeriod: (C = B.wind_wave_peak_period) == null ? void 0 : C.at(p)
|
|
67
67
|
}
|
|
68
68
|
},
|
|
@@ -85,7 +85,7 @@ class De {
|
|
|
85
85
|
return m;
|
|
86
86
|
}
|
|
87
87
|
static toLegacy(e) {
|
|
88
|
-
var t, n, s, f, L, z,
|
|
88
|
+
var t, n, s, f, L, z, E, Q, b, M;
|
|
89
89
|
return {
|
|
90
90
|
wind: (t = e == null ? void 0 : e.weather) == null ? void 0 : t.wind,
|
|
91
91
|
visibility: (n = e == null ? void 0 : e.weather) == null ? void 0 : n.visibility,
|
|
@@ -94,8 +94,8 @@ class De {
|
|
|
94
94
|
gusts: {
|
|
95
95
|
kts: (z = (L = e == null ? void 0 : e.weather) == null ? void 0 : L.wind) == null ? void 0 : z.gusts
|
|
96
96
|
},
|
|
97
|
-
precip: (
|
|
98
|
-
code: (
|
|
97
|
+
precip: (E = e == null ? void 0 : e.weather) == null ? void 0 : E.precip,
|
|
98
|
+
code: (Q = e == null ? void 0 : e.weather) == null ? void 0 : Q.code,
|
|
99
99
|
name: (b = e == null ? void 0 : e.weather) == null ? void 0 : b.name,
|
|
100
100
|
url: (M = e == null ? void 0 : e.weather) == null ? void 0 : M.url,
|
|
101
101
|
wave: e == null ? void 0 : e.wave,
|
|
@@ -106,8 +106,8 @@ class De {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
static pickDaily(e, t) {
|
|
109
|
-
var n, s, f, L, z,
|
|
110
|
-
const $ = typeof t == "string" ? me(t) : t, ee = e == null ? void 0 : e.weather, g = e == null ? void 0 : e.marine, te = me((f = (s = (n = ee == null ? void 0 : ee[0]) == null ? void 0 : n.daily) == null ? void 0 : s.time) == null ? void 0 : f.at(0)), re = me((
|
|
109
|
+
var n, s, f, L, z, E, Q, b, M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe, Ae, ae, r, ge, de, we, C, ne, d;
|
|
110
|
+
const $ = typeof t == "string" ? me(t) : t, ee = e == null ? void 0 : e.weather, g = e == null ? void 0 : e.marine, te = me((f = (s = (n = ee == null ? void 0 : ee[0]) == null ? void 0 : n.daily) == null ? void 0 : s.time) == null ? void 0 : f.at(0)), re = me((E = (z = (L = ee == null ? void 0 : ee[0]) == null ? void 0 : L.daily) == null ? void 0 : z.time) == null ? void 0 : E.at(-1)), ie = [];
|
|
111
111
|
if ($.isBetween(te, re, "millisecond", "[]")) {
|
|
112
112
|
let se, le;
|
|
113
113
|
const c = $.diff(te, "d", !1);
|
|
@@ -115,7 +115,7 @@ class De {
|
|
|
115
115
|
for (const ue of ee) {
|
|
116
116
|
const m = ue.daily;
|
|
117
117
|
se = {
|
|
118
|
-
code: (
|
|
118
|
+
code: (Q = m.weather_code) == null ? void 0 : Q.at(c),
|
|
119
119
|
temp: {
|
|
120
120
|
max: (b = m.temperature_2m_max) == null ? void 0 : b.at(c),
|
|
121
121
|
min: (M = m.temperature_2m_min) == null ? void 0 : M.at(c),
|
|
@@ -168,9 +168,9 @@ class De {
|
|
|
168
168
|
bearing: ((ae = m.swell_wave_direction_dominant) == null ? void 0 : ae.at(c)) !== null ? (((r = m.swell_wave_direction_dominant) == null ? void 0 : r.at(c)) + 180) % 360 : null
|
|
169
169
|
},
|
|
170
170
|
wd: {
|
|
171
|
-
height: (
|
|
172
|
-
degree: (
|
|
173
|
-
period: (
|
|
171
|
+
height: (ge = m.wind_wave_height_max) == null ? void 0 : ge.at(c),
|
|
172
|
+
degree: (de = m.wind_wave_direction_dominant) == null ? void 0 : de.at(c),
|
|
173
|
+
period: (we = m.wind_wave_period_max) == null ? void 0 : we.at(c),
|
|
174
174
|
peakPeriod: (C = m.wind_wave_peak_period_max) == null ? void 0 : C.at(c),
|
|
175
175
|
bearing: ((ne = m.wind_wave_direction_dominant) == null ? void 0 : ne.at(c)) !== null ? (((d = m.wind_wave_direction_dominant) == null ? void 0 : d.at(c)) + 180) % 360 : null
|
|
176
176
|
}
|
|
@@ -623,7 +623,7 @@ const Ne = (h, e) => {
|
|
|
623
623
|
computeHourLT() {
|
|
624
624
|
return function(h) {
|
|
625
625
|
if (h) {
|
|
626
|
-
const e =
|
|
626
|
+
const e = he(h).tz(this.positionGmt);
|
|
627
627
|
return `${e == null ? void 0 : e.format("HH")}`;
|
|
628
628
|
}
|
|
629
629
|
return "-";
|
|
@@ -641,7 +641,7 @@ const Ne = (h, e) => {
|
|
|
641
641
|
computeWeekLT() {
|
|
642
642
|
return function(h) {
|
|
643
643
|
if (h) {
|
|
644
|
-
const e =
|
|
644
|
+
const e = he(h).tz(this.positionGmt);
|
|
645
645
|
return `${e == null ? void 0 : e.format("dddd")}`;
|
|
646
646
|
}
|
|
647
647
|
return "-";
|
|
@@ -650,7 +650,7 @@ const Ne = (h, e) => {
|
|
|
650
650
|
computeMMMDDLT() {
|
|
651
651
|
return function(h) {
|
|
652
652
|
if (h) {
|
|
653
|
-
const e =
|
|
653
|
+
const e = he(h).tz(this.positionGmt);
|
|
654
654
|
return `${e == null ? void 0 : e.format("MMM-DD")}`;
|
|
655
655
|
}
|
|
656
656
|
return "-";
|
|
@@ -749,13 +749,13 @@ const Ne = (h, e) => {
|
|
|
749
749
|
},
|
|
750
750
|
initInfo() {
|
|
751
751
|
var h, e, t, n;
|
|
752
|
-
this.positionGmt = (e = (h = this.meteoData.weather) == null ? void 0 : h[0]) == null ? void 0 : e.timezone, this.positionOffset = (n = (t = this.meteoData.weather) == null ? void 0 : t[0]) == null ? void 0 : n.offset, this.issuedDate = me(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex =
|
|
752
|
+
this.positionGmt = (e = (h = this.meteoData.weather) == null ? void 0 : h[0]) == null ? void 0 : e.timezone, this.positionOffset = (n = (t = this.meteoData.weather) == null ? void 0 : t[0]) == null ? void 0 : n.offset, this.issuedDate = me(this.ts).utc().format("MMM-DD/HHmm[Z], YYYY"), this.activeIndex = he(this.ts).tz(this.positionGmt).hour(), this.pickedDate = he(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.collectList = JSON.parse(localStorage.getItem("idmCollectList") || "[]"), this.positionList = JSON.parse(JSON.stringify(this.collectList)), this.isCollected = this.collectList.some((s) => {
|
|
753
753
|
var f;
|
|
754
754
|
return s.name === ((f = this.position) == null ? void 0 : f.name);
|
|
755
755
|
});
|
|
756
756
|
},
|
|
757
757
|
initWeatherEchart() {
|
|
758
|
-
const h = [], e = [], t = [], n = [], s = [], f = [], L = [], z = [],
|
|
758
|
+
const h = [], e = [], t = [], n = [], s = [], f = [], L = [], z = [], E = [], Q = [], b = {}, M = "data:image/svg+xml;base64," + window.btoa(
|
|
759
759
|
unescape(
|
|
760
760
|
encodeURIComponent(
|
|
761
761
|
'<svg t="1740385441519" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10951" width="200" height="200"><path d="M512 804.83593751A276.87183211 276.87183211 0 0 1 235.12816789 527.9641054Q235.12816789 375.21005376 512 13.82031251q276.87183211 361.30792288 276.87183211 514.14379289a276.87183211 276.87183211 0 0 1-276.87183211 276.87183211zM294.4461577 527.9641054a217.47202472 217.47202472 0 0 0 217.5538423 217.55384231 19.79993605 19.79993605 0 1 0 0-39.51805453 177.9539702 177.9539702 0 0 1-177.9539702-178.03578778 19.79993605 19.79993605 0 0 0-39.5998721 0z" fill="#0c73a8" p-id="10952"></path></svg>'
|
|
@@ -773,12 +773,12 @@ const Ne = (h, e) => {
|
|
|
773
773
|
this.loading.weatherEchart = !1;
|
|
774
774
|
for (let w = 0; w < 7; w++) {
|
|
775
775
|
const P = me(this.pickedDate).clone().add(w, "d");
|
|
776
|
-
h.push(
|
|
776
|
+
h.push(he(P).tz(this.positionGmt).format("yyyy-MM-DD")), e.push(this.computeMMMDDLT(P)), t.push(w === 0 ? "Today" : this.computeWeekLT(P));
|
|
777
777
|
const I = ((N = De.pickDaily(this.meteoData, P)) == null ? void 0 : N[0]) || {};
|
|
778
|
-
n.push(this.roundPrecision((T = (G = I.weather) == null ? void 0 : G.temp) == null ? void 0 : T.min, 0)), s.push(this.roundPrecision((a = (F = I.weather) == null ? void 0 : F.temp) == null ? void 0 : a.max, 0)), z.push(this.roundPrecision((J = (l = I.weather) == null ? void 0 : l.wind) == null ? void 0 : J.kts, 1) ?? "- kts"),
|
|
778
|
+
n.push(this.roundPrecision((T = (G = I.weather) == null ? void 0 : G.temp) == null ? void 0 : T.min, 0)), s.push(this.roundPrecision((a = (F = I.weather) == null ? void 0 : F.temp) == null ? void 0 : a.max, 0)), z.push(this.roundPrecision((J = (l = I.weather) == null ? void 0 : l.wind) == null ? void 0 : J.kts, 1) ?? "- kts"), Q.push(this.roundPrecision((W = (R = I.weather) == null ? void 0 : R.precip) == null ? void 0 : W.sum, 0) ?? "- mm"), f.push({ symbol: "image://" + ((q = I.weather) == null ? void 0 : q.url) }), L.push((V = I.weather) == null ? void 0 : V.name), E.push((_ = (Z = I.weather) == null ? void 0 : Z.wind) == null ? void 0 : _.bearing);
|
|
779
779
|
const y = document.createElement("canvas"), u = y.getContext("2d");
|
|
780
780
|
y.width = v.width, y.height = v.height;
|
|
781
|
-
const Ae =
|
|
781
|
+
const Ae = E[w] * (Math.PI / 180);
|
|
782
782
|
u.translate(y.width / 2, y.height / 2), u.rotate(Ae), u.translate(-v.width / 2, -v.height / 2), u.drawImage(v, 0, 0, 64, 64);
|
|
783
783
|
const ae = y.toDataURL();
|
|
784
784
|
b[`WindIcon${w}`] = {
|
|
@@ -1066,7 +1066,7 @@ const Ne = (h, e) => {
|
|
|
1066
1066
|
singleAxisIndex: 4,
|
|
1067
1067
|
coordinateSystem: "singleAxis",
|
|
1068
1068
|
type: "scatter",
|
|
1069
|
-
data:
|
|
1069
|
+
data: Q,
|
|
1070
1070
|
label: {
|
|
1071
1071
|
show: !0,
|
|
1072
1072
|
color: "rgba(0,0,0,0.7)",
|
|
@@ -1097,7 +1097,7 @@ const Ne = (h, e) => {
|
|
|
1097
1097
|
const w = pe.init(document.getElementById("weather-chart"));
|
|
1098
1098
|
w.setOption(H), w.on("click", (P) => {
|
|
1099
1099
|
const I = P.dataIndex, y = h[I].split("-");
|
|
1100
|
-
this.pickedDate =
|
|
1100
|
+
this.pickedDate = he().tz(this.positionGmt).set({ year: y[0], month: Number(y[1] - 1), date: Number(y[2]), hour: 0, minute: 0, second: 0, millisecond: 0 }).format(), this.pickedWeek = I === 0 ? "Today" : this.computeWeekLT(this.pickedDate), this.activeIndex = I === 0 ? he(this.ts).tz(this.positionGmt).hour() : void 0, this.initHoursTableData(), H.series[3].markArea = {
|
|
1101
1101
|
itemStyle: {
|
|
1102
1102
|
color: "rgba(64,159,255,0.25)"
|
|
1103
1103
|
},
|
|
@@ -1143,14 +1143,14 @@ const Ne = (h, e) => {
|
|
|
1143
1143
|
)
|
|
1144
1144
|
), n = new Image(64, 64);
|
|
1145
1145
|
n.src = t, n.onload = () => {
|
|
1146
|
-
var f, L, z,
|
|
1146
|
+
var f, L, z, E, Q, b, M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe, Ae, ae, r, ge, de, we;
|
|
1147
1147
|
this.loading.meteogramEchart = !1;
|
|
1148
|
-
const s =
|
|
1148
|
+
const s = he(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format();
|
|
1149
1149
|
for (let C = 0; C < 7 * 24; C++) {
|
|
1150
1150
|
const ne = me(s).clone().add(C, "h");
|
|
1151
1151
|
(f = this.meteogramData) == null || f.dates.push(ne);
|
|
1152
1152
|
const d = ((L = De.pickHourly(this.meteoData, ne)) == null ? void 0 : L[0]) || {};
|
|
1153
|
-
if (C % 12 === 0 && C % 24 !== 0 ? (z = this.meteogramData) == null || z.xDates.push(
|
|
1153
|
+
if (C % 12 === 0 && C % 24 !== 0 ? (z = this.meteogramData) == null || z.xDates.push(he(ne).tz(this.positionGmt).format("MMM-DD")) : (E = this.meteogramData) == null || E.xDates.push(""), C % 3 === 0 ? (Q = this.meteogramData) == null || Q.hours.push(this.computeHourLT(ne)) : (b = this.meteogramData) == null || b.hours.push(""), (O = this.meteogramData) == null || O.temperatures.push(this.roundPrecision((M = d == null ? void 0 : d.weather) == null ? void 0 : M.temp, 0)), (j = this.meteogramData) == null || j.precip.push(this.roundPrecision((k = (v = d == null ? void 0 : d.weather) == null ? void 0 : v.precip) == null ? void 0 : k.sum, 0)), (H = this.meteogramData) == null || H.windspeed.push(this.roundPrecision((x = (Y = d.weather) == null ? void 0 : Y.wind) == null ? void 0 : x.kts, 1)), (T = this.meteogramData) == null || T.windGusts.push(this.roundPrecision((G = (N = d == null ? void 0 : d.weather) == null ? void 0 : N.wind) == null ? void 0 : G.gusts, 1)), (l = this.meteogramData) == null || l.sigWaveHeight.push(this.roundPrecision((a = (F = d == null ? void 0 : d.wave) == null ? void 0 : F.sig) == null ? void 0 : a.height)), (W = this.meteogramData) == null || W.swellHeight.push(this.roundPrecision((R = (J = d == null ? void 0 : d.wave) == null ? void 0 : J.swell) == null ? void 0 : R.height)), C % 6 === 0 ? ((V = this.meteogramData) == null || V.weatherIcons.push({ symbol: "image://" + ((q = d.weather) == null ? void 0 : q.url), symbolSize: 30 }), (_ = this.meteogramData) == null || _.weatherNames.push((Z = d.weather) == null ? void 0 : Z.name)) : ((P = this.meteogramData) == null || P.weatherIcons.push({ symbol: "image://" + ((w = d.weather) == null ? void 0 : w.url), symbolSize: 0 }), (I = this.meteogramData) == null || I.weatherNames.push("")), C % 3 === 0 ? (oe = this.meteogramData) == null || oe.windDir.push((u = (y = d.weather) == null ? void 0 : y.wind) == null ? void 0 : u.bearing) : (Ae = this.meteogramData) == null || Ae.windDir.push(void 0), C % 3 === 0) {
|
|
1154
1154
|
const $ = document.createElement("canvas"), ee = $.getContext("2d");
|
|
1155
1155
|
$.width = n.width, $.height = n.height;
|
|
1156
1156
|
const te = ((ae = this.meteogramData) == null ? void 0 : ae.windDir[C]) * (Math.PI / 180);
|
|
@@ -1159,7 +1159,7 @@ const Ne = (h, e) => {
|
|
|
1159
1159
|
this.meteogramData.windDirIcons[C] = re;
|
|
1160
1160
|
} else
|
|
1161
1161
|
this.meteogramData.windDirIcons[C] = void 0;
|
|
1162
|
-
(r = d == null ? void 0 : d.weather) != null && r.isDay ? e.end === void 0 && e.start >= 0 && (e.end = C) : e.start === void 0 && (e.start = C), (e.start >= 0 && e.end >= 0 || e.start >= 0 && C === 7 * 24 - 1) && ((
|
|
1162
|
+
(r = d == null ? void 0 : d.weather) != null && r.isDay ? e.end === void 0 && e.start >= 0 && (e.end = C) : e.start === void 0 && (e.start = C), (e.start >= 0 && e.end >= 0 || e.start >= 0 && C === 7 * 24 - 1) && ((ge = this.meteogramData) == null || ge.markarea.push(
|
|
1163
1163
|
[
|
|
1164
1164
|
{
|
|
1165
1165
|
x: 4 + e.start / (7 * 24) * 92 + "%"
|
|
@@ -1170,7 +1170,7 @@ const Ne = (h, e) => {
|
|
|
1170
1170
|
]
|
|
1171
1171
|
), e = { start: void 0, end: void 0 });
|
|
1172
1172
|
}
|
|
1173
|
-
this.meteogramData.offset = 4 + 0.5 / ((
|
|
1173
|
+
this.meteogramData.offset = 4 + 0.5 / ((we = (de = this.meteogramData) == null ? void 0 : de.dates) == null ? void 0 : we.length) * 92 + "%", this.$nextTick(() => {
|
|
1174
1174
|
this.initMeteogramEchart();
|
|
1175
1175
|
});
|
|
1176
1176
|
};
|
|
@@ -1202,14 +1202,14 @@ const Ne = (h, e) => {
|
|
|
1202
1202
|
)
|
|
1203
1203
|
), n = new Image(64, 64);
|
|
1204
1204
|
n.src = t, n.onload = () => {
|
|
1205
|
-
var f, L, z,
|
|
1205
|
+
var f, L, z, E, Q, b, M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe, Ae, ae, r, ge, de, we;
|
|
1206
1206
|
this.loading.meteogramEchart = !1;
|
|
1207
|
-
const s =
|
|
1207
|
+
const s = he(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format();
|
|
1208
1208
|
for (let C = 0; C < 14 * 24; C++) {
|
|
1209
1209
|
const ne = me(s).clone().add(C, "h");
|
|
1210
1210
|
(f = this.meteogramData) == null || f.dates.push(ne);
|
|
1211
1211
|
const d = ((L = De.pickHourly(this.meteoData, ne)) == null ? void 0 : L[0]) || {};
|
|
1212
|
-
if ((
|
|
1212
|
+
if ((E = this.meteogramData) == null || E.temperatures.push(this.roundPrecision((z = d == null ? void 0 : d.weather) == null ? void 0 : z.temp, 0)), (M = this.meteogramData) == null || M.precip.push(this.roundPrecision((b = (Q = d == null ? void 0 : d.weather) == null ? void 0 : Q.precip) == null ? void 0 : b.sum, 0)), (k = this.meteogramData) == null || k.windspeed.push(this.roundPrecision((v = (O = d.weather) == null ? void 0 : O.wind) == null ? void 0 : v.kts, 1)), (x = this.meteogramData) == null || x.windGusts.push(this.roundPrecision((Y = (j = d == null ? void 0 : d.weather) == null ? void 0 : j.wind) == null ? void 0 : Y.gusts, 1)), (G = this.meteogramData) == null || G.sigWaveHeight.push(this.roundPrecision((N = (H = d == null ? void 0 : d.wave) == null ? void 0 : H.sig) == null ? void 0 : N.height)), (a = this.meteogramData) == null || a.swellHeight.push(this.roundPrecision((F = (T = d == null ? void 0 : d.wave) == null ? void 0 : T.swell) == null ? void 0 : F.height)), C % 12 === 0 && C % 24 !== 0 ? (l = this.meteogramData) == null || l.xDates.push(he(ne).tz(this.positionGmt).format("MMM-DD")) : (J = this.meteogramData) == null || J.xDates.push(""), C % 6 === 0 ? (R = this.meteogramData) == null || R.hours.push(this.computeHourLT(ne)) : (W = this.meteogramData) == null || W.hours.push(""), C % 12 === 0 ? ((V = this.meteogramData) == null || V.weatherIcons.push({ symbol: "image://" + ((q = d.weather) == null ? void 0 : q.url), symbolSize: 30 }), (_ = this.meteogramData) == null || _.weatherNames.push((Z = d.weather) == null ? void 0 : Z.name)) : ((P = this.meteogramData) == null || P.weatherIcons.push({ symbol: "image://" + ((w = d.weather) == null ? void 0 : w.url), symbolSize: 0 }), (I = this.meteogramData) == null || I.weatherNames.push("")), C % 6 === 0 ? (oe = this.meteogramData) == null || oe.windDir.push((u = (y = d.weather) == null ? void 0 : y.wind) == null ? void 0 : u.bearing) : (Ae = this.meteogramData) == null || Ae.windDir.push(void 0), C % 6 === 0) {
|
|
1213
1213
|
const $ = document.createElement("canvas"), ee = $.getContext("2d");
|
|
1214
1214
|
$.width = n.width, $.height = n.height;
|
|
1215
1215
|
const te = ((ae = this.meteogramData) == null ? void 0 : ae.windDir[C]) * (Math.PI / 180);
|
|
@@ -1218,7 +1218,7 @@ const Ne = (h, e) => {
|
|
|
1218
1218
|
this.meteogramData.windDirIcons[C] = re;
|
|
1219
1219
|
} else
|
|
1220
1220
|
this.meteogramData.windDirIcons[C] = void 0;
|
|
1221
|
-
(r = d == null ? void 0 : d.weather) != null && r.isDay ? e.end === void 0 && e.start >= 0 && (e.end = C) : e.start === void 0 && (e.start = C), (e.start >= 0 && e.end >= 0 || e.start >= 0 && C === 14 * 24 - 1) && ((
|
|
1221
|
+
(r = d == null ? void 0 : d.weather) != null && r.isDay ? e.end === void 0 && e.start >= 0 && (e.end = C) : e.start === void 0 && (e.start = C), (e.start >= 0 && e.end >= 0 || e.start >= 0 && C === 14 * 24 - 1) && ((ge = this.meteogramData) == null || ge.markarea.push(
|
|
1222
1222
|
[
|
|
1223
1223
|
{
|
|
1224
1224
|
x: 4 + e.start / (14 * 24) * 92 + "%"
|
|
@@ -1229,13 +1229,13 @@ const Ne = (h, e) => {
|
|
|
1229
1229
|
]
|
|
1230
1230
|
), e = { start: void 0, end: void 0 });
|
|
1231
1231
|
}
|
|
1232
|
-
this.meteogramData.offset = 4 + 0.5 / ((
|
|
1232
|
+
this.meteogramData.offset = 4 + 0.5 / ((we = (de = this.meteogramData) == null ? void 0 : de.dates) == null ? void 0 : we.length) * 92 + "%", this.$nextTick(() => {
|
|
1233
1233
|
this.initMeteogramEchart();
|
|
1234
1234
|
});
|
|
1235
1235
|
};
|
|
1236
1236
|
},
|
|
1237
1237
|
initMeteogramEchart() {
|
|
1238
|
-
var M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe, Ae, ae, r,
|
|
1238
|
+
var M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe, Ae, ae, r, ge, de, we, C, ne, d, $, ee;
|
|
1239
1239
|
const h = pe.init(document.getElementById("weather-icons")), e = {
|
|
1240
1240
|
grid: {
|
|
1241
1241
|
show: !0,
|
|
@@ -1311,7 +1311,7 @@ const Ne = (h, e) => {
|
|
|
1311
1311
|
};
|
|
1312
1312
|
h.setOption(e);
|
|
1313
1313
|
let t = Math.max(...this.meteogramData.temperatures.filter((g) => typeof g == "number" && !isNaN(g))), s = Math.min(...this.meteogramData.temperatures.filter((g) => typeof g == "number" && !isNaN(g))) > 0 ? 0 : Math.min(...this.meteogramData.temperatures.filter((g) => typeof g == "number" && !isNaN(g))), f = Math.ceil(t / 5) * 5, L = Math.ceil((f - s) / 5);
|
|
1314
|
-
const z = pe.init(document.getElementById("weather-condition")),
|
|
1314
|
+
const z = pe.init(document.getElementById("weather-condition")), E = {
|
|
1315
1315
|
title: {
|
|
1316
1316
|
text: "Weather conditions",
|
|
1317
1317
|
top: "10px",
|
|
@@ -1339,7 +1339,7 @@ const Ne = (h, e) => {
|
|
|
1339
1339
|
formatter: (g) => {
|
|
1340
1340
|
var re, ie, se, le, c, ue;
|
|
1341
1341
|
const te = (re = g == null ? void 0 : g[0]) == null ? void 0 : re.dataIndex;
|
|
1342
|
-
return g.find((m) => m.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${
|
|
1342
|
+
return g.find((m) => m.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${he((ie = this.meteogramData) == null ? void 0 : ie.dates[te]).tz(this.positionGmt).format("MMM-DD/HHmm[LT]")}</strong></div>
|
|
1343
1343
|
<div style="display: ${(se = this.meteogramData) != null && se.weatherNames[te] ? "block" : "none"}; font-size: 13px;">
|
|
1344
1344
|
<span>Weather : </span><strong>${(le = this.meteogramData) == null ? void 0 : le.weatherNames[te]}</strong>
|
|
1345
1345
|
</div>
|
|
@@ -1597,8 +1597,8 @@ const Ne = (h, e) => {
|
|
|
1597
1597
|
}
|
|
1598
1598
|
]
|
|
1599
1599
|
};
|
|
1600
|
-
z.setOption(
|
|
1601
|
-
const
|
|
1600
|
+
z.setOption(E);
|
|
1601
|
+
const Q = pe.init(document.getElementById("wave-swell")), b = {
|
|
1602
1602
|
title: {
|
|
1603
1603
|
text: "Wave & Swell",
|
|
1604
1604
|
top: "10px",
|
|
@@ -1627,7 +1627,7 @@ const Ne = (h, e) => {
|
|
|
1627
1627
|
formatter: (g) => {
|
|
1628
1628
|
var re, ie, se, le, c, ue;
|
|
1629
1629
|
const te = (re = g == null ? void 0 : g[0]) == null ? void 0 : re.dataIndex;
|
|
1630
|
-
return g.find((m) => m.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${
|
|
1630
|
+
return g.find((m) => m.seriesType === "scatter") ? !1 : `<div style="font-size: 13px;"><strong>${he((ie = this.meteogramData) == null ? void 0 : ie.dates[te]).tz(this.positionGmt).format("MMM-DD/HHmm[LT]")}</strong></div>
|
|
1631
1631
|
<div style="font-size: 13px;">
|
|
1632
1632
|
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #60c43e;}"></span>
|
|
1633
1633
|
<span>Wind Speed : </span><strong>${(se = g[0]) == null ? void 0 : se.value}</strong><span style="padding-left: 3px;">kts</span>
|
|
@@ -1641,7 +1641,7 @@ const Ne = (h, e) => {
|
|
|
1641
1641
|
<span>Swell Height : </span><strong>${(c = g[3]) == null ? void 0 : c.value}</strong><span style="padding-left: 3px;">m</span>
|
|
1642
1642
|
</div>
|
|
1643
1643
|
<div style="font-size: 13px;">
|
|
1644
|
-
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #
|
|
1644
|
+
<span style="display:inline-block; height: 10px;width: 10px;border-radius: 50%;background-color: #049f9c;}"></span>
|
|
1645
1645
|
<span>Sig.Wave Height : </span><strong>${(ue = g[4]) == null ? void 0 : ue.value}</strong><span style="padding-left: 3px;">m</span>
|
|
1646
1646
|
</div>
|
|
1647
1647
|
`;
|
|
@@ -1652,7 +1652,20 @@ const Ne = (h, e) => {
|
|
|
1652
1652
|
right: "4%",
|
|
1653
1653
|
top: "5%",
|
|
1654
1654
|
itemWidth: 40,
|
|
1655
|
-
data: [
|
|
1655
|
+
data: [
|
|
1656
|
+
"Wind Speed",
|
|
1657
|
+
{
|
|
1658
|
+
name: "Wind Direction",
|
|
1659
|
+
itemWidth: 20,
|
|
1660
|
+
icon: "path://M445.00000001 133.8l44.39999999-44.39999999c18.8-18.8 49.2-18.8 67.8-1e-8L946 477.99999999c18.8 18.8 18.8 49.2 0 67.80000001l-388.6 388.6c-18.8 18.8-49.2 18.8-67.8 0L445.2 890c-19-19-18.6-50 0.8-68.6L686.80000001 592 112 592c-26.6 0-48-21.4-48-48l0-64c0-26.6 21.4-48 48-48L686.80000001 432 445.8 202.4c-19.6-18.6-20-49.6-0.79999999-68.6z",
|
|
1661
|
+
itemStyle: {
|
|
1662
|
+
color: "#60c43e"
|
|
1663
|
+
}
|
|
1664
|
+
},
|
|
1665
|
+
"Wind Gusts",
|
|
1666
|
+
"Swell Height",
|
|
1667
|
+
"Sig.Wave Height"
|
|
1668
|
+
]
|
|
1656
1669
|
},
|
|
1657
1670
|
xAxis: {
|
|
1658
1671
|
show: !0,
|
|
@@ -1801,7 +1814,7 @@ const Ne = (h, e) => {
|
|
|
1801
1814
|
name: "Wind Speed",
|
|
1802
1815
|
type: "line",
|
|
1803
1816
|
yAxisIndex: 0,
|
|
1804
|
-
data: (
|
|
1817
|
+
data: (ge = this.meteogramData) == null ? void 0 : ge.windspeed,
|
|
1805
1818
|
symbol: "none",
|
|
1806
1819
|
smooth: !1,
|
|
1807
1820
|
itemStyle: {
|
|
@@ -1811,7 +1824,7 @@ const Ne = (h, e) => {
|
|
|
1811
1824
|
itemStyle: {
|
|
1812
1825
|
color: "rgba(239,239,239,0.6)"
|
|
1813
1826
|
},
|
|
1814
|
-
data: (
|
|
1827
|
+
data: (de = this.meteogramData) == null ? void 0 : de.markarea,
|
|
1815
1828
|
emphasis: {
|
|
1816
1829
|
disabled: !0
|
|
1817
1830
|
},
|
|
@@ -1838,7 +1851,7 @@ const Ne = (h, e) => {
|
|
|
1838
1851
|
}
|
|
1839
1852
|
} : !1;
|
|
1840
1853
|
},
|
|
1841
|
-
data: (
|
|
1854
|
+
data: (we = this.meteogramData) == null ? void 0 : we.windspeed,
|
|
1842
1855
|
z: 10
|
|
1843
1856
|
},
|
|
1844
1857
|
{
|
|
@@ -1881,7 +1894,7 @@ const Ne = (h, e) => {
|
|
|
1881
1894
|
symbol: "none",
|
|
1882
1895
|
smooth: !1,
|
|
1883
1896
|
itemStyle: {
|
|
1884
|
-
color: "#
|
|
1897
|
+
color: "#017c8a"
|
|
1885
1898
|
},
|
|
1886
1899
|
label: {
|
|
1887
1900
|
show: !1
|
|
@@ -1921,13 +1934,15 @@ const Ne = (h, e) => {
|
|
|
1921
1934
|
}
|
|
1922
1935
|
]
|
|
1923
1936
|
};
|
|
1924
|
-
|
|
1937
|
+
Q.setOption(b), Q.on("legendselectchanged", (g) => {
|
|
1938
|
+
g.name === "Wind Speed" && (g.selected["Wind Direction"] = g.selected["Wind Speed"]);
|
|
1939
|
+
});
|
|
1925
1940
|
},
|
|
1926
1941
|
disposeEcharts() {
|
|
1927
1942
|
document.getElementById("weather-chart") && pe.dispose(document.getElementById("weather-chart")), document.getElementById("weather-icons") && pe.dispose(document.getElementById("weather-icons")), document.getElementById("weather-condition") && pe.dispose(document.getElementById("weather-condition")), document.getElementById("wave-swell") && pe.dispose(document.getElementById("wave-swell"));
|
|
1928
1943
|
},
|
|
1929
1944
|
initHoursTableData() {
|
|
1930
|
-
var h, e, t, n, s, f, L, z,
|
|
1945
|
+
var h, e, t, n, s, f, L, z, E, Q, b, M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P;
|
|
1931
1946
|
this.hoursTableData = {
|
|
1932
1947
|
hours: [],
|
|
1933
1948
|
utcHours: [],
|
|
@@ -1958,7 +1973,7 @@ const Ne = (h, e) => {
|
|
|
1958
1973
|
const y = me(this.pickedDate).clone().add(I, "h").format();
|
|
1959
1974
|
this.hoursTableData.hours.push(y);
|
|
1960
1975
|
const u = ((h = De.pickHourly(this.meteoData, y)) == null ? void 0 : h[0]) || {};
|
|
1961
|
-
this.hoursTableData.weatherUrls.push((e = u.weather) == null ? void 0 : e.url), this.hoursTableData.weatherNames.push(((t = u.weather) == null ? void 0 : t.name) ?? "-"), this.hoursTableData.temp.push(this.roundPrecision((n = u.weather) == null ? void 0 : n.temp, 0) ?? "-"), this.hoursTableData.precipProbability.push(this.roundPrecision((f = (s = u.weather) == null ? void 0 : s.precip) == null ? void 0 : f.probability, 0) ?? "-"), this.hoursTableData.precip1h.push(this.roundPrecision((z = (L = u.weather) == null ? void 0 : L.precip) == null ? void 0 : z.sum, 0) ?? "-"), this.hoursTableData.visibility.push(this.roundPrecision((
|
|
1976
|
+
this.hoursTableData.weatherUrls.push((e = u.weather) == null ? void 0 : e.url), this.hoursTableData.weatherNames.push(((t = u.weather) == null ? void 0 : t.name) ?? "-"), this.hoursTableData.temp.push(this.roundPrecision((n = u.weather) == null ? void 0 : n.temp, 0) ?? "-"), this.hoursTableData.precipProbability.push(this.roundPrecision((f = (s = u.weather) == null ? void 0 : s.precip) == null ? void 0 : f.probability, 0) ?? "-"), this.hoursTableData.precip1h.push(this.roundPrecision((z = (L = u.weather) == null ? void 0 : L.precip) == null ? void 0 : z.sum, 0) ?? "-"), this.hoursTableData.visibility.push(this.roundPrecision((E = u.weather) == null ? void 0 : E.visibility, 0) ?? "-"), this.hoursTableData.humidity.push(this.roundPrecision((Q = u.weather) == null ? void 0 : Q.rh, 0) ?? "-"), this.hoursTableData.windSpeed.push(this.roundPrecision((M = (b = u.weather) == null ? void 0 : b.wind) == null ? void 0 : M.kts, 1)), this.hoursTableData.windDir.push((v = (O = u.weather) == null ? void 0 : O.wind) == null ? void 0 : v.bearing), this.hoursTableData.windGust.push(this.roundPrecision((j = (k = u.weather) == null ? void 0 : k.wind) == null ? void 0 : j.gusts, 1) ?? "-"), this.hoursTableData.sigwaveHeight.push(this.roundPrecision((x = (Y = u.wave) == null ? void 0 : Y.sig) == null ? void 0 : x.height, 1) ?? "-"), this.hoursTableData.sigwaveDir.push((N = (H = u.wave) == null ? void 0 : H.sig) == null ? void 0 : N.bearing), this.hoursTableData.windwaveHeight.push(this.roundPrecision((T = (G = u.wave) == null ? void 0 : G.wd) == null ? void 0 : T.height, 1) ?? "-"), this.hoursTableData.windwaveDir.push((a = (F = u.wave) == null ? void 0 : F.wd) == null ? void 0 : a.bearing), this.hoursTableData.windwavePeriod.push(this.roundPrecision((J = (l = u.wave) == null ? void 0 : l.wd) == null ? void 0 : J.period, 1) ?? "-"), this.hoursTableData.swellHeight.push(this.roundPrecision((W = (R = u.wave) == null ? void 0 : R.swell) == null ? void 0 : W.height, 1) ?? "-"), this.hoursTableData.swellDir.push((V = (q = u.wave) == null ? void 0 : q.swell) == null ? void 0 : V.bearing), this.hoursTableData.swellPeriod.push(this.roundPrecision((_ = (Z = u.wave) == null ? void 0 : Z.swell) == null ? void 0 : _.period, 1) ?? "-"), this.hoursTableData.currentSpeed.push(this.roundPrecision((w = u.current) == null ? void 0 : w.speed, 1) ?? "-"), this.hoursTableData.currentDir.push((P = u.current) == null ? void 0 : P.bearing), this.hoursTableData.seaLevel.push(this.roundPrecision(u.height, 1) ?? "-"), this.hoursTableData.seaTemp.push(this.roundPrecision(u.sst, 0) ?? "-");
|
|
1962
1977
|
}
|
|
1963
1978
|
this.loading.hoursTable = !1;
|
|
1964
1979
|
},
|
|
@@ -1966,12 +1981,12 @@ const Ne = (h, e) => {
|
|
|
1966
1981
|
this.position = {}, this.meteoData = {}, this.isCollected = !1, pe && document.getElementById("weather-chart") && pe.dispose(document.getElementById("weather-chart"));
|
|
1967
1982
|
},
|
|
1968
1983
|
initDaysTableData() {
|
|
1969
|
-
var e, t, n, s, f, L, z,
|
|
1984
|
+
var e, t, n, s, f, L, z, E, Q, b, M, O, v, k, j, Y, x, H, N, G, T, F, a, l, J, R, W, q, V, Z, _, w, P, I, y, u, oe;
|
|
1970
1985
|
this.daysTableData = [];
|
|
1971
|
-
const h =
|
|
1986
|
+
const h = he(this.ts).tz(this.positionGmt).set({ hour: 0, minute: 0, second: 0, millisecond: 0 }).format();
|
|
1972
1987
|
for (let Ae = 0; Ae < 14; Ae++) {
|
|
1973
|
-
const ae = h.clone().add(Ae, "d").format(), r = ((e = De.pickDaily(this.meteoData, ae)) == null ? void 0 : e[0]) || {};
|
|
1974
|
-
|
|
1988
|
+
const ae = me(h).clone().add(Ae, "d").format(), r = ((e = De.pickDaily(this.meteoData, ae)) == null ? void 0 : e[0]) || {};
|
|
1989
|
+
this.daysTableData.push(
|
|
1975
1990
|
{
|
|
1976
1991
|
localWeek: this.computeWeekLT(ae),
|
|
1977
1992
|
localDate: this.computeMMMDDLT(ae),
|
|
@@ -1979,7 +1994,7 @@ const Ne = (h, e) => {
|
|
|
1979
1994
|
minTemp: this.roundPrecision((s = (n = r == null ? void 0 : r.weather) == null ? void 0 : n.temp) == null ? void 0 : s.min, 0) ?? "-",
|
|
1980
1995
|
maxTemp: this.roundPrecision((L = (f = r == null ? void 0 : r.weather) == null ? void 0 : f.temp) == null ? void 0 : L.max, 0) ?? "-",
|
|
1981
1996
|
weatherName: (z = r == null ? void 0 : r.weather) == null ? void 0 : z.name,
|
|
1982
|
-
precipSum: this.roundPrecision((
|
|
1997
|
+
precipSum: this.roundPrecision((Q = (E = r == null ? void 0 : r.weather) == null ? void 0 : E.precip) == null ? void 0 : Q.sum, 0) ?? "-",
|
|
1983
1998
|
precipRainSum: this.roundPrecision((M = (b = r == null ? void 0 : r.weather) == null ? void 0 : b.precip) == null ? void 0 : M.rainSum, 0) ?? "-",
|
|
1984
1999
|
precipSnowfallSum: this.roundPrecision((v = (O = r == null ? void 0 : r.weather) == null ? void 0 : O.precip) == null ? void 0 : v.snowfallSum, 0) ?? "-",
|
|
1985
2000
|
windSpeedMax: this.roundPrecision((j = (k = r == null ? void 0 : r.weather) == null ? void 0 : k.wind) == null ? void 0 : j.kts, 1) ?? "-",
|
|
@@ -2097,8 +2112,8 @@ const Ne = (h, e) => {
|
|
|
2097
2112
|
class: "card flex-center"
|
|
2098
2113
|
};
|
|
2099
2114
|
function as(h, e, t, n, s, f) {
|
|
2100
|
-
var
|
|
2101
|
-
const L = ye("ElOption"), z = ye("ElSelect"),
|
|
2115
|
+
var Q, b, M, O, v, k, j, Y, x, H, N, G, T, F;
|
|
2116
|
+
const L = ye("ElOption"), z = ye("ElSelect"), E = ye("ElTooltip");
|
|
2102
2117
|
return i(), o("div", Te, [
|
|
2103
2118
|
A("div", Fe, [
|
|
2104
2119
|
A("div", Se, [
|
|
@@ -2143,11 +2158,11 @@ function as(h, e, t, n, s, f) {
|
|
|
2143
2158
|
A("div", Ye, [
|
|
2144
2159
|
A("div", Ke, [
|
|
2145
2160
|
A("div", null, [
|
|
2146
|
-
A("div", Ue, "Weather forecast for " + D(((
|
|
2161
|
+
A("div", Ue, "Weather forecast for " + D(((Q = s.position) == null ? void 0 : Q.name) || "-") + " ( UTC" + D(s.positionOffset) + " )", 1),
|
|
2147
2162
|
A("div", Xe, "At " + D((b = s.position) != null && b.portId ? "port" : "coordinates") + ", issued " + D(s.issuedDate), 1)
|
|
2148
2163
|
]),
|
|
2149
2164
|
A("div", Je, [
|
|
2150
|
-
Qe(
|
|
2165
|
+
Qe(E, {
|
|
2151
2166
|
placement: "left",
|
|
2152
2167
|
effect: "light",
|
|
2153
2168
|
content: s.isCollected ? "remove the port/coordinate from the search list" : "add the port/coordinate to the search list",
|
|
@@ -2240,7 +2255,7 @@ function as(h, e, t, n, s, f) {
|
|
|
2240
2255
|
class: X(s.activeIndex === l ? "active" : ""),
|
|
2241
2256
|
key: Math.random() + "url"
|
|
2242
2257
|
}, [
|
|
2243
|
-
Qe(
|
|
2258
|
+
Qe(E, {
|
|
2244
2259
|
placement: "top",
|
|
2245
2260
|
effect: "light",
|
|
2246
2261
|
content: s.hoursTableData.weatherNames[l],
|
|
@@ -2781,7 +2796,7 @@ function as(h, e, t, n, s, f) {
|
|
|
2781
2796
|
])
|
|
2782
2797
|
]);
|
|
2783
2798
|
}
|
|
2784
|
-
const is = /* @__PURE__ */ Ne(Ge, [["render", as], ["__scopeId", "data-v-
|
|
2799
|
+
const is = /* @__PURE__ */ Ne(Ge, [["render", as], ["__scopeId", "data-v-0b49ea0f"]]), ds = {
|
|
2785
2800
|
install(h) {
|
|
2786
2801
|
h.component("SpotReport", is);
|
|
2787
2802
|
}
|