@meteo-render/image 0.0.0-stage → 1.1.0
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/LICENSE +201 -0
- package/dist/FONT-NOTICE.txt +5 -0
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.umd.js +1 -0
- package/dist/types/axis.d.ts +10 -0
- package/dist/types/boundary.d.ts +25 -0
- package/dist/types/builtInGlyphSubset.d.ts +416 -0
- package/dist/types/canvas.d.ts +23 -0
- package/dist/types/color.d.ts +5 -0
- package/dist/types/dashboard.d.ts +3 -0
- package/dist/types/dashboardTypes.d.ts +28 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/nativeRaster.d.ts +9 -0
- package/dist/types/png.d.ts +1 -0
- package/dist/types/projection.d.ts +13 -0
- package/dist/types/rangeRings.d.ts +5 -0
- package/dist/types/render.d.ts +16 -0
- package/dist/types/typefaceText.d.ts +6 -0
- package/dist/types/types.d.ts +128 -0
- package/package.json +40 -5
- package/README.md +0 -3
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { RadialData } from '@meteo-render/core';
|
|
2
|
+
import type { RasterData } from '@meteo-render/core';
|
|
3
|
+
import type { ColorMode, ColorRange, ColorStopInput, GridData, SampleMode } from '@meteo-render/rendering';
|
|
4
|
+
export type ImageCrs = 'EPSG:4326' | 'EPSG:3857';
|
|
5
|
+
export type GeoJsonInput = string | Uint8Array | IGeoJsonObject;
|
|
6
|
+
export interface IGeoJsonObject {
|
|
7
|
+
type: string;
|
|
8
|
+
coordinates?: unknown;
|
|
9
|
+
geometry?: IGeoJsonObject | null;
|
|
10
|
+
geometries?: IGeoJsonObject[];
|
|
11
|
+
features?: IGeoJsonObject[];
|
|
12
|
+
properties?: Readonly<Record<string, unknown>> | null;
|
|
13
|
+
}
|
|
14
|
+
export interface IImageTextOptions {
|
|
15
|
+
property?: string;
|
|
16
|
+
format?: (value: unknown, properties: Readonly<Record<string, unknown>>) => string;
|
|
17
|
+
color?: string;
|
|
18
|
+
opacity?: number;
|
|
19
|
+
fontSize?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface IImageVectorOptions {
|
|
22
|
+
geoJson: GeoJsonInput;
|
|
23
|
+
sourceCrs?: ImageCrs;
|
|
24
|
+
lineWidth?: number;
|
|
25
|
+
color?: string;
|
|
26
|
+
lineOpacity?: number;
|
|
27
|
+
fill?: string;
|
|
28
|
+
fillOpacity?: number;
|
|
29
|
+
dash?: readonly number[];
|
|
30
|
+
text?: IImageTextOptions;
|
|
31
|
+
}
|
|
32
|
+
export interface IImageBoundsOptions extends IImageVectorOptions {
|
|
33
|
+
clipMode?: 'bounds' | 'geometry';
|
|
34
|
+
padding?: number;
|
|
35
|
+
}
|
|
36
|
+
export type IImageMapOptions = IImageVectorOptions;
|
|
37
|
+
export interface IImageAxisPartOptions {
|
|
38
|
+
color?: string;
|
|
39
|
+
lineWidth?: number;
|
|
40
|
+
step?: number;
|
|
41
|
+
opacity?: number;
|
|
42
|
+
format?: (coordinate: number) => string;
|
|
43
|
+
}
|
|
44
|
+
export interface IImageAxisOptions extends IImageAxisPartOptions {
|
|
45
|
+
x?: IImageAxisPartOptions;
|
|
46
|
+
y?: IImageAxisPartOptions;
|
|
47
|
+
tickLength?: number;
|
|
48
|
+
fontSize?: number;
|
|
49
|
+
margin?: {
|
|
50
|
+
left?: number;
|
|
51
|
+
right?: number;
|
|
52
|
+
top?: number;
|
|
53
|
+
bottom?: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface IImageRangeRingTextOptions {
|
|
57
|
+
format?: (distance: number) => string;
|
|
58
|
+
color?: string;
|
|
59
|
+
opacity?: number;
|
|
60
|
+
fontSize?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface IImageRangeRingsOptions {
|
|
63
|
+
step?: number;
|
|
64
|
+
distances?: readonly number[];
|
|
65
|
+
maxDistance?: number;
|
|
66
|
+
color?: string;
|
|
67
|
+
lineWidth?: number;
|
|
68
|
+
lineOpacity?: number;
|
|
69
|
+
dash?: readonly number[];
|
|
70
|
+
text?: IImageRangeRingTextOptions;
|
|
71
|
+
azimuthStep?: number;
|
|
72
|
+
azimuthText?: IImageRangeRingTextOptions;
|
|
73
|
+
}
|
|
74
|
+
export interface IImageCommonOptions {
|
|
75
|
+
crs: ImageCrs;
|
|
76
|
+
width: number;
|
|
77
|
+
height?: number;
|
|
78
|
+
backgroundColor?: string;
|
|
79
|
+
opacity?: number;
|
|
80
|
+
map?: IImageMapOptions;
|
|
81
|
+
bounds?: IImageBoundsOptions;
|
|
82
|
+
axis?: IImageAxisOptions;
|
|
83
|
+
}
|
|
84
|
+
export interface IRasterImageOptions extends IImageCommonOptions {
|
|
85
|
+
colorStops: readonly ColorStopInput[];
|
|
86
|
+
colorRange?: ColorRange;
|
|
87
|
+
colorMode?: ColorMode;
|
|
88
|
+
sampleMode?: SampleMode;
|
|
89
|
+
}
|
|
90
|
+
export interface IRadialImageOptions extends IImageCommonOptions {
|
|
91
|
+
colorStops: readonly ColorStopInput[];
|
|
92
|
+
colorRange?: ColorRange;
|
|
93
|
+
colorMode?: ColorMode;
|
|
94
|
+
rangeRings?: IImageRangeRingsOptions;
|
|
95
|
+
}
|
|
96
|
+
export interface INativeRasterImageOptions {
|
|
97
|
+
width: number;
|
|
98
|
+
height?: number;
|
|
99
|
+
backgroundColor?: string;
|
|
100
|
+
opacity?: number;
|
|
101
|
+
colorStops: readonly ColorStopInput[];
|
|
102
|
+
colorRange?: ColorRange;
|
|
103
|
+
colorMode?: ColorMode;
|
|
104
|
+
}
|
|
105
|
+
export interface IImageRect {
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
width: number;
|
|
109
|
+
height: number;
|
|
110
|
+
}
|
|
111
|
+
export interface IImageProjectedBounds {
|
|
112
|
+
minX: number;
|
|
113
|
+
minY: number;
|
|
114
|
+
maxX: number;
|
|
115
|
+
maxY: number;
|
|
116
|
+
}
|
|
117
|
+
export interface IRenderedImage {
|
|
118
|
+
bytes: Uint8Array;
|
|
119
|
+
mimeType: 'image/png';
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
crs: string;
|
|
123
|
+
plotRect: IImageRect;
|
|
124
|
+
bounds: IImageProjectedBounds;
|
|
125
|
+
}
|
|
126
|
+
export type RasterImageGrid = GridData;
|
|
127
|
+
export type RadialImageData = RadialData;
|
|
128
|
+
export type NativeRasterImageData = RasterData;
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@meteo-render/image",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Static PNG rendering for meteo-render draw data",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"browser": "dist/index.umd.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [],
|
|
21
|
+
"author": "wangrl",
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@meteo-render/core": "^1.1.0",
|
|
30
|
+
"@meteo-render/rendering": "^1.1.0"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/priestqing/meteo-render.git",
|
|
35
|
+
"directory": "packages/image"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/priestqing/meteo-render/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/priestqing/meteo-render#readme"
|
|
41
|
+
}
|
package/README.md
DELETED