@dra2020/baseclient 1.0.70 → 1.0.73
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/all/all.d.ts +2 -0
- package/dist/baseclient.js +119 -1
- package/dist/baseclient.js.map +1 -1
- package/dist/dataflow/all.d.ts +1 -0
- package/dist/dataflow/dataflow.d.ts +30 -0
- package/lib/all/all.ts +2 -0
- package/lib/csv/csv.ts +4 -0
- package/lib/dataflow/all.ts +1 -0
- package/lib/dataflow/dataflow.ts +106 -0
- package/lib/geo/geo.ts +4 -1
- package/package.json +1 -1
package/dist/all/all.d.ts
CHANGED
package/dist/baseclient.js
CHANGED
|
@@ -39,7 +39,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
39
39
|
return result;
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
42
|
-
exports.Colors = exports.CSV = exports.Emit = exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
42
|
+
exports.DataFlow = exports.Colors = exports.CSV = exports.Emit = exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
43
43
|
// Client and Server
|
|
44
44
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
45
45
|
exports.Util = Util;
|
|
@@ -67,6 +67,8 @@ const CSV = __importStar(__webpack_require__(/*! ../csv/all */ "./lib/csv/all.ts
|
|
|
67
67
|
exports.CSV = CSV;
|
|
68
68
|
const Colors = __importStar(__webpack_require__(/*! ../colors/colors */ "./lib/colors/colors.ts"));
|
|
69
69
|
exports.Colors = Colors;
|
|
70
|
+
const DataFlow = __importStar(__webpack_require__(/*! ../dataflow/all */ "./lib/dataflow/all.ts"));
|
|
71
|
+
exports.DataFlow = DataFlow;
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
/***/ }),
|
|
@@ -944,6 +946,9 @@ class ParseOne {
|
|
|
944
946
|
this.quote = 0;
|
|
945
947
|
this.nwhite = 0;
|
|
946
948
|
}
|
|
949
|
+
else if (this.quote) {
|
|
950
|
+
this.tok[this.toklen++] = c;
|
|
951
|
+
}
|
|
947
952
|
else if (c === Comma || c === Pipe) {
|
|
948
953
|
this.force = true;
|
|
949
954
|
this.pushtok();
|
|
@@ -975,6 +980,117 @@ class ParseOne {
|
|
|
975
980
|
exports.ParseOne = ParseOne;
|
|
976
981
|
|
|
977
982
|
|
|
983
|
+
/***/ }),
|
|
984
|
+
|
|
985
|
+
/***/ "./lib/dataflow/all.ts":
|
|
986
|
+
/*!*****************************!*\
|
|
987
|
+
!*** ./lib/dataflow/all.ts ***!
|
|
988
|
+
\*****************************/
|
|
989
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
993
|
+
if (k2 === undefined) k2 = k;
|
|
994
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
995
|
+
}) : (function(o, m, k, k2) {
|
|
996
|
+
if (k2 === undefined) k2 = k;
|
|
997
|
+
o[k2] = m[k];
|
|
998
|
+
}));
|
|
999
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
1000
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1001
|
+
};
|
|
1002
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1003
|
+
__exportStar(__webpack_require__(/*! ./dataflow */ "./lib/dataflow/dataflow.ts"), exports);
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
/***/ }),
|
|
1007
|
+
|
|
1008
|
+
/***/ "./lib/dataflow/dataflow.ts":
|
|
1009
|
+
/*!**********************************!*\
|
|
1010
|
+
!*** ./lib/dataflow/dataflow.ts ***!
|
|
1011
|
+
\**********************************/
|
|
1012
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
//
|
|
1016
|
+
// DataFlow: mechanism for setting up a data-flow dependency graph that gets computed on demand.
|
|
1017
|
+
//
|
|
1018
|
+
// Semantics are these:
|
|
1019
|
+
// 1. The simplest "atomic" DataFlow object just has an id() and a value(). The id() is used to check for exact
|
|
1020
|
+
// equivalence when determining if any dependents need to be recomputed. id() and value() might be the same
|
|
1021
|
+
// for something that just creates a new whole object when recomputed. In other cases, id() might represent a
|
|
1022
|
+
// hash or changestamp/timestamp that is distinct from the value(). The value may or may not be "ready" as well.
|
|
1023
|
+
// If the value is not "ready", no dependents can be computed.
|
|
1024
|
+
// 2. A DataFlow object can record that it "uses" another DataFlow object. If it does, it can use a set of helper
|
|
1025
|
+
// routines to track the state of its dependents. When its dependents are all ready(), it remembers their ids
|
|
1026
|
+
// and can later test if they are stale.
|
|
1027
|
+
//
|
|
1028
|
+
//
|
|
1029
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1030
|
+
exports.DataFlowNonNull = exports.DataFlow = void 0;
|
|
1031
|
+
class DataFlow {
|
|
1032
|
+
constructor() {
|
|
1033
|
+
this.usesList = {};
|
|
1034
|
+
this.uniquename = 1;
|
|
1035
|
+
}
|
|
1036
|
+
// override in subclass
|
|
1037
|
+
ready() { return this.usesReady(); }
|
|
1038
|
+
id() { return null; }
|
|
1039
|
+
value() { return null; }
|
|
1040
|
+
uses(df, name) {
|
|
1041
|
+
if (!name)
|
|
1042
|
+
name = `_df_${this.uniquename++}`;
|
|
1043
|
+
this.usesList[name] = { name: name, df: df };
|
|
1044
|
+
}
|
|
1045
|
+
find(name) {
|
|
1046
|
+
let ui = this.usesList[name];
|
|
1047
|
+
return ui ? ui.df : undefined;
|
|
1048
|
+
}
|
|
1049
|
+
findValue(name) {
|
|
1050
|
+
let df = this.find(name);
|
|
1051
|
+
return df ? df.value() : undefined;
|
|
1052
|
+
}
|
|
1053
|
+
usesReady() {
|
|
1054
|
+
let isready = true;
|
|
1055
|
+
Object.values(this.usesList).forEach((ui) => { if (!ui.df.ready())
|
|
1056
|
+
isready = false; });
|
|
1057
|
+
return isready;
|
|
1058
|
+
}
|
|
1059
|
+
usesStale() {
|
|
1060
|
+
let isstale = false;
|
|
1061
|
+
Object.values(this.usesList).forEach((ui) => { if (ui.df.id !== ui.df.id())
|
|
1062
|
+
isstale = true; });
|
|
1063
|
+
return isstale;
|
|
1064
|
+
}
|
|
1065
|
+
usesRemember() {
|
|
1066
|
+
Object.values(this.usesList).forEach((ui) => { ui.df.id = ui.df.id(); });
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
exports.DataFlow = DataFlow;
|
|
1070
|
+
// Takes callback that, when ready, returns non-null. The return value is both the value and the id.
|
|
1071
|
+
class DataFlowNonNull extends DataFlow {
|
|
1072
|
+
constructor(cb) {
|
|
1073
|
+
super();
|
|
1074
|
+
this._cb = cb;
|
|
1075
|
+
}
|
|
1076
|
+
ready() {
|
|
1077
|
+
// Allow chaining
|
|
1078
|
+
if (!this.usesReady())
|
|
1079
|
+
return false;
|
|
1080
|
+
// Real core semantics, with chaining on stale
|
|
1081
|
+
if (!this._value || this.usesStale()) {
|
|
1082
|
+
this._value = this._cb();
|
|
1083
|
+
if (this._value)
|
|
1084
|
+
this.usesRemember();
|
|
1085
|
+
}
|
|
1086
|
+
return !!this._value;
|
|
1087
|
+
}
|
|
1088
|
+
id() { return this.ready(), this._value; }
|
|
1089
|
+
value() { return this.ready(), this._value; }
|
|
1090
|
+
}
|
|
1091
|
+
exports.DataFlowNonNull = DataFlowNonNull;
|
|
1092
|
+
|
|
1093
|
+
|
|
978
1094
|
/***/ }),
|
|
979
1095
|
|
|
980
1096
|
/***/ "./lib/emit/all.ts":
|
|
@@ -2266,6 +2382,8 @@ function mergePolygon(f1, f2) {
|
|
|
2266
2382
|
function geoNormalizeCollection(col, options) {
|
|
2267
2383
|
options = Util.shallowAssignImmutable(NormalizeAll, options);
|
|
2268
2384
|
// Normalize individual features
|
|
2385
|
+
if (col && Array.isArray(col.features))
|
|
2386
|
+
col.features = col.features.filter((f) => f.properties && f.geometry && f.geometry.coordinates);
|
|
2269
2387
|
if (col && Array.isArray(col.features))
|
|
2270
2388
|
col.features.forEach((f) => geoNormalizeFeature(f, options));
|
|
2271
2389
|
// Ensure ID
|