@dra2020/baseclient 1.0.77 → 1.0.80
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 +1 -0
- package/dist/baseclient.js +12 -8
- package/dist/baseclient.js.map +1 -1
- package/dist/dataflow/dataflow.d.ts +4 -4
- package/docs/dataflow.md +167 -0
- package/lib/colors/colors.ts +1 -0
- package/lib/dataflow/dataflow.ts +9 -9
- package/lib/poly/polypack.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ These libraries are used across both client and server:
|
|
|
19
19
|
- [Poly](./docs/poly.md): A set of functions for processing polygons, typically in GeoJSON format.
|
|
20
20
|
- [Context](./docs/context.md): A set of functions for interrogating the context supplied to the application, either as
|
|
21
21
|
- [FSM](./docs/fsm.md): A set of functions for managing asynchronous, chainable finite state machines.
|
|
22
|
+
- [DataFlow](./docs/dataflow.md): A set of classes for managing synchronous, chainable dataflow.
|
|
22
23
|
- [LogAbstract](./docs/logabstract.md): An abstract logging interface. Different implementations are used on client and server.
|
|
23
24
|
- [LogClient](./docs/logclient.md): A client implementation of the logging abstract interface.
|
|
24
25
|
- [OT](./docs/ot-js.md): An Operational Transformation implementation, used as the basis for all content editing.
|
package/dist/baseclient.js
CHANGED
|
@@ -457,6 +457,7 @@ function getColorTable(palette) {
|
|
|
457
457
|
ColorTable[palette].push(exports.EthnicBackgroundColor[i]);
|
|
458
458
|
return ColorTable[palette];
|
|
459
459
|
}
|
|
460
|
+
return ColorTable[palette];
|
|
460
461
|
}
|
|
461
462
|
if (allPaletteNames.includes(palette)) {
|
|
462
463
|
if (!ColorTable[palette])
|
|
@@ -1037,25 +1038,25 @@ class DataFlow {
|
|
|
1037
1038
|
uses(df, name) {
|
|
1038
1039
|
this.usesList.push({ name: name, df: df });
|
|
1039
1040
|
}
|
|
1040
|
-
|
|
1041
|
+
stale() {
|
|
1041
1042
|
let isstale = false;
|
|
1042
1043
|
this.usesList.forEach(ui => {
|
|
1043
|
-
ui.
|
|
1044
|
-
if (ui.
|
|
1044
|
+
ui.wasfresh = ui.id !== ui.df.dfid();
|
|
1045
|
+
if (ui.wasfresh)
|
|
1045
1046
|
isstale = true;
|
|
1046
1047
|
});
|
|
1047
1048
|
return isstale;
|
|
1048
1049
|
}
|
|
1049
|
-
|
|
1050
|
+
wasFresh(name) {
|
|
1050
1051
|
let ui = this.usesList.find((ui) => ui.name === name);
|
|
1051
|
-
return ui != null && ui.
|
|
1052
|
+
return ui != null && ui.wasfresh;
|
|
1052
1053
|
}
|
|
1053
|
-
|
|
1054
|
+
remember() {
|
|
1054
1055
|
this.usesList.forEach(ui => { ui.id = ui.df.dfid(); });
|
|
1055
1056
|
}
|
|
1056
1057
|
ifcompute() {
|
|
1057
|
-
if (this.
|
|
1058
|
-
this.
|
|
1058
|
+
if (this.stale()) {
|
|
1059
|
+
this.remember();
|
|
1059
1060
|
this.compute();
|
|
1060
1061
|
}
|
|
1061
1062
|
}
|
|
@@ -8441,6 +8442,9 @@ function polyPack(coords, prepack) {
|
|
|
8441
8442
|
// Null feature?
|
|
8442
8443
|
if (coords == null || (coords.length !== undefined && coords.length == 0))
|
|
8443
8444
|
return null;
|
|
8445
|
+
// Null geometry?
|
|
8446
|
+
if (coords && coords.type === 'Feature' && coords.geometry == null)
|
|
8447
|
+
return null;
|
|
8444
8448
|
// Actually already a PolyPack?
|
|
8445
8449
|
if (coords.offset !== undefined)
|
|
8446
8450
|
return coords;
|