@emuanalytics/flow-rdf-core 4.0.1 → 4.0.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.cjs +30 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +30 -2
- package/dist/lib/map/plugins/index.cjs +1 -1
- package/dist/lib/map/plugins/index.d.cts +2 -2
- package/dist/lib/map/plugins/index.d.mts +2 -2
- package/dist/lib/map/plugins/index.d.ts +2 -2
- package/dist/lib/map/plugins/index.mjs +2 -2
- package/dist/shared/{flow-rdf-core.9b5dad76.cjs → flow-rdf-core.06e85a6c.cjs} +15 -6
- package/dist/shared/{flow-rdf-core.dd931ace.d.cts → flow-rdf-core.4dde996e.d.cts} +11 -1
- package/dist/shared/{flow-rdf-core.dd931ace.d.mts → flow-rdf-core.4dde996e.d.mts} +11 -1
- package/dist/shared/{flow-rdf-core.dd931ace.d.ts → flow-rdf-core.4dde996e.d.ts} +11 -1
- package/dist/shared/{flow-rdf-core.e2b1bb7f.mjs → flow-rdf-core.65045caf.mjs} +15 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const mobx = require('mobx');
|
|
|
4
4
|
const Debug = require('debug');
|
|
5
5
|
const flowEngineClient = require('@emuanalytics/flow-engine-client');
|
|
6
6
|
const randomId = require('./shared/flow-rdf-core.f50908f0.cjs');
|
|
7
|
-
const mapFeatureStream = require('./shared/flow-rdf-core.
|
|
7
|
+
const mapFeatureStream = require('./shared/flow-rdf-core.06e85a6c.cjs');
|
|
8
8
|
const maplibre = require('@emuanalytics/maplibre-gl');
|
|
9
9
|
const EventEmitter = require('eventemitter3');
|
|
10
10
|
const mobxUtils = require('mobx-utils');
|
|
@@ -35,7 +35,7 @@ const maplibre__default = /*#__PURE__*/_interopDefaultCompat(maplibre);
|
|
|
35
35
|
const EventEmitter__default = /*#__PURE__*/_interopDefaultCompat(EventEmitter);
|
|
36
36
|
const lzString__default = /*#__PURE__*/_interopDefaultCompat(lzString);
|
|
37
37
|
|
|
38
|
-
const version = "4.0.
|
|
38
|
+
const version = "4.0.3";
|
|
39
39
|
|
|
40
40
|
const CONSOLE_HIGHLIGHT_STYLE$1 = `
|
|
41
41
|
padding: 2px 4px;
|
|
@@ -3101,6 +3101,34 @@ class StateStore {
|
|
|
3101
3101
|
this.set(path, val);
|
|
3102
3102
|
return val;
|
|
3103
3103
|
}
|
|
3104
|
+
bindControl(el, statePath, options) {
|
|
3105
|
+
const toState = options?.toState ?? ((v) => v);
|
|
3106
|
+
const fromState = options?.fromState ?? ((v) => v);
|
|
3107
|
+
el.addEventListener("input", () => {
|
|
3108
|
+
this.set(statePath, toState(el.value));
|
|
3109
|
+
});
|
|
3110
|
+
el.addEventListener("flow-ui-change", () => {
|
|
3111
|
+
this.set(statePath, toState(el.value));
|
|
3112
|
+
});
|
|
3113
|
+
return this.toStream(statePath, true).subscribe((value) => {
|
|
3114
|
+
if (value !== el.value) {
|
|
3115
|
+
el.value = fromState(value);
|
|
3116
|
+
}
|
|
3117
|
+
});
|
|
3118
|
+
}
|
|
3119
|
+
bindElementProp(el, prop, statePath, options) {
|
|
3120
|
+
const fromState = options?.fromState ?? ((v) => v);
|
|
3121
|
+
return this.toStream(statePath, true).subscribe((value) => {
|
|
3122
|
+
if (value !== el[prop]) {
|
|
3123
|
+
el[prop] = fromState(value);
|
|
3124
|
+
}
|
|
3125
|
+
});
|
|
3126
|
+
}
|
|
3127
|
+
bindElementAttr(el, attr, statePath) {
|
|
3128
|
+
return this.toStream(statePath, true).subscribe((value) => {
|
|
3129
|
+
el.setAttribute(attr, value);
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3104
3132
|
toStream(path, fireImmediately = true) {
|
|
3105
3133
|
this.checkInitialized();
|
|
3106
3134
|
return mobxUtils.toStream(() => this.get(path), fireImmediately);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Annotation, S as StateStore, F as FlowContextOptions, a as FlowContext, M as MapStyleSpecification, b as MapDataSource, c as MapLayer } from './shared/flow-rdf-core.
|
|
2
|
-
export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, i as FillExtrusionLayerStyleBuilder, g as FillLayerStyleBuilder, K as FlowCoreMap, e as FlowEngineEndpoint, H as HeatmapLayerStyleBuilder, k as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, x as MapAnimationOptions, y as MapCenterOptions, u as MapDataSourceOptions, v as MapDataSourceSpecification, t as MapDataSourceType, z as MapFeature, E as MapFeatureIdentifier, w as MapGeojsonData, q as MapLayerExpression, p as MapLayerOptions, s as MapLayerPropertyMetadataIndex, r as MapLayerSpecification, m as MapLayerStyleBuilder, f as MapLayerType, J as MapOptions, G as MapPaddingOptions, d as MapRegistry, I as MapSourceIdentifier, a3 as Path, a4 as PathValue, N as Query, V as QueryAttribute, _ as QueryDefinition, a0 as QueryDefinitionFn, X as QueryExtraParams, $ as QueryOptions, Y as QueryOrderClause, Q as QueryRegistry, U as QueryResultFormat, a1 as QueryResultTransformFn, Z as QuerySampleOptions, W as QueryWhereClauses, j as RasterLayerStyleBuilder, R as ReactiveExpression, a7 as SerializationFormat, a6 as StoreAnnotations, a5 as StoreConstructor, n as StyleExpression, h as SymbolLayerStyleBuilder, o as expr, l as layerStyle, O as query, P as queryMany, T as queryOne, a2 as traceReaction } from './shared/flow-rdf-core.
|
|
1
|
+
import { A as Annotation, S as StateStore, F as FlowContextOptions, a as FlowContext, M as MapStyleSpecification, b as MapDataSource, c as MapLayer } from './shared/flow-rdf-core.4dde996e.cjs';
|
|
2
|
+
export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, i as FillExtrusionLayerStyleBuilder, g as FillLayerStyleBuilder, K as FlowCoreMap, e as FlowEngineEndpoint, H as HeatmapLayerStyleBuilder, k as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, x as MapAnimationOptions, y as MapCenterOptions, u as MapDataSourceOptions, v as MapDataSourceSpecification, t as MapDataSourceType, z as MapFeature, E as MapFeatureIdentifier, w as MapGeojsonData, q as MapLayerExpression, p as MapLayerOptions, s as MapLayerPropertyMetadataIndex, r as MapLayerSpecification, m as MapLayerStyleBuilder, f as MapLayerType, J as MapOptions, G as MapPaddingOptions, d as MapRegistry, I as MapSourceIdentifier, a3 as Path, a4 as PathValue, N as Query, V as QueryAttribute, _ as QueryDefinition, a0 as QueryDefinitionFn, X as QueryExtraParams, $ as QueryOptions, Y as QueryOrderClause, Q as QueryRegistry, U as QueryResultFormat, a1 as QueryResultTransformFn, Z as QuerySampleOptions, W as QueryWhereClauses, j as RasterLayerStyleBuilder, R as ReactiveExpression, a7 as SerializationFormat, a6 as StoreAnnotations, a5 as StoreConstructor, n as StyleExpression, h as SymbolLayerStyleBuilder, o as expr, l as layerStyle, O as query, P as queryMany, T as queryOne, a2 as traceReaction } from './shared/flow-rdf-core.4dde996e.cjs';
|
|
3
3
|
export { IDisposer, IObservableStream, ISubscription } from 'mobx-utils';
|
|
4
4
|
export { makeAutoObservable, makeObservable } from 'mobx';
|
|
5
5
|
import '@emuanalytics/flow-engine-client';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Annotation, S as StateStore, F as FlowContextOptions, a as FlowContext, M as MapStyleSpecification, b as MapDataSource, c as MapLayer } from './shared/flow-rdf-core.
|
|
2
|
-
export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, i as FillExtrusionLayerStyleBuilder, g as FillLayerStyleBuilder, K as FlowCoreMap, e as FlowEngineEndpoint, H as HeatmapLayerStyleBuilder, k as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, x as MapAnimationOptions, y as MapCenterOptions, u as MapDataSourceOptions, v as MapDataSourceSpecification, t as MapDataSourceType, z as MapFeature, E as MapFeatureIdentifier, w as MapGeojsonData, q as MapLayerExpression, p as MapLayerOptions, s as MapLayerPropertyMetadataIndex, r as MapLayerSpecification, m as MapLayerStyleBuilder, f as MapLayerType, J as MapOptions, G as MapPaddingOptions, d as MapRegistry, I as MapSourceIdentifier, a3 as Path, a4 as PathValue, N as Query, V as QueryAttribute, _ as QueryDefinition, a0 as QueryDefinitionFn, X as QueryExtraParams, $ as QueryOptions, Y as QueryOrderClause, Q as QueryRegistry, U as QueryResultFormat, a1 as QueryResultTransformFn, Z as QuerySampleOptions, W as QueryWhereClauses, j as RasterLayerStyleBuilder, R as ReactiveExpression, a7 as SerializationFormat, a6 as StoreAnnotations, a5 as StoreConstructor, n as StyleExpression, h as SymbolLayerStyleBuilder, o as expr, l as layerStyle, O as query, P as queryMany, T as queryOne, a2 as traceReaction } from './shared/flow-rdf-core.
|
|
1
|
+
import { A as Annotation, S as StateStore, F as FlowContextOptions, a as FlowContext, M as MapStyleSpecification, b as MapDataSource, c as MapLayer } from './shared/flow-rdf-core.4dde996e.mjs';
|
|
2
|
+
export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, i as FillExtrusionLayerStyleBuilder, g as FillLayerStyleBuilder, K as FlowCoreMap, e as FlowEngineEndpoint, H as HeatmapLayerStyleBuilder, k as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, x as MapAnimationOptions, y as MapCenterOptions, u as MapDataSourceOptions, v as MapDataSourceSpecification, t as MapDataSourceType, z as MapFeature, E as MapFeatureIdentifier, w as MapGeojsonData, q as MapLayerExpression, p as MapLayerOptions, s as MapLayerPropertyMetadataIndex, r as MapLayerSpecification, m as MapLayerStyleBuilder, f as MapLayerType, J as MapOptions, G as MapPaddingOptions, d as MapRegistry, I as MapSourceIdentifier, a3 as Path, a4 as PathValue, N as Query, V as QueryAttribute, _ as QueryDefinition, a0 as QueryDefinitionFn, X as QueryExtraParams, $ as QueryOptions, Y as QueryOrderClause, Q as QueryRegistry, U as QueryResultFormat, a1 as QueryResultTransformFn, Z as QuerySampleOptions, W as QueryWhereClauses, j as RasterLayerStyleBuilder, R as ReactiveExpression, a7 as SerializationFormat, a6 as StoreAnnotations, a5 as StoreConstructor, n as StyleExpression, h as SymbolLayerStyleBuilder, o as expr, l as layerStyle, O as query, P as queryMany, T as queryOne, a2 as traceReaction } from './shared/flow-rdf-core.4dde996e.mjs';
|
|
3
3
|
export { IDisposer, IObservableStream, ISubscription } from 'mobx-utils';
|
|
4
4
|
export { makeAutoObservable, makeObservable } from 'mobx';
|
|
5
5
|
import '@emuanalytics/flow-engine-client';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Annotation, S as StateStore, F as FlowContextOptions, a as FlowContext, M as MapStyleSpecification, b as MapDataSource, c as MapLayer } from './shared/flow-rdf-core.
|
|
2
|
-
export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, i as FillExtrusionLayerStyleBuilder, g as FillLayerStyleBuilder, K as FlowCoreMap, e as FlowEngineEndpoint, H as HeatmapLayerStyleBuilder, k as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, x as MapAnimationOptions, y as MapCenterOptions, u as MapDataSourceOptions, v as MapDataSourceSpecification, t as MapDataSourceType, z as MapFeature, E as MapFeatureIdentifier, w as MapGeojsonData, q as MapLayerExpression, p as MapLayerOptions, s as MapLayerPropertyMetadataIndex, r as MapLayerSpecification, m as MapLayerStyleBuilder, f as MapLayerType, J as MapOptions, G as MapPaddingOptions, d as MapRegistry, I as MapSourceIdentifier, a3 as Path, a4 as PathValue, N as Query, V as QueryAttribute, _ as QueryDefinition, a0 as QueryDefinitionFn, X as QueryExtraParams, $ as QueryOptions, Y as QueryOrderClause, Q as QueryRegistry, U as QueryResultFormat, a1 as QueryResultTransformFn, Z as QuerySampleOptions, W as QueryWhereClauses, j as RasterLayerStyleBuilder, R as ReactiveExpression, a7 as SerializationFormat, a6 as StoreAnnotations, a5 as StoreConstructor, n as StyleExpression, h as SymbolLayerStyleBuilder, o as expr, l as layerStyle, O as query, P as queryMany, T as queryOne, a2 as traceReaction } from './shared/flow-rdf-core.
|
|
1
|
+
import { A as Annotation, S as StateStore, F as FlowContextOptions, a as FlowContext, M as MapStyleSpecification, b as MapDataSource, c as MapLayer } from './shared/flow-rdf-core.4dde996e.js';
|
|
2
|
+
export { B as BackgroundLayerStyleBuilder, C as CircleLayerStyleBuilder, D as DEFAULT_CONTEXT_ID, i as FillExtrusionLayerStyleBuilder, g as FillLayerStyleBuilder, K as FlowCoreMap, e as FlowEngineEndpoint, H as HeatmapLayerStyleBuilder, k as HillshadeLayerStyleBuilder, L as LineLayerStyleBuilder, x as MapAnimationOptions, y as MapCenterOptions, u as MapDataSourceOptions, v as MapDataSourceSpecification, t as MapDataSourceType, z as MapFeature, E as MapFeatureIdentifier, w as MapGeojsonData, q as MapLayerExpression, p as MapLayerOptions, s as MapLayerPropertyMetadataIndex, r as MapLayerSpecification, m as MapLayerStyleBuilder, f as MapLayerType, J as MapOptions, G as MapPaddingOptions, d as MapRegistry, I as MapSourceIdentifier, a3 as Path, a4 as PathValue, N as Query, V as QueryAttribute, _ as QueryDefinition, a0 as QueryDefinitionFn, X as QueryExtraParams, $ as QueryOptions, Y as QueryOrderClause, Q as QueryRegistry, U as QueryResultFormat, a1 as QueryResultTransformFn, Z as QuerySampleOptions, W as QueryWhereClauses, j as RasterLayerStyleBuilder, R as ReactiveExpression, a7 as SerializationFormat, a6 as StoreAnnotations, a5 as StoreConstructor, n as StyleExpression, h as SymbolLayerStyleBuilder, o as expr, l as layerStyle, O as query, P as queryMany, T as queryOne, a2 as traceReaction } from './shared/flow-rdf-core.4dde996e.js';
|
|
3
3
|
export { IDisposer, IObservableStream, ISubscription } from 'mobx-utils';
|
|
4
4
|
export { makeAutoObservable, makeObservable } from 'mobx';
|
|
5
5
|
import '@emuanalytics/flow-engine-client';
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { makeAutoObservable, makeObservable } from 'mobx';
|
|
|
4
4
|
import Debug from 'debug';
|
|
5
5
|
import { Client } from '@emuanalytics/flow-engine-client';
|
|
6
6
|
import { i as isUndefined, f as isString, o as isNumber, s as isBoolean, j as isArray, b as isNil, A as randomId, y as isPlainObject, d as isDefined, g as isStringFull, z as isURL, e as ensureArray } from './shared/flow-rdf-core.25e5f6d7.mjs';
|
|
7
|
-
import { R as ReactiveExpression, F as FlowError, f as MapStyleChangeEvent, P as PluginManager, e as MapLayer, d as MapDataSource, g as MapSourceEvent, M as MapEvent, c as FlowMapError, b as MapFeatureStream, a as assert, h as MapLoadingEvent, i as MapMouseEvent, j as die } from './shared/flow-rdf-core.
|
|
7
|
+
import { R as ReactiveExpression, F as FlowError, f as MapStyleChangeEvent, P as PluginManager, e as MapLayer, d as MapDataSource, g as MapSourceEvent, M as MapEvent, c as FlowMapError, b as MapFeatureStream, a as assert, h as MapLoadingEvent, i as MapMouseEvent, j as die } from './shared/flow-rdf-core.65045caf.mjs';
|
|
8
8
|
import maplibre from '@emuanalytics/maplibre-gl';
|
|
9
9
|
import EventEmitter from 'eventemitter3';
|
|
10
10
|
import { toStream } from 'mobx-utils';
|
|
@@ -15,7 +15,7 @@ import lzString from 'lz-string';
|
|
|
15
15
|
import 'parsimmon';
|
|
16
16
|
import 'colorbrewer';
|
|
17
17
|
|
|
18
|
-
const version = "4.0.
|
|
18
|
+
const version = "4.0.3";
|
|
19
19
|
|
|
20
20
|
const CONSOLE_HIGHLIGHT_STYLE$1 = `
|
|
21
21
|
padding: 2px 4px;
|
|
@@ -3081,6 +3081,34 @@ class StateStore {
|
|
|
3081
3081
|
this.set(path, val);
|
|
3082
3082
|
return val;
|
|
3083
3083
|
}
|
|
3084
|
+
bindControl(el, statePath, options) {
|
|
3085
|
+
const toState = options?.toState ?? ((v) => v);
|
|
3086
|
+
const fromState = options?.fromState ?? ((v) => v);
|
|
3087
|
+
el.addEventListener("input", () => {
|
|
3088
|
+
this.set(statePath, toState(el.value));
|
|
3089
|
+
});
|
|
3090
|
+
el.addEventListener("flow-ui-change", () => {
|
|
3091
|
+
this.set(statePath, toState(el.value));
|
|
3092
|
+
});
|
|
3093
|
+
return this.toStream(statePath, true).subscribe((value) => {
|
|
3094
|
+
if (value !== el.value) {
|
|
3095
|
+
el.value = fromState(value);
|
|
3096
|
+
}
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
bindElementProp(el, prop, statePath, options) {
|
|
3100
|
+
const fromState = options?.fromState ?? ((v) => v);
|
|
3101
|
+
return this.toStream(statePath, true).subscribe((value) => {
|
|
3102
|
+
if (value !== el[prop]) {
|
|
3103
|
+
el[prop] = fromState(value);
|
|
3104
|
+
}
|
|
3105
|
+
});
|
|
3106
|
+
}
|
|
3107
|
+
bindElementAttr(el, attr, statePath) {
|
|
3108
|
+
return this.toStream(statePath, true).subscribe((value) => {
|
|
3109
|
+
el.setAttribute(attr, value);
|
|
3110
|
+
});
|
|
3111
|
+
}
|
|
3084
3112
|
toStream(path, fireImmediately = true) {
|
|
3085
3113
|
this.checkInitialized();
|
|
3086
3114
|
return toStream(() => this.get(path), fireImmediately);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const mapFeatureStream = require('../../../shared/flow-rdf-core.
|
|
3
|
+
const mapFeatureStream = require('../../../shared/flow-rdf-core.06e85a6c.cjs');
|
|
4
4
|
const MapboxDraw = require('@emuanalytics/mapbox-gl-draw');
|
|
5
5
|
const turfArea = require('@turf/area');
|
|
6
6
|
const turfBBox = require('@turf/bbox');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.
|
|
2
|
-
export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.
|
|
1
|
+
import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.4dde996e.cjs';
|
|
2
|
+
export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.4dde996e.cjs';
|
|
3
3
|
import { F as Func } from '../../../shared/flow-rdf-core.63162669.cjs';
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import * as lit from 'lit-html';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.
|
|
2
|
-
export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.
|
|
1
|
+
import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.4dde996e.mjs';
|
|
2
|
+
export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.4dde996e.mjs';
|
|
3
3
|
import { F as Func } from '../../../shared/flow-rdf-core.63162669.mjs';
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import * as lit from 'lit-html';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.
|
|
2
|
-
export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.
|
|
1
|
+
import { a8 as MapEvent, K as FlowCoreMap, I as MapSourceIdentifier, a9 as MapFeatureId, aa as MapPluginBase, ab as PluginManager, ac as MapSourceEvent, ad as MapMouseEvent, ae as MapFeatureStream, af as PartialBy, x as MapAnimationOptions, ag as MapStyleChangeEvent, M as MapStyleSpecification, S as StateStore, E as MapFeatureIdentifier, z as MapFeature } from '../../../shared/flow-rdf-core.4dde996e.js';
|
|
2
|
+
export { ak as EventHandlers, aj as PluginConstructor, ai as PluginEventsType, ah as PluginOptionsType } from '../../../shared/flow-rdf-core.4dde996e.js';
|
|
3
3
|
import { F as Func } from '../../../shared/flow-rdf-core.63162669.js';
|
|
4
4
|
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import * as lit from 'lit-html';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MapEvent, a as assert, b as MapFeatureStream, F as FlowError, c as FlowMapError, d as MapDataSource, e as MapLayer, R as ReactiveExpression } from '../../../shared/flow-rdf-core.
|
|
2
|
-
export { P as PluginManager } from '../../../shared/flow-rdf-core.
|
|
1
|
+
import { M as MapEvent, a as assert, b as MapFeatureStream, F as FlowError, c as FlowMapError, d as MapDataSource, e as MapLayer, R as ReactiveExpression } from '../../../shared/flow-rdf-core.65045caf.mjs';
|
|
2
|
+
export { P as PluginManager } from '../../../shared/flow-rdf-core.65045caf.mjs';
|
|
3
3
|
import MapboxDraw from '@emuanalytics/mapbox-gl-draw';
|
|
4
4
|
import turfArea from '@turf/area';
|
|
5
5
|
import turfBBox from '@turf/bbox';
|
|
@@ -279,7 +279,7 @@ class ExpressionParser {
|
|
|
279
279
|
const palettes = {};
|
|
280
280
|
function registerColorBrewerPalettes() {
|
|
281
281
|
Object.keys(colorbrewer__default).filter((key) => key !== "schemeGroups").forEach(
|
|
282
|
-
(key) => palettes[key] = {
|
|
282
|
+
(key) => palettes[key.toLowerCase()] = {
|
|
283
283
|
id: key,
|
|
284
284
|
colors: colorbrewer__default[key][5]
|
|
285
285
|
}
|
|
@@ -291,16 +291,20 @@ function fromPalette(expr, parentExpression) {
|
|
|
291
291
|
let colorStops = expr.slice(3);
|
|
292
292
|
let palette;
|
|
293
293
|
if (randomId.isString(paletteIdOrArray)) {
|
|
294
|
-
palette = palettes[paletteIdOrArray]?.colors || palettes["Greys"].colors;
|
|
294
|
+
palette = palettes[paletteIdOrArray.toLowerCase()]?.colors || palettes["Greys"].colors;
|
|
295
295
|
} else if (randomId.isArray(paletteIdOrArray) && paletteIdOrArray[0] === "literal") {
|
|
296
296
|
palette = paletteIdOrArray[1];
|
|
297
297
|
} else {
|
|
298
|
-
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
298
|
+
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
299
|
+
"from-palette requires palette id as string or custom palette array"
|
|
300
|
+
]);
|
|
299
301
|
}
|
|
300
302
|
const numPaletteEntries = palette.length;
|
|
301
303
|
let reversePalette = false;
|
|
302
304
|
if (numPaletteEntries < 5) {
|
|
303
|
-
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
305
|
+
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
306
|
+
"custom palette requires at least 5 color entries"
|
|
307
|
+
]);
|
|
304
308
|
}
|
|
305
309
|
switch (colorStops.length) {
|
|
306
310
|
case 2:
|
|
@@ -316,7 +320,9 @@ function fromPalette(expr, parentExpression) {
|
|
|
316
320
|
colorStops = colorStops.slice(0, numPaletteEntries);
|
|
317
321
|
break;
|
|
318
322
|
default:
|
|
319
|
-
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
323
|
+
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
324
|
+
"incorrect color stop arguments"
|
|
325
|
+
]);
|
|
320
326
|
}
|
|
321
327
|
if (colorStops.length === 2) {
|
|
322
328
|
const min = colorStops[0];
|
|
@@ -366,7 +372,10 @@ const regexi = {
|
|
|
366
372
|
|
|
367
373
|
function stateCustomFunction(expr, parentExpression) {
|
|
368
374
|
if (!parentExpression.store) {
|
|
369
|
-
|
|
375
|
+
console.warn(
|
|
376
|
+
`The reactive expression '${parentExpression.expression}' references state properties but is not bound to a state store. The expression cannot be evaluated - returning null.`
|
|
377
|
+
);
|
|
378
|
+
return null;
|
|
370
379
|
}
|
|
371
380
|
const path = expr.slice(1).join(".");
|
|
372
381
|
const val = parentExpression.store.get(path);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from '@emuanalytics/flow-engine-client';
|
|
2
|
-
import { IObservableStream, IDisposer
|
|
2
|
+
import { ISubscription, IObservableStream, IDisposer } from 'mobx-utils';
|
|
3
3
|
import { MapLibreEvent, MapMouseEvent as MapMouseEvent$1, MapOptions as MapOptions$1, Map } from '@emuanalytics/maplibre-gl';
|
|
4
4
|
import EventEmitter$1, { EventEmitter } from 'eventemitter3';
|
|
5
5
|
|
|
@@ -34,6 +34,16 @@ declare class StateStore {
|
|
|
34
34
|
toggle<P extends Path<this, StateStore>>(path: P): boolean;
|
|
35
35
|
increment<P extends Path<this, StateStore>>(path: P): number;
|
|
36
36
|
decrement<P extends Path<this, StateStore>>(path: P): number;
|
|
37
|
+
bindControl<TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>, TElementValue, TElement extends HTMLElement & {
|
|
38
|
+
value: TElementValue;
|
|
39
|
+
}>(el: TElement, statePath: TStatePath, options?: {
|
|
40
|
+
toState?: (value: TElementValue) => TStateValue;
|
|
41
|
+
fromState?: (value: TStateValue) => TElementValue;
|
|
42
|
+
}): ISubscription;
|
|
43
|
+
bindElementProp<TElementProp extends keyof TElement, TElement extends HTMLElement, TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>>(el: TElement, prop: TElementProp, statePath: TStatePath, options?: {
|
|
44
|
+
fromState?: (value: TStateValue) => TElement[TElementProp];
|
|
45
|
+
}): ISubscription;
|
|
46
|
+
bindElementAttr<TElement extends HTMLElement, P extends Path<this, StateStore>>(el: TElement, attr: string, statePath: P): ISubscription;
|
|
37
47
|
toStream<P extends Path<this, StateStore>>(path: P, fireImmediately?: boolean): IObservableStream<PathValue<this, P, StateStore>>;
|
|
38
48
|
autorun(autorunFn: (state: this) => void, name?: string): IDisposer;
|
|
39
49
|
initialize(annotations?: StoreAnnotations<this>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from '@emuanalytics/flow-engine-client';
|
|
2
|
-
import { IObservableStream, IDisposer
|
|
2
|
+
import { ISubscription, IObservableStream, IDisposer } from 'mobx-utils';
|
|
3
3
|
import { MapLibreEvent, MapMouseEvent as MapMouseEvent$1, MapOptions as MapOptions$1, Map } from '@emuanalytics/maplibre-gl';
|
|
4
4
|
import EventEmitter$1, { EventEmitter } from 'eventemitter3';
|
|
5
5
|
|
|
@@ -34,6 +34,16 @@ declare class StateStore {
|
|
|
34
34
|
toggle<P extends Path<this, StateStore>>(path: P): boolean;
|
|
35
35
|
increment<P extends Path<this, StateStore>>(path: P): number;
|
|
36
36
|
decrement<P extends Path<this, StateStore>>(path: P): number;
|
|
37
|
+
bindControl<TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>, TElementValue, TElement extends HTMLElement & {
|
|
38
|
+
value: TElementValue;
|
|
39
|
+
}>(el: TElement, statePath: TStatePath, options?: {
|
|
40
|
+
toState?: (value: TElementValue) => TStateValue;
|
|
41
|
+
fromState?: (value: TStateValue) => TElementValue;
|
|
42
|
+
}): ISubscription;
|
|
43
|
+
bindElementProp<TElementProp extends keyof TElement, TElement extends HTMLElement, TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>>(el: TElement, prop: TElementProp, statePath: TStatePath, options?: {
|
|
44
|
+
fromState?: (value: TStateValue) => TElement[TElementProp];
|
|
45
|
+
}): ISubscription;
|
|
46
|
+
bindElementAttr<TElement extends HTMLElement, P extends Path<this, StateStore>>(el: TElement, attr: string, statePath: P): ISubscription;
|
|
37
47
|
toStream<P extends Path<this, StateStore>>(path: P, fireImmediately?: boolean): IObservableStream<PathValue<this, P, StateStore>>;
|
|
38
48
|
autorun(autorunFn: (state: this) => void, name?: string): IDisposer;
|
|
39
49
|
initialize(annotations?: StoreAnnotations<this>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from '@emuanalytics/flow-engine-client';
|
|
2
|
-
import { IObservableStream, IDisposer
|
|
2
|
+
import { ISubscription, IObservableStream, IDisposer } from 'mobx-utils';
|
|
3
3
|
import { MapLibreEvent, MapMouseEvent as MapMouseEvent$1, MapOptions as MapOptions$1, Map } from '@emuanalytics/maplibre-gl';
|
|
4
4
|
import EventEmitter$1, { EventEmitter } from 'eventemitter3';
|
|
5
5
|
|
|
@@ -34,6 +34,16 @@ declare class StateStore {
|
|
|
34
34
|
toggle<P extends Path<this, StateStore>>(path: P): boolean;
|
|
35
35
|
increment<P extends Path<this, StateStore>>(path: P): number;
|
|
36
36
|
decrement<P extends Path<this, StateStore>>(path: P): number;
|
|
37
|
+
bindControl<TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>, TElementValue, TElement extends HTMLElement & {
|
|
38
|
+
value: TElementValue;
|
|
39
|
+
}>(el: TElement, statePath: TStatePath, options?: {
|
|
40
|
+
toState?: (value: TElementValue) => TStateValue;
|
|
41
|
+
fromState?: (value: TStateValue) => TElementValue;
|
|
42
|
+
}): ISubscription;
|
|
43
|
+
bindElementProp<TElementProp extends keyof TElement, TElement extends HTMLElement, TStatePath extends Path<this, StateStore>, TStateValue extends PathValue<this, TStatePath, StateStore>>(el: TElement, prop: TElementProp, statePath: TStatePath, options?: {
|
|
44
|
+
fromState?: (value: TStateValue) => TElement[TElementProp];
|
|
45
|
+
}): ISubscription;
|
|
46
|
+
bindElementAttr<TElement extends HTMLElement, P extends Path<this, StateStore>>(el: TElement, attr: string, statePath: P): ISubscription;
|
|
37
47
|
toStream<P extends Path<this, StateStore>>(path: P, fireImmediately?: boolean): IObservableStream<PathValue<this, P, StateStore>>;
|
|
38
48
|
autorun(autorunFn: (state: this) => void, name?: string): IDisposer;
|
|
39
49
|
initialize(annotations?: StoreAnnotations<this>): void;
|
|
@@ -258,7 +258,7 @@ class ExpressionParser {
|
|
|
258
258
|
const palettes = {};
|
|
259
259
|
function registerColorBrewerPalettes() {
|
|
260
260
|
Object.keys(colorbrewer).filter((key) => key !== "schemeGroups").forEach(
|
|
261
|
-
(key) => palettes[key] = {
|
|
261
|
+
(key) => palettes[key.toLowerCase()] = {
|
|
262
262
|
id: key,
|
|
263
263
|
colors: colorbrewer[key][5]
|
|
264
264
|
}
|
|
@@ -270,16 +270,20 @@ function fromPalette(expr, parentExpression) {
|
|
|
270
270
|
let colorStops = expr.slice(3);
|
|
271
271
|
let palette;
|
|
272
272
|
if (isString(paletteIdOrArray)) {
|
|
273
|
-
palette = palettes[paletteIdOrArray]?.colors || palettes["Greys"].colors;
|
|
273
|
+
palette = palettes[paletteIdOrArray.toLowerCase()]?.colors || palettes["Greys"].colors;
|
|
274
274
|
} else if (isArray(paletteIdOrArray) && paletteIdOrArray[0] === "literal") {
|
|
275
275
|
palette = paletteIdOrArray[1];
|
|
276
276
|
} else {
|
|
277
|
-
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
277
|
+
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
278
|
+
"from-palette requires palette id as string or custom palette array"
|
|
279
|
+
]);
|
|
278
280
|
}
|
|
279
281
|
const numPaletteEntries = palette.length;
|
|
280
282
|
let reversePalette = false;
|
|
281
283
|
if (numPaletteEntries < 5) {
|
|
282
|
-
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
284
|
+
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
285
|
+
"custom palette requires at least 5 color entries"
|
|
286
|
+
]);
|
|
283
287
|
}
|
|
284
288
|
switch (colorStops.length) {
|
|
285
289
|
case 2:
|
|
@@ -295,7 +299,9 @@ function fromPalette(expr, parentExpression) {
|
|
|
295
299
|
colorStops = colorStops.slice(0, numPaletteEntries);
|
|
296
300
|
break;
|
|
297
301
|
default:
|
|
298
|
-
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
302
|
+
throw new FlowExpressionError(parentExpression.expression, "evaluationError", [
|
|
303
|
+
"incorrect color stop arguments"
|
|
304
|
+
]);
|
|
299
305
|
}
|
|
300
306
|
if (colorStops.length === 2) {
|
|
301
307
|
const min = colorStops[0];
|
|
@@ -345,7 +351,10 @@ const regexi = {
|
|
|
345
351
|
|
|
346
352
|
function stateCustomFunction(expr, parentExpression) {
|
|
347
353
|
if (!parentExpression.store) {
|
|
348
|
-
|
|
354
|
+
console.warn(
|
|
355
|
+
`The reactive expression '${parentExpression.expression}' references state properties but is not bound to a state store. The expression cannot be evaluated - returning null.`
|
|
356
|
+
);
|
|
357
|
+
return null;
|
|
349
358
|
}
|
|
350
359
|
const path = expr.slice(1).join(".");
|
|
351
360
|
const val = parentExpression.store.get(path);
|