@windycom/plugin-devtools 1.0.2-beta.2 → 1.0.5
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/README.md +5 -0
- package/index.mjs +3 -2
- package/package.json +1 -1
- package/publishExamples.sh +1 -1
- package/types/client/BindedDropDown.d.ts +14 -0
- package/types/{Calendar.d.ts → client/Calendar.d.ts} +4 -4
- package/types/client/CanvasLayer.d.ts +1 -0
- package/types/{Color.d.ts → client/Color.d.ts} +3 -3
- package/types/{DataTiler.d.ts → client/DataTiler.d.ts} +2 -2
- package/types/client/Detail1hCheckbox.d.ts +4 -0
- package/types/{ExternalSveltePlugin.d.ts → client/ExternalSveltePlugin.d.ts} +2 -1
- package/types/{GlObj.d.ts → client/GlObj.d.ts} +1 -1
- package/types/{Layer.d.ts → client/Layer.d.ts} +11 -11
- package/types/{Metric.d.ts → client/Metric.d.ts} +5 -5
- package/types/{Plugin.d.ts → client/Plugin.d.ts} +4 -2
- package/types/{Product.d.ts → client/Product.d.ts} +8 -8
- package/types/{ProductSwitch.d.ts → client/ProductSwitch.d.ts} +1 -1
- package/types/{Renderer.d.ts → client/Renderer.d.ts} +4 -4
- package/types/{Webcams.d.ts → client/Webcams.d.ts} +4 -4
- package/types/client/components.d.ts +1 -0
- package/types/client/d.ts.files/Calendar.d.ts +87 -0
- package/types/client/d.ts.files/CanvasLayer.d.ts +70 -0
- package/types/client/d.ts.files/Color.d.ts +82 -0
- package/types/client/d.ts.files/DataTiler.d.ts +45 -0
- package/types/client/d.ts.files/GlObj.d.ts +92 -0
- package/types/client/d.ts.files/LabelsLayer.d.ts +51 -0
- package/types/client/d.ts.files/LandMask.d.ts +17 -0
- package/types/client/d.ts.files/Layer.d.ts +184 -0
- package/types/client/d.ts.files/Metric.d.ts +192 -0
- package/types/client/d.ts.files/PoisOverlay.d.ts +27 -0
- package/types/client/d.ts.files/Product.d.ts +37 -0
- package/types/client/d.ts.files/Renderer.d.ts +23 -0
- package/types/client/d.ts.files/TileLayerCanvas.d.ts +78 -0
- package/types/client/d.ts.files/TileLayerMultiPatch.d.ts +13 -0
- package/types/client/d.ts.files/Webcams.d.ts +160 -0
- package/types/client/d.ts.files/broadcast.d.ts +177 -0
- package/types/client/d.ts.files/dataSpecifications.d.ts +943 -0
- package/types/client/d.ts.files/errorLogger.d.ts +35 -0
- package/types/client/d.ts.files/format.d.ts +48 -0
- package/types/client/d.ts.files/http.d.ts +87 -0
- package/types/client/d.ts.files/incomingMessages.d.ts +88 -0
- package/types/client/d.ts.files/lib.d.ts +74 -0
- package/types/client/d.ts.files/notifications.d.ts +39 -0
- package/types/client/d.ts.files/outgoingMessages.d.ts +75 -0
- package/types/client/d.ts.files/plugin-params.d.ts +236 -0
- package/types/client/d.ts.files/plugins.d.ts +132 -0
- package/types/client/d.ts.files/pois.d.ts +11 -0
- package/types/client/d.ts.files/products.d.ts +44 -0
- package/types/client/d.ts.files/rootScope.d.ts +43 -0
- package/types/client/d.ts.files/satellite.d.ts +50 -0
- package/types/client/d.ts.files/singleclick.d.ts +31 -0
- package/types/client/d.ts.files/storage.d.ts +120 -0
- package/types/client/d.ts.files/store.d.ts +61 -0
- package/types/client/d.ts.files/tileInterpolator.d.ts +35 -0
- package/types/client/d.ts.files/trans.d.ts +55 -0
- package/types/client/d.ts.files/user.d.ts +58 -0
- package/types/{dataSpecifications.d.ts → client/dataSpecifications.d.ts} +1 -1
- package/types/client/debugPremiumIssues.d.ts +22 -0
- package/types/client/embed2.d.ts +92 -0
- package/types/client/errorLogger.d.ts +11 -0
- package/types/client/externalPlugins.d.ts +6 -0
- package/types/{fetch.d.ts → client/fetch.d.ts} +30 -3
- package/types/{format.d.ts → client/format.d.ts} +2 -2
- package/types/{geolocation.d.ts → client/geolocation.d.ts} +11 -3
- package/types/client/globals.d.ts +3 -0
- package/types/{http.d.ts → client/http.d.ts} +2 -2
- package/types/client/index.d.ts +1 -0
- package/types/client/keyboard.d.ts +1 -0
- package/types/client/lib.d.ts +112 -0
- package/types/client/libHtml.d.ts +2 -0
- package/types/client/loadersUI.d.ts +1 -0
- package/types/client/mapGlobeCtrl.d.ts +1 -0
- package/types/client/mobile.d.ts +138 -0
- package/types/{models.d.ts → client/models.d.ts} +1 -1
- package/types/client/nativeStorage.d.ts +17 -0
- package/types/{notifications.d.ts → client/notifications.d.ts} +6 -5
- package/types/client/ogTags.d.ts +22 -0
- package/types/client/params.d.ts +2 -0
- package/types/{plugins.d.ts → client/plugins.d.ts} +1 -1
- package/types/client/pluginsCtrl.d.ts +7 -0
- package/types/{pois.d.ts → client/pois.d.ts} +1 -1
- package/types/client/products.d.ts +3 -0
- package/types/client/pushNotifications.d.ts +1 -0
- package/types/{renderers.d.ts → client/renderers.d.ts} +5 -5
- package/types/{reverseName.d.ts → client/reverseName.d.ts} +12 -0
- package/types/{rootScope.d.ts → client/rootScope.d.ts} +4 -4
- package/types/client/serviceWorker.d.ts +1 -0
- package/types/{singleclick.d.ts → client/singleclick.d.ts} +2 -2
- package/types/{storage.d.ts → client/storage.d.ts} +1 -1
- package/types/{store.d.ts → client/store.d.ts} +2 -2
- package/types/client/swDownloader.d.ts +16 -0
- package/types/client/swProxy.d.ts +4 -0
- package/types/client/swUtils.d.ts +16 -0
- package/types/{tileInterpolator.d.ts → client/tileInterpolator.d.ts} +3 -3
- package/types/client/timeAnimation.d.ts +1 -0
- package/types/{trans.d.ts → client/trans.d.ts} +3 -3
- package/types/client/typeGuards.d.ts +2 -0
- package/types/{user.d.ts → client/user.d.ts} +3 -3
- package/types/{utils.d.ts → client/utils.d.ts} +1 -1
- package/types/client/visibility.d.ts +5 -0
- package/types/interfaces.d.ts +54 -10
- package/types/leaflet.d.ts +2 -15
- package/types/glsl-modules.d.ts +0 -26
- package/types/index.d.ts +0 -1
- package/types/node-modules.d.ts +0 -16
- package/types/products.d.ts +0 -3
- package/types/ts-interfaces.d.ts +0 -66
- package/types/ts-types.d.ts +0 -43
- package/types/variables.d.ts +0 -238
- package/types/windy-modules.d.ts +0 -7
- /package/types/{AromeProduct.d.ts → client/AromeProduct.d.ts} +0 -0
- /package/types/{Bar.d.ts → client/Bar.d.ts} +0 -0
- /package/types/{BindedBar.d.ts → client/BindedBar.d.ts} +0 -0
- /package/types/{BindedCheckbox.d.ts → client/BindedCheckbox.d.ts} +0 -0
- /package/types/{BindedSwitch.d.ts → client/BindedSwitch.d.ts} +0 -0
- /package/types/{BottomSlide.d.ts → client/BottomSlide.d.ts} +0 -0
- /package/types/{BottomTagPlugin.d.ts → client/BottomTagPlugin.d.ts} +0 -0
- /package/types/{ClickHandler.d.ts → client/ClickHandler.d.ts} +0 -0
- /package/types/{Drag.d.ts → client/Drag.d.ts} +0 -0
- /package/types/{DraggableDiv.d.ts → client/DraggableDiv.d.ts} +0 -0
- /package/types/{DropDown.d.ts → client/DropDown.d.ts} +0 -0
- /package/types/{EcmwfAnalysisProduct.d.ts → client/EcmwfAnalysisProduct.d.ts} +0 -0
- /package/types/{EcmwfProduct.d.ts → client/EcmwfProduct.d.ts} +0 -0
- /package/types/{Evented.d.ts → client/Evented.d.ts} +0 -0
- /package/types/{GhostBox.d.ts → client/GhostBox.d.ts} +0 -0
- /package/types/{HrrrProducts.d.ts → client/HrrrProducts.d.ts} +0 -0
- /package/types/{IconProducts.d.ts → client/IconProducts.d.ts} +0 -0
- /package/types/{LabelsLayer.d.ts → client/LabelsLayer.d.ts} +0 -0
- /package/types/{LandMask.d.ts → client/LandMask.d.ts} +0 -0
- /package/types/{Legend.d.ts → client/Legend.d.ts} +0 -0
- /package/types/{LongTap.d.ts → client/LongTap.d.ts} +0 -0
- /package/types/{MetricClasses.d.ts → client/MetricClasses.d.ts} +0 -0
- /package/types/{MobileCalendar.d.ts → client/MobileCalendar.d.ts} +0 -0
- /package/types/{NamProducts.d.ts → client/NamProducts.d.ts} +0 -0
- /package/types/{OfflineMessagesClasses.d.ts → client/OfflineMessagesClasses.d.ts} +0 -0
- /package/types/{Overlay.d.ts → client/Overlay.d.ts} +0 -0
- /package/types/{OverlayClasses.d.ts → client/OverlayClasses.d.ts} +0 -0
- /package/types/{Particles.d.ts → client/Particles.d.ts} +0 -0
- /package/types/{SatelliteProduct.d.ts → client/SatelliteProduct.d.ts} +0 -0
- /package/types/{Scrollable.d.ts → client/Scrollable.d.ts} +0 -0
- /package/types/{StaticProduct.d.ts → client/StaticProduct.d.ts} +0 -0
- /package/types/{SveltePanePlugin.d.ts → client/SveltePanePlugin.d.ts} +0 -0
- /package/types/{SveltePlugin.d.ts → client/SveltePlugin.d.ts} +0 -0
- /package/types/{Swipe.d.ts → client/Swipe.d.ts} +0 -0
- /package/types/{Switch.d.ts → client/Switch.d.ts} +0 -0
- /package/types/{TagPlugin.d.ts → client/TagPlugin.d.ts} +0 -0
- /package/types/{TileLayer.d.ts → client/TileLayer.d.ts} +0 -0
- /package/types/{TileLayerCanvas.d.ts → client/TileLayerCanvas.d.ts} +0 -0
- /package/types/{TileLayerMultiPatch.d.ts → client/TileLayerMultiPatch.d.ts} +0 -0
- /package/types/{TimestampBar.d.ts → client/TimestampBar.d.ts} +0 -0
- /package/types/{Window.d.ts → client/Window.d.ts} +0 -0
- /package/types/{WindowPlugin.d.ts → client/WindowPlugin.d.ts} +0 -0
- /package/types/{baseMap.d.ts → client/baseMap.d.ts} +0 -0
- /package/types/{broadcast.d.ts → client/broadcast.d.ts} +0 -0
- /package/types/{cityLabels.d.ts → client/cityLabels.d.ts} +0 -0
- /package/types/{cloudSync.d.ts → client/cloudSync.d.ts} +0 -0
- /package/types/{colors.d.ts → client/colors.d.ts} +0 -0
- /package/types/{connection.d.ts → client/connection.d.ts} +0 -0
- /package/types/{css.d.ts → client/css.d.ts} +0 -0
- /package/types/{dataLoader.d.ts → client/dataLoader.d.ts} +0 -0
- /package/types/{detectDevice.d.ts → client/detectDevice.d.ts} +0 -0
- /package/types/{device.d.ts → client/device.d.ts} +0 -0
- /package/types/{deviceLogging.d.ts → client/deviceLogging.d.ts} +0 -0
- /package/types/{Favs.d.ts → client/favs.d.ts} +0 -0
- /package/types/{ga.d.ts → client/ga.d.ts} +0 -0
- /package/types/{glTileRender.d.ts → client/glTileRender.d.ts} +0 -0
- /package/types/{hp.d.ts → client/hp.d.ts} +0 -0
- /package/types/{interpolator.d.ts → client/interpolator.d.ts} +0 -0
- /package/types/{latestBroadcasts.d.ts → client/latestBroadcasts.d.ts} +0 -0
- /package/types/{layers.d.ts → client/layers.d.ts} +0 -0
- /package/types/{legends.d.ts → client/legends.d.ts} +0 -0
- /package/types/{levelUtils.d.ts → client/levelUtils.d.ts} +0 -0
- /package/types/{libGuard.d.ts → client/libGuard.d.ts} +0 -0
- /package/types/{location.d.ts → client/location.d.ts} +0 -0
- /package/types/{log.d.ts → client/log.d.ts} +0 -0
- /package/types/{lruCache.d.ts → client/lruCache.d.ts} +0 -0
- /package/types/{map.d.ts → client/map.d.ts} +0 -0
- /package/types/{metrics.d.ts → client/metrics.d.ts} +0 -0
- /package/types/{mobileUtils.d.ts → client/mobileUtils.d.ts} +0 -0
- /package/types/{offlineController.d.ts → client/offlineController.d.ts} +0 -0
- /package/types/{overlays.d.ts → client/overlays.d.ts} +0 -0
- /package/types/{particleRenderers.d.ts → client/particleRenderers.d.ts} +0 -0
- /package/types/{permanentPromos.d.ts → client/permanentPromos.d.ts} +0 -0
- /package/types/{picker.d.ts → client/picker.d.ts} +0 -0
- /package/types/{promo.d.ts → client/promo.d.ts} +0 -0
- /package/types/{query.d.ts → client/query.d.ts} +0 -0
- /package/types/{queryString.d.ts → client/queryString.d.ts} +0 -0
- /package/types/{renderCtrl.d.ts → client/renderCtrl.d.ts} +0 -0
- /package/types/{renderTile.d.ts → client/renderTile.d.ts} +0 -0
- /package/types/{renderUtils.d.ts → client/renderUtils.d.ts} +0 -0
- /package/types/{rhMessage.d.ts → client/rhMessage.d.ts} +0 -0
- /package/types/{router.d.ts → client/router.d.ts} +0 -0
- /package/types/{seoParser.d.ts → client/seoParser.d.ts} +0 -0
- /package/types/{share.d.ts → client/share.d.ts} +0 -0
- /package/types/{showableErrorsService.d.ts → client/showableErrorsService.d.ts} +0 -0
- /package/types/{subscription.d.ts → client/subscription.d.ts} +0 -0
- /package/types/{tileLayerInstance.d.ts → client/tileLayerInstance.d.ts} +0 -0
- /package/types/{timestampUtils.d.ts → client/timestampUtils.d.ts} +0 -0
- /package/types/{userFavs.d.ts → client/userFavs.d.ts} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Timestamp } from '@windy/types.d';
|
|
2
|
+
|
|
3
|
+
type CityDivId = string; // `${x}:${y}`
|
|
4
|
+
type CityLabelId = string; // `${lat}/${lon}`
|
|
5
|
+
|
|
6
|
+
/** Loaded forecast data from `/citytile/*` URL endpoint */
|
|
7
|
+
export type CityForecastData = {
|
|
8
|
+
/**
|
|
9
|
+
* Forecasted temperatures for cities on the tile
|
|
10
|
+
*/
|
|
11
|
+
forecast: {
|
|
12
|
+
/**
|
|
13
|
+
* Keys (coordinates) are in "lat/lon" format, value the forecasted temperature
|
|
14
|
+
*/
|
|
15
|
+
[coordinates: string]: number[];
|
|
16
|
+
};
|
|
17
|
+
/** Reftime */
|
|
18
|
+
reftime: Timestamp;
|
|
19
|
+
/** Time from reftime in hours for every temperature value in the returned array */
|
|
20
|
+
hours: number[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Loaded labels data from tiles.windy.com endpoint
|
|
25
|
+
* Format of inner arrays is [id, title to show, category of label used for CSS class, lon, lat, width in px, height in px]
|
|
26
|
+
*/
|
|
27
|
+
export type CityLabelData = [string, string, string, number, number, number, number][];
|
|
28
|
+
|
|
29
|
+
/** Represantation of single one HTML label with its temperature data */
|
|
30
|
+
export interface CityLabel {
|
|
31
|
+
/** Id of the label, it is same as a key for CityForecastData, so it is used for pairing label with temperature data */
|
|
32
|
+
id: CityLabelId;
|
|
33
|
+
|
|
34
|
+
/** HTML element of the label for binding labels and temperature values */
|
|
35
|
+
el: HTMLDivElement;
|
|
36
|
+
|
|
37
|
+
/** Forecast data with temperature in K, it is lazy loaded with forecast request */
|
|
38
|
+
data?: number[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Representation of one leaflet tile with its CityLabels */
|
|
42
|
+
export interface CityDiv {
|
|
43
|
+
/** Labels included in the leaflet tile */
|
|
44
|
+
labels: CityLabel[];
|
|
45
|
+
|
|
46
|
+
/** Mercator URL frag in format <z>/<x>/<y>. It is lazy binded when tile is created */
|
|
47
|
+
urlFrag?: string;
|
|
48
|
+
|
|
49
|
+
/* Array of timestamps for which the temperatures are forecasted. Lazy loaded with forecast request */
|
|
50
|
+
timestamps?: Timestamp[];
|
|
51
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Leaflet layer with alpha-inverse sea mask
|
|
3
|
+
*/
|
|
4
|
+
export class LandMask extends L.TileLayer {
|
|
5
|
+
seaColorL: number;
|
|
6
|
+
ctx: CanvasRenderingContext2D | null;
|
|
7
|
+
_tileOnError(
|
|
8
|
+
done: L.DoneCallback,
|
|
9
|
+
tile: HTMLImageElement | HTMLCanvasElement,
|
|
10
|
+
e: string | Event,
|
|
11
|
+
): void;
|
|
12
|
+
getTempCtx(): CanvasRenderingContext2D | null;
|
|
13
|
+
getTileUrl(coords: L.Coords): string;
|
|
14
|
+
createTile(coords: L.Coords, done: L.DoneCallback): HTMLCanvasElement | HTMLImageElement;
|
|
15
|
+
createImageTile(coords: L.Coords, done: L.DoneCallback): HTMLImageElement;
|
|
16
|
+
createCanvasTile(coords: L.Coords, done: L.DoneCallback): HTMLCanvasElement;
|
|
17
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { NumberedMetric, PrecipMetric, PtypeMetric, UVIndexMetric } from '@windy/MetricClasses';
|
|
2
|
+
import { DataQuality, FileSuffix } from '@windy/Product.d';
|
|
3
|
+
import { WeatherParameters } from '@windy/interfaces.d';
|
|
4
|
+
import { Levels, Overlays } from '@windy/rootScope.d';
|
|
5
|
+
import { NumValue, Path } from '@windy/types.d';
|
|
6
|
+
|
|
7
|
+
// TODO: Move to particles.d.ts later
|
|
8
|
+
export type ParticlesIdent = 'wind' | 'waves' | 'currents';
|
|
9
|
+
|
|
10
|
+
// TODO: Move to Patternator.d.ts later on
|
|
11
|
+
export type Patterntype = 'cclPattern' | 'rainPattern' | 'ptypePattern';
|
|
12
|
+
|
|
13
|
+
export type TransformFunction = (x: NumValue) => NumValue;
|
|
14
|
+
|
|
15
|
+
export type RenderChannels = 'R' | 'RG' | 'B';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* All available layers and their metric value type
|
|
19
|
+
*/
|
|
20
|
+
export interface LayerMetricType {
|
|
21
|
+
capAlerts: undefined;
|
|
22
|
+
pressureIsolines: undefined;
|
|
23
|
+
ghIsolines: undefined;
|
|
24
|
+
tempIsolines: undefined;
|
|
25
|
+
deg0Isolines: undefined;
|
|
26
|
+
windParticles: undefined;
|
|
27
|
+
ecmwfWindParticles: undefined;
|
|
28
|
+
ecmwfWindParticles150h: undefined;
|
|
29
|
+
ecmwfWindParticles500h: undefined;
|
|
30
|
+
ecmwfWindParticles600h: undefined;
|
|
31
|
+
waveParticles: undefined;
|
|
32
|
+
currentParticles: undefined;
|
|
33
|
+
currentsTideParticles: undefined;
|
|
34
|
+
wind: NumberedMetric;
|
|
35
|
+
temp: NumberedMetric;
|
|
36
|
+
wetbulbtemp: NumberedMetric;
|
|
37
|
+
solarpower: NumberedMetric;
|
|
38
|
+
uvindex: UVIndexMetric;
|
|
39
|
+
dewpoint: NumberedMetric;
|
|
40
|
+
gust: NumberedMetric;
|
|
41
|
+
gustAccu: NumberedMetric;
|
|
42
|
+
rh: NumberedMetric;
|
|
43
|
+
pressure: NumberedMetric;
|
|
44
|
+
ccl: NumberedMetric;
|
|
45
|
+
rain: PrecipMetric;
|
|
46
|
+
ptype: PtypeMetric;
|
|
47
|
+
thunder: NumberedMetric;
|
|
48
|
+
clouds: NumberedMetric;
|
|
49
|
+
lclouds: NumberedMetric;
|
|
50
|
+
mclouds: NumberedMetric;
|
|
51
|
+
hclouds: NumberedMetric;
|
|
52
|
+
cape: NumberedMetric;
|
|
53
|
+
cbase: NumberedMetric;
|
|
54
|
+
fog: NumberedMetric;
|
|
55
|
+
snowAccu: NumberedMetric;
|
|
56
|
+
rainAccu: NumberedMetric;
|
|
57
|
+
waves: NumberedMetric;
|
|
58
|
+
wwaves: NumberedMetric;
|
|
59
|
+
swell1: NumberedMetric;
|
|
60
|
+
swell2: NumberedMetric;
|
|
61
|
+
swell3: NumberedMetric;
|
|
62
|
+
swell: NumberedMetric;
|
|
63
|
+
currents: NumberedMetric;
|
|
64
|
+
currentsTide: NumberedMetric;
|
|
65
|
+
sst: NumberedMetric;
|
|
66
|
+
visibility: NumberedMetric;
|
|
67
|
+
snowcover: NumberedMetric;
|
|
68
|
+
cloudtop: NumberedMetric;
|
|
69
|
+
deg0: NumberedMetric;
|
|
70
|
+
cosc: NumberedMetric;
|
|
71
|
+
dustsm: NumberedMetric;
|
|
72
|
+
radar: NumberedMetric;
|
|
73
|
+
satellite: NumberedMetric;
|
|
74
|
+
gtco3: NumberedMetric;
|
|
75
|
+
pm2p5: NumberedMetric;
|
|
76
|
+
no2: NumberedMetric;
|
|
77
|
+
aod550: NumberedMetric;
|
|
78
|
+
tcso2: NumberedMetric;
|
|
79
|
+
go3: NumberedMetric;
|
|
80
|
+
gh: NumberedMetric;
|
|
81
|
+
efiWind: NumberedMetric;
|
|
82
|
+
efiTemp: NumberedMetric;
|
|
83
|
+
efiRain: NumberedMetric;
|
|
84
|
+
moistureAnom40: PrecipMetric;
|
|
85
|
+
moistureAnom100: PrecipMetric;
|
|
86
|
+
drought40: NumberedMetric;
|
|
87
|
+
drought100: NumberedMetric;
|
|
88
|
+
soilMoisture40: NumberedMetric;
|
|
89
|
+
soilMoisture100: NumberedMetric;
|
|
90
|
+
fwi: NumberedMetric;
|
|
91
|
+
dfm10h: NumberedMetric;
|
|
92
|
+
turbulence: NumberedMetric;
|
|
93
|
+
icing: NumberedMetric;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* All layers available
|
|
98
|
+
*/
|
|
99
|
+
export type Layers = keyof LayerMetricType;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* These properties are passed directly to renderer by enhancing returned params
|
|
103
|
+
*/
|
|
104
|
+
interface RenderParams {
|
|
105
|
+
/**
|
|
106
|
+
* Which channels contain tile rendering data
|
|
107
|
+
*/
|
|
108
|
+
renderFrom?: RenderChannels;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Not confirmed: Display map as a sea, meaning the sea layers are below surface layers
|
|
112
|
+
*/
|
|
113
|
+
sea?: boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Display map as a land, meaning the sea area is hidden with mask
|
|
117
|
+
*/
|
|
118
|
+
landOnly?: boolean;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Identifier of particle type
|
|
122
|
+
*/
|
|
123
|
+
particlesIdent?: ParticlesIdent;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Have no clue what this is
|
|
127
|
+
*/
|
|
128
|
+
isMultiColor?: boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Have no clue what this is
|
|
132
|
+
*/
|
|
133
|
+
interpolateNearestG?: boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Name of interpolator method
|
|
137
|
+
*/
|
|
138
|
+
interpolate?: 'interpolateOverlay' | 'interpolateWaves';
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Used patternator
|
|
142
|
+
*/
|
|
143
|
+
pattern?: Patterntype;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Set of params required to render the layer
|
|
148
|
+
*/
|
|
149
|
+
interface FullRenderParameters extends WeatherParameters, RenderParams {
|
|
150
|
+
layer: Layers;
|
|
151
|
+
server: string;
|
|
152
|
+
JPGtransparency?: boolean;
|
|
153
|
+
PNGtransparency?: boolean;
|
|
154
|
+
transformR?: TransformFunction;
|
|
155
|
+
transformG?: TransformFunction;
|
|
156
|
+
transformB?: TransformFunction;
|
|
157
|
+
directory: string;
|
|
158
|
+
filename: string | Overlays | Layers;
|
|
159
|
+
fileSuffix: FileSuffix;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Specifi zoom of mercator data tiles in dependence of map zoom
|
|
163
|
+
*/
|
|
164
|
+
dataQuality?: DataQuality;
|
|
165
|
+
maxTileZoom?: {
|
|
166
|
+
free: number;
|
|
167
|
+
premium: number;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* bump data quality by 1 level for particular overlay/layer
|
|
172
|
+
*/
|
|
173
|
+
upgradeDataQuality?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Force to slect particular zoom of data tiles
|
|
177
|
+
*/
|
|
178
|
+
dataTilesZoom?: number;
|
|
179
|
+
|
|
180
|
+
level: Levels;
|
|
181
|
+
refTime: string;
|
|
182
|
+
fullPath: string;
|
|
183
|
+
path: Path;
|
|
184
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FogMetric,
|
|
3
|
+
NumberedMetric,
|
|
4
|
+
PrecipMetric,
|
|
5
|
+
PtypeMetric,
|
|
6
|
+
SatelliteMetric,
|
|
7
|
+
UVIndexMetric,
|
|
8
|
+
} from '@windy/MetricClasses';
|
|
9
|
+
import { NumValue } from '@windy/types.d';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* List of all supported metric identifiers
|
|
13
|
+
*/
|
|
14
|
+
export type MetricItem =
|
|
15
|
+
| 'K'
|
|
16
|
+
| '°C'
|
|
17
|
+
| '°F'
|
|
18
|
+
| 'kt'
|
|
19
|
+
| 'bft'
|
|
20
|
+
| 'm/s'
|
|
21
|
+
| 'mph'
|
|
22
|
+
| 'km/h'
|
|
23
|
+
| '%'
|
|
24
|
+
| 'rules'
|
|
25
|
+
| 'hPa'
|
|
26
|
+
| 'inHg'
|
|
27
|
+
| 'mmHg'
|
|
28
|
+
| 'mm'
|
|
29
|
+
| 'in'
|
|
30
|
+
| 'cm'
|
|
31
|
+
| 'in'
|
|
32
|
+
| 'J/kg'
|
|
33
|
+
| 'DU'
|
|
34
|
+
| 'AOD'
|
|
35
|
+
| 'µg/m³'
|
|
36
|
+
| 'mg/m²'
|
|
37
|
+
| 'm'
|
|
38
|
+
| 'ft'
|
|
39
|
+
| 'km'
|
|
40
|
+
| 'mi'
|
|
41
|
+
| 'NM'
|
|
42
|
+
| 'sm'
|
|
43
|
+
| 'ppbv'
|
|
44
|
+
| 'dBZ'
|
|
45
|
+
| 'ptype'
|
|
46
|
+
| 'type'
|
|
47
|
+
| 'l/km²'
|
|
48
|
+
| 'W/m²'
|
|
49
|
+
| 'drought'
|
|
50
|
+
| 'fwi'
|
|
51
|
+
| 'mm/h'
|
|
52
|
+
| 'in/h'
|
|
53
|
+
| 'uvindex'
|
|
54
|
+
| 'EDR'
|
|
55
|
+
| 'km²'
|
|
56
|
+
| 'acres';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* # @windy/metrics
|
|
60
|
+
*
|
|
61
|
+
* Contains already initialized instances of {@link Metric.Metric | Metric } classes, to recalculate
|
|
62
|
+
* raw weather data, into units, that has user selected as his favorite, units
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import metrics from '@windy/metrics';
|
|
67
|
+
*
|
|
68
|
+
* metrics.temp.convertNumber(234.9);
|
|
69
|
+
* // converts 234.9 from Kelvin to Celsius or Fahrenheit
|
|
70
|
+
* // based on users settings
|
|
71
|
+
*
|
|
72
|
+
* metrics.temp.convertValue(234.9);
|
|
73
|
+
* // outputs string either -24.2°C or -11.5°F
|
|
74
|
+
* ```
|
|
75
|
+
* Complete list of Windy's supported metrics
|
|
76
|
+
*/
|
|
77
|
+
export interface MetricTypes {
|
|
78
|
+
temp: NumberedMetric;
|
|
79
|
+
wind: NumberedMetric;
|
|
80
|
+
rh: NumberedMetric;
|
|
81
|
+
clouds: NumberedMetric;
|
|
82
|
+
pressure: NumberedMetric;
|
|
83
|
+
rain: PrecipMetric;
|
|
84
|
+
snow: NumberedMetric;
|
|
85
|
+
cape: NumberedMetric;
|
|
86
|
+
gtco3: NumberedMetric;
|
|
87
|
+
aod550: NumberedMetric;
|
|
88
|
+
pm2p5: NumberedMetric;
|
|
89
|
+
no2: NumberedMetric;
|
|
90
|
+
tcso2: NumberedMetric;
|
|
91
|
+
go3: NumberedMetric;
|
|
92
|
+
altitude: NumberedMetric;
|
|
93
|
+
elevation: NumberedMetric;
|
|
94
|
+
distance: NumberedMetric;
|
|
95
|
+
speed: NumberedMetric;
|
|
96
|
+
waves: NumberedMetric;
|
|
97
|
+
currents: NumberedMetric;
|
|
98
|
+
visibility: NumberedMetric;
|
|
99
|
+
visibilityNoRules: NumberedMetric;
|
|
100
|
+
so2: NumberedMetric;
|
|
101
|
+
dust: NumberedMetric;
|
|
102
|
+
cosc: NumberedMetric;
|
|
103
|
+
radar: NumberedMetric;
|
|
104
|
+
satellite: SatelliteMetric;
|
|
105
|
+
ptype: PtypeMetric;
|
|
106
|
+
gh: NumberedMetric;
|
|
107
|
+
fog: FogMetric;
|
|
108
|
+
lightDensity: NumberedMetric;
|
|
109
|
+
efiWind: NumberedMetric;
|
|
110
|
+
efiTemp: NumberedMetric;
|
|
111
|
+
efiRain: NumberedMetric;
|
|
112
|
+
drought: NumberedMetric;
|
|
113
|
+
moistureAnom40: PrecipMetric;
|
|
114
|
+
moistureAnom100: PrecipMetric;
|
|
115
|
+
fwi: NumberedMetric;
|
|
116
|
+
dfm10h: NumberedMetric;
|
|
117
|
+
solarpower: NumberedMetric;
|
|
118
|
+
uvindex: UVIndexMetric;
|
|
119
|
+
capAlerts: NumberedMetric;
|
|
120
|
+
turbulence: NumberedMetric;
|
|
121
|
+
icing: NumberedMetric;
|
|
122
|
+
area: NumberedMetric;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** @ignore */
|
|
126
|
+
export type MetricIdent = keyof MetricTypes;
|
|
127
|
+
|
|
128
|
+
/** @ignore */
|
|
129
|
+
export type NumberedMetricIdent = keyof Pick<
|
|
130
|
+
MetricTypes,
|
|
131
|
+
{
|
|
132
|
+
[M in keyof MetricTypes]: MetricTypes[M] extends NumberedMetric ? M : never;
|
|
133
|
+
}[keyof MetricTypes]
|
|
134
|
+
>;
|
|
135
|
+
|
|
136
|
+
/** @ignore */
|
|
137
|
+
export type MetricKey = `metric_${MetricIdent}`;
|
|
138
|
+
|
|
139
|
+
type LegendItem = number | string;
|
|
140
|
+
|
|
141
|
+
type LegendDescription = MetricItem[]; // It is possible that some legends have custom desc
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Lines defining the legend. First column MUST be number, but we keep te type as easy as possible
|
|
145
|
+
*
|
|
146
|
+
* 1st column: value,
|
|
147
|
+
* 2nd column: text for first metric (°C for example)
|
|
148
|
+
* 3rd column: text for second metric (°F for example)
|
|
149
|
+
* 4th column: and so on
|
|
150
|
+
*/
|
|
151
|
+
type LegendLines = [number, LegendItem, ...LegendItem[]][];
|
|
152
|
+
|
|
153
|
+
/** @ignore */
|
|
154
|
+
export interface Legend {
|
|
155
|
+
/**
|
|
156
|
+
* Legend description
|
|
157
|
+
*/
|
|
158
|
+
description: LegendDescription;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Array defining how the legend will look like
|
|
162
|
+
*/
|
|
163
|
+
lines: LegendLines;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface Conversion {
|
|
167
|
+
/**
|
|
168
|
+
* Conversion function
|
|
169
|
+
*/
|
|
170
|
+
conversion: (x: NumValue) => NumValue;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Decimal precision
|
|
174
|
+
*/
|
|
175
|
+
precision: number;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* How should we mark Not Available in packer
|
|
179
|
+
*/
|
|
180
|
+
na?: string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Optional label
|
|
184
|
+
*/
|
|
185
|
+
label?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** @ignore */
|
|
189
|
+
export type ConvObj = { [K in MetricItem]?: Conversion };
|
|
190
|
+
|
|
191
|
+
/** @ignore */
|
|
192
|
+
export type MetricInitParams = Pick<NumberedMetric, 'ident'> & Partial<NumberedMetric>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class PoisOverlay extends L.Layer {
|
|
2
|
+
className?: string;
|
|
3
|
+
displayed?: boolean;
|
|
4
|
+
_container?: HTMLElement;
|
|
5
|
+
_markers?: Record<string, L.LatLng>;
|
|
6
|
+
constructor(className?: string);
|
|
7
|
+
initialize(this: this, className: string): void;
|
|
8
|
+
getHtml(
|
|
9
|
+
this: this,
|
|
10
|
+
id: string,
|
|
11
|
+
point: L.LatLng,
|
|
12
|
+
params: { html?: string; style?: string; attrs?: string[] },
|
|
13
|
+
): string;
|
|
14
|
+
addPois(this: this, html: string, markers: Record<string, L.LatLng>): void;
|
|
15
|
+
getPane(this: this): HTMLElement | undefined;
|
|
16
|
+
removePois(this: this): void;
|
|
17
|
+
replaceMarker(this: this, id: string, html: string): void;
|
|
18
|
+
getAllMarkers(this: this): NodeListOf<HTMLElement>;
|
|
19
|
+
_reset(this: this): void;
|
|
20
|
+
forAllMarkers(this: this, fun: (point: L.LatLng) => L.Point): void;
|
|
21
|
+
getPosReset(this: this, point: L.LatLng): L.Point;
|
|
22
|
+
setPoistion(this: this, marker: HTMLElement, pos: L.Point): void;
|
|
23
|
+
|
|
24
|
+
// Just this typings rewrites of leaflet methods
|
|
25
|
+
onAdd(this: this, map: L.Map): this;
|
|
26
|
+
onRemove(this: this, map: L.Map): this;
|
|
27
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Overlays, Levels } from '@windy/rootScope.d';
|
|
2
|
+
import { Bounds } from '@windy/interfaces.d';
|
|
3
|
+
|
|
4
|
+
export type ProductKey = `lastMinifest/${string}`; // TODO - directory instead of string
|
|
5
|
+
|
|
6
|
+
export interface ProductParam {
|
|
7
|
+
color: [number, number[]][];
|
|
8
|
+
description_en: string;
|
|
9
|
+
name_en: string;
|
|
10
|
+
encoding: {
|
|
11
|
+
func: string; // TODO: set exact function names
|
|
12
|
+
zero: number;
|
|
13
|
+
};
|
|
14
|
+
level: Levels[];
|
|
15
|
+
units: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ProductInfoJson {
|
|
19
|
+
about: {
|
|
20
|
+
name: string;
|
|
21
|
+
copyright: string;
|
|
22
|
+
description: string;
|
|
23
|
+
modelResolution: number;
|
|
24
|
+
provider: string;
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
bounds: null | Bounds;
|
|
28
|
+
interval: number;
|
|
29
|
+
maxZoom: number;
|
|
30
|
+
param: Record<Overlays, ProductParam>;
|
|
31
|
+
version: string;
|
|
32
|
+
zoom2zoom: string; // TODO: set exact string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type DataQuality = 'normal' | 'high' | 'low' | 'ultra' | 'extreme';
|
|
36
|
+
|
|
37
|
+
export type FileSuffix = 'png' | 'jpg' | 'webp';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TransformFunction } from '@windy/Layer.d';
|
|
2
|
+
import { TilePoint } from '@windy/interfaces.d';
|
|
3
|
+
|
|
4
|
+
export type Renderers =
|
|
5
|
+
| 'tileLayer'
|
|
6
|
+
| 'radar'
|
|
7
|
+
| 'satellite'
|
|
8
|
+
| 'capAlerts'
|
|
9
|
+
| 'isolines'
|
|
10
|
+
| 'particles'
|
|
11
|
+
| 'accumulations'
|
|
12
|
+
| 'daySwitcher'
|
|
13
|
+
| 'noUserControl';
|
|
14
|
+
|
|
15
|
+
export interface TileParams extends TilePoint {
|
|
16
|
+
url: string;
|
|
17
|
+
intX: number;
|
|
18
|
+
intY: number;
|
|
19
|
+
trans: number;
|
|
20
|
+
transformR: TransformFunction | null;
|
|
21
|
+
transformG: TransformFunction | null;
|
|
22
|
+
transformB: TransformFunction | null;
|
|
23
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DataTile } from '@windy/dataLoader';
|
|
2
|
+
|
|
3
|
+
import { FullRenderParameters } from '@windy/Layer.d';
|
|
4
|
+
import { TileParams } from '@windy/Renderer.d';
|
|
5
|
+
|
|
6
|
+
export type InternalTile = L.InternalTiles[string] & { el: HTMLCanvasElement };
|
|
7
|
+
|
|
8
|
+
export class TileLayerCanvas extends L.GridLayer {
|
|
9
|
+
_tiles: Record<string, InternalTile>;
|
|
10
|
+
/**
|
|
11
|
+
* Latest params
|
|
12
|
+
*/
|
|
13
|
+
latestParams: FullRenderParameters;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Incrementing counter, that keeps latestParams and actually rendered ile in sync
|
|
17
|
+
*/
|
|
18
|
+
syncCounter: number;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* While map is being moved
|
|
22
|
+
*/
|
|
23
|
+
inMotion: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Wis sea applied to CSS tag?
|
|
27
|
+
*/
|
|
28
|
+
hasSea: boolean;
|
|
29
|
+
|
|
30
|
+
landOnly: boolean;
|
|
31
|
+
|
|
32
|
+
className: string;
|
|
33
|
+
|
|
34
|
+
_tilesToLoad: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Owerwriting TileLayer method to disable redrawing layers w/o params
|
|
38
|
+
*/
|
|
39
|
+
// @ts-expect-error We rape TS with overloading properties with properties of different input and output (TODO fix)
|
|
40
|
+
onAdd(this: this, map: L.Map): this;
|
|
41
|
+
onRemove(this: this, map: L.Map): this;
|
|
42
|
+
onMoveStart(this: this): void;
|
|
43
|
+
onMoveEnd(this: this): void;
|
|
44
|
+
checkLoaded(this: this): void;
|
|
45
|
+
redrawFinished(this: this): void;
|
|
46
|
+
/**
|
|
47
|
+
* Redrawing overlay after changing params
|
|
48
|
+
*
|
|
49
|
+
* 1. find visible tiles
|
|
50
|
+
* 2. remove invisible tiles
|
|
51
|
+
* 3. redraw visible tiles
|
|
52
|
+
*/
|
|
53
|
+
redrawLayer(this: this): void;
|
|
54
|
+
|
|
55
|
+
removeOtherTiles(this: this, zoom: number, tileBounds: L.Bounds): void;
|
|
56
|
+
|
|
57
|
+
_removeTile(this: this, key: string): void;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Sort tiles from center out
|
|
61
|
+
*/
|
|
62
|
+
sortTilesFromCenterOut(this: this, bounds: L.Bounds): L.Coords[];
|
|
63
|
+
|
|
64
|
+
redrawTile(this: this, tile: InternalTile): void;
|
|
65
|
+
|
|
66
|
+
paramsChanged(this: this, params: FullRenderParameters): void;
|
|
67
|
+
|
|
68
|
+
init(this: this, params: FullRenderParameters): void;
|
|
69
|
+
|
|
70
|
+
renderTile(
|
|
71
|
+
this: this,
|
|
72
|
+
step: 1 | 2,
|
|
73
|
+
canvas: HTMLCanvasElement,
|
|
74
|
+
rqrdSyncNum: number,
|
|
75
|
+
tInfo: TileParams,
|
|
76
|
+
dTile: DataTile,
|
|
77
|
+
): void;
|
|
78
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class TileLayerMultiPatch extends L.TileLayerMulti {
|
|
2
|
+
_tileDefs?: Record<number, L.TileDef | null>;
|
|
3
|
+
_tileDefsBase?: Record<number, L.TileDef | null>;
|
|
4
|
+
_tileDefsPatch?: Record<number, L.TileDef | null>;
|
|
5
|
+
_patch?: Record<number, number[]>;
|
|
6
|
+
initialize(
|
|
7
|
+
this: this,
|
|
8
|
+
tileDefs?: Record<number, L.TileDef>,
|
|
9
|
+
options?: L.TileLayerOptions,
|
|
10
|
+
): void;
|
|
11
|
+
getTileUrl(this: this, tilePoint: L.Point): string;
|
|
12
|
+
_convertPatchToZoom(this: this, patch: L.TileDefPatch, zoom: number): number[];
|
|
13
|
+
}
|