@redus/georedus-ui 0.1.7 → 0.3.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/CHANGELOG.md +22 -0
- package/dist/GeoReDUS/GeoReDUS.d.ts +0 -1
- package/dist/GeoReDUS/viewConfReducer.d.ts +4 -4
- package/dist/GeoReDUSWorker/methods/buffer.d.ts +7 -0
- package/dist/GeoReDUSWorker.worker.js +44 -3
- package/dist/main.js +1093 -628
- package/dist/viewSpecs/presets/cem_censo_2010_2022/index.d.ts +71 -60
- package/dist/viewSpecs/resolveView/resolveView.d.ts +15 -9
- package/dist/viewSpecs/resolveView/tmp_resolveView.future.d.ts +14 -0
- package/dist/viewSpecs/types.d.ts +51 -22
- package/dist/viewSpecs/useViews/index.d.ts +1 -0
- package/dist/viewSpecs/useViews/queryKeyHashFnWithFileSupport.d.ts +2 -0
- package/dist/viewSpecs/useViews/useViews.d.ts +12 -0
- package/dist/viewSpecs/util/index.d.ts +1 -0
- package/dist/viewSpecs/util/zoomSensitiveLinearSizes.d.ts +10 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @orioro/template-react
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- better support for 3d, refactor view resolution framework
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @orioro/react-maplibre-util@0.3.0
|
|
13
|
+
|
|
14
|
+
## 0.2.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- implement 3D maps
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @orioro/react-maplibre-util@0.2.0
|
|
24
|
+
|
|
3
25
|
## 0.1.7
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ItemList } from '@orioro/react-sortable';
|
|
2
|
-
type ViewConf = {
|
|
2
|
+
export type ViewConf = {
|
|
3
3
|
id: string;
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
|
-
type
|
|
6
|
+
export type ViewConfState = {
|
|
7
7
|
byId: Record<string, ViewConf>;
|
|
8
8
|
layout: ItemList[];
|
|
9
9
|
};
|
|
@@ -20,6 +20,6 @@ type Action = {
|
|
|
20
20
|
type: 'SET_LAYOUT';
|
|
21
21
|
payload: ItemList[];
|
|
22
22
|
};
|
|
23
|
-
export declare function viewConfReducer(state:
|
|
24
|
-
export declare function viewConfReducerInitialState(initialState: any):
|
|
23
|
+
export declare function viewConfReducer(state: ViewConfState, action: Action): ViewConfState;
|
|
24
|
+
export declare function viewConfReducerInitialState(initialState: any): ViewConfState;
|
|
25
25
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { buffer as turfBuffer } from '@turf/turf';
|
|
2
|
+
type TurfBufferOptions = Parameters<typeof turfBuffer>[2];
|
|
3
|
+
type BufferOptions = TurfBufferOptions & {
|
|
4
|
+
dissolve?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function buffer(geoJson: GeoJSON.FeatureCollection, radius: number, { dissolve, ...turfBufferOptions }?: BufferOptions): GeoJSON.FeatureCollection;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
2
|
import { scaleNaturalBreaks } from '@orioro/scale-util';
|
|
3
|
-
import { flatten, booleanIntersects, union, featureCollection } from '@turf/turf';
|
|
3
|
+
import { flatten, booleanIntersects, union, featureCollection, buffer as buffer$1 } from '@turf/turf';
|
|
4
|
+
import { __rest, __assign } from 'tslib';
|
|
4
5
|
|
|
5
6
|
function dissolveAreasPreservingIsolated(geojson) {
|
|
6
7
|
var features = flatten(geojson).features.filter(Boolean);
|
|
@@ -32,9 +33,49 @@ function dissolveAreasPreservingIsolated(geojson) {
|
|
|
32
33
|
return featureCollection(features);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
function _applyBufferToGeometry(geometry, radius, options) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
switch (geometry === null || geometry === void 0 ? void 0 : geometry.type) {
|
|
39
|
+
case 'Point':
|
|
40
|
+
{
|
|
41
|
+
return ((_a = buffer$1(geometry, radius, options)) === null || _a === void 0 ? void 0 : _a.geometry) || null;
|
|
42
|
+
}
|
|
43
|
+
case 'LineString':
|
|
44
|
+
{
|
|
45
|
+
return ((_b = buffer$1(geometry, radius, options)) === null || _b === void 0 ? void 0 : _b.geometry) || null;
|
|
46
|
+
}
|
|
47
|
+
default:
|
|
48
|
+
{
|
|
49
|
+
return geometry;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function buffer(geoJson, radius, _a) {
|
|
54
|
+
if (_a === void 0) {
|
|
55
|
+
_a = {};
|
|
56
|
+
}
|
|
57
|
+
var _b = _a.dissolve,
|
|
58
|
+
dissolve = _b === void 0 ? false : _b,
|
|
59
|
+
turfBufferOptions = __rest(_a, ["dissolve"]);
|
|
60
|
+
var withBuffer = __assign(__assign({}, geoJson), {
|
|
61
|
+
features: geoJson.features.map(function (feature) {
|
|
62
|
+
try {
|
|
63
|
+
var geomWithBuffer = _applyBufferToGeometry(feature.geometry, radius, turfBufferOptions);
|
|
64
|
+
return __assign(__assign({}, feature), {
|
|
65
|
+
geometry: geomWithBuffer ? geomWithBuffer : feature.geometry
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
console.error('error applying buffer, will return unmodified feature', err, feature);
|
|
69
|
+
return feature;
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
return dissolve ? dissolveAreasPreservingIsolated(withBuffer) : withBuffer;
|
|
74
|
+
}
|
|
75
|
+
|
|
36
76
|
var api = {
|
|
37
77
|
scaleNaturalBreaks: scaleNaturalBreaks,
|
|
38
|
-
dissolveAreasPreservingIsolated: dissolveAreasPreservingIsolated
|
|
78
|
+
dissolveAreasPreservingIsolated: dissolveAreasPreservingIsolated,
|
|
79
|
+
buffer: buffer
|
|
39
80
|
};
|
|
40
81
|
Comlink.expose(api);
|