plotboilerplate 1.23.0 → 1.23.2
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 -1
- package/dist/index.esm.js +32 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/plotboilerplate.browser.min.js +1 -1
- package/dist/plotboilerplate.browser.min.js.map +1 -1
- package/dist/plotboilerplate.js +32 -11
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +3 -1
- package/src/cjs/PlotBoilerplate.d.ts +17 -3
- package/src/cjs/PlotBoilerplate.js +22 -5
- package/src/cjs/PlotBoilerplate.js.map +1 -1
- package/src/cjs/drawutilssvg.d.ts +6 -1
- package/src/cjs/drawutilssvg.js +10 -6
- package/src/cjs/drawutilssvg.js.map +1 -1
- package/src/cjs/interfaces/core.d.ts +4 -2
- package/src/cjs/interfaces/core.js +1 -0
- package/src/cjs/interfaces/core.js.map +1 -1
- package/src/cjs/interfaces/externals.d.ts +42 -0
- package/src/cjs/utils/InitializationObserver.d.ts +18 -0
- package/src/cjs/utils/InitializationObserver.js +63 -0
- package/src/cjs/utils/InitializationObserver.js.map +1 -0
- package/src/cjs/utils/Params.d.ts +5 -3
- package/src/cjs/utils/Params.js +7 -3
- package/src/cjs/utils/Params.js.map +1 -1
- package/src/cjs/utils/creategui.js +386 -250
- package/src/cjs/utils/dat.gui.arrowbounce.polyfill.js +74 -73
- package/src/cjs/utils/dat.gui.title.polyfill.js +9 -7
- package/src/cjs/utils/dom/guiSizeToggler.d.ts +17 -0
- package/src/cjs/utils/dom/guiSizeToggler.js +42 -0
- package/src/cjs/utils/dom/guiSizeToggler.js.map +1 -0
- package/src/cjs/utils/gup.d.ts +1 -0
- package/src/cjs/utils/gup.js +3 -1
- package/src/cjs/utils/gup.js.map +1 -1
- package/src/cjs/utils/lil.gui.arrowbounce.polyfill.js +133 -0
- package/src/cjs/utils/lil.gui.title.polyfill.js +32 -0
- package/src/esm/PlotBoilerplate.d.ts +17 -3
- package/src/esm/PlotBoilerplate.js +22 -5
- package/src/esm/PlotBoilerplate.js.map +1 -1
- package/src/esm/drawutilssvg.d.ts +6 -1
- package/src/esm/drawutilssvg.js +10 -6
- package/src/esm/drawutilssvg.js.map +1 -1
- package/src/esm/interfaces/core.d.ts +4 -2
- package/src/esm/interfaces/core.js +1 -0
- package/src/esm/interfaces/core.js.map +1 -1
- package/src/esm/interfaces/externals.d.ts +42 -0
- package/src/esm/utils/InitializationObserver.d.ts +18 -0
- package/src/esm/utils/InitializationObserver.js +57 -0
- package/src/esm/utils/InitializationObserver.js.map +1 -0
- package/src/esm/utils/Params.d.ts +5 -3
- package/src/esm/utils/Params.js +7 -3
- package/src/esm/utils/Params.js.map +1 -1
- package/src/esm/utils/dom/guiSizeToggler.d.ts +17 -0
- package/src/esm/utils/dom/guiSizeToggler.js +38 -0
- package/src/esm/utils/dom/guiSizeToggler.js.map +1 -0
- package/src/esm/utils/gup.d.ts +1 -0
- package/src/esm/utils/gup.js +3 -1
- package/src/esm/utils/gup.js.map +1 -1
- package/src/index-gl.js +3 -1
- package/src/index.js +2 -1
- package/src/ts/PlotBoilerplate.ts +42 -11
- package/src/ts/drawutilssvg.ts +17 -6
- package/src/ts/interfaces/core.ts +5 -2
- package/src/ts/interfaces/externals.ts +50 -0
- package/src/ts/utils/InitializationObserver.ts +70 -0
- package/src/ts/utils/Params.ts +8 -3
- package/src/ts/utils/dom/guiSizeToggler.ts +45 -0
- package/src/ts/utils/gup.ts +3 -1
package/dist/plotboilerplate.js
CHANGED
|
@@ -4331,7 +4331,10 @@ exports.PBText = PBText;
|
|
|
4331
4331
|
* @modified 2023-02-10 Cleaning up most type errors in the main class (mostly null checks).
|
|
4332
4332
|
* @modified 2023-02-10 Adding `enableZoom` and `enablePan` (both default true) to have the option to disable these functions.
|
|
4333
4333
|
* @modified 2023-09-29 Adding proper dicionary key and value types to the params of `PlotBoilerplate.utils.safeMergeByKeys` (was `object` before).
|
|
4334
|
-
* @
|
|
4334
|
+
* @modified 2024-07-08 Adding `PlotBoilerplate.getGUI()` to retrieve the GUI instance.
|
|
4335
|
+
* @modified 2024-08-25 Extending main class `PlotBoilerplate` optional param `isBackdropFiltersEnabled`.
|
|
4336
|
+
*
|
|
4337
|
+
* @version 1.19.0
|
|
4335
4338
|
*
|
|
4336
4339
|
* @file PlotBoilerplate
|
|
4337
4340
|
* @fileoverview The main class.
|
|
@@ -4466,6 +4469,10 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4466
4469
|
* @private
|
|
4467
4470
|
*/
|
|
4468
4471
|
this.renderTime = 0;
|
|
4472
|
+
/**
|
|
4473
|
+
* A storage variable for retrieving the GUI instance once it was created.
|
|
4474
|
+
*/
|
|
4475
|
+
this._gui = null;
|
|
4469
4476
|
// This should be in some static block ...
|
|
4470
4477
|
VertexAttr_1.VertexAttr.model = {
|
|
4471
4478
|
bezierAutoAdjust: false,
|
|
@@ -4532,7 +4539,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4532
4539
|
enableZoom: f.bool(config, "enableZoom", true), // default=true
|
|
4533
4540
|
enablePan: f.bool(config, "enablePan", true), // default=true
|
|
4534
4541
|
// Experimental (and unfinished)
|
|
4535
|
-
enableGL: f.bool(config, "enableGL", false)
|
|
4542
|
+
enableGL: f.bool(config, "enableGL", false),
|
|
4543
|
+
isBackdropFiltersEnabled: f.bool(config, "isBackdropFiltersEnabled", true)
|
|
4536
4544
|
}; // END confog
|
|
4537
4545
|
/**
|
|
4538
4546
|
* Configuration for drawing things.
|
|
@@ -6010,7 +6018,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6010
6018
|
return { x: pos.x - bounds.left, y: pos.y - bounds.top };
|
|
6011
6019
|
};
|
|
6012
6020
|
// Make PB work together with both, AlloyFinger as a esm module or a commonjs function.
|
|
6013
|
-
if (typeof globalThis["AlloyFinger"] === "function" ||
|
|
6021
|
+
if (typeof globalThis["AlloyFinger"] === "function" ||
|
|
6022
|
+
typeof globalThis["createAlloyFinger"] === "function") {
|
|
6014
6023
|
try {
|
|
6015
6024
|
var touchMovePos = null;
|
|
6016
6025
|
var touchDownPos = null;
|
|
@@ -6209,12 +6218,20 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6209
6218
|
// if (globalThis["utils"] && typeof globalThis["utils"].createGUI == "function") {
|
|
6210
6219
|
// return (globalThis["utils" as keyof Object] as any as ({createGUI : (pb:PlotBoilerplate,props:DatGuiProps|undefined)=>GUI })).createGUI(this, props);
|
|
6211
6220
|
if (utils && typeof utils.createGUI === "function") {
|
|
6212
|
-
return utils.createGUI(this, props);
|
|
6221
|
+
return (this._gui = utils.createGUI(this, props));
|
|
6213
6222
|
}
|
|
6214
6223
|
else {
|
|
6215
|
-
throw "Cannot create dat.GUI instance; did you load the ./utils/creategui helper function an the dat.GUI library?";
|
|
6224
|
+
throw "Cannot create dat.GUI or lil-gui instance; did you load the ./utils/creategui helper function an the dat.GUI/lil-gui library?";
|
|
6216
6225
|
}
|
|
6217
6226
|
};
|
|
6227
|
+
/**
|
|
6228
|
+
* Retriebe the GUI once it was created. If the `createGUI` method was not called or failed to create any
|
|
6229
|
+
* GUI then null is returned.
|
|
6230
|
+
* @returns {GUI | null}
|
|
6231
|
+
*/
|
|
6232
|
+
PlotBoilerplate.prototype.getGUI = function () {
|
|
6233
|
+
return this._gui;
|
|
6234
|
+
};
|
|
6218
6235
|
var _a;
|
|
6219
6236
|
/** @constant {number} */
|
|
6220
6237
|
PlotBoilerplate.DEFAULT_CANVAS_WIDTH = 1024;
|
|
@@ -11768,7 +11785,8 @@ var GLU = /** @class */ (function () {
|
|
|
11768
11785
|
* @modified 2023-10-04 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
|
|
11769
11786
|
* @modified 2024-01-30 Fixing an issue with immutable style sets; changes to the global draw config did not reflect here (do now).
|
|
11770
11787
|
* @modified 2024-03-10 Fixing some types for Typescript 5 compatibility.
|
|
11771
|
-
* @
|
|
11788
|
+
* @modified 2024-07-24 Caching custom style defs in a private buffer variable.
|
|
11789
|
+
* @version 1.6.10
|
|
11772
11790
|
**/
|
|
11773
11791
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11774
11792
|
exports.drawutilssvg = void 0;
|
|
@@ -11883,6 +11901,13 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11883
11901
|
console.warn("Warning: your draw config is missing the key '".concat(k, "' which is required."));
|
|
11884
11902
|
}
|
|
11885
11903
|
}
|
|
11904
|
+
if (this.customStyleDefs) {
|
|
11905
|
+
rules.push("\n/* Custom styles */\n");
|
|
11906
|
+
this.customStyleDefs.forEach(function (value, key) {
|
|
11907
|
+
rules.push(key + " { " + value + " }");
|
|
11908
|
+
});
|
|
11909
|
+
// this.nodeStyle.innerHTML += "\n/* Custom styles */\n" + rules.join("\n");
|
|
11910
|
+
}
|
|
11886
11911
|
this.nodeStyle.innerHTML = rules.join("\n");
|
|
11887
11912
|
};
|
|
11888
11913
|
/**
|
|
@@ -11906,11 +11931,7 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11906
11931
|
* @param {Map<string,string>} defs
|
|
11907
11932
|
*/
|
|
11908
11933
|
drawutilssvg.prototype.addCustomStyleDefs = function (defs) {
|
|
11909
|
-
|
|
11910
|
-
defs.forEach(function (value, key) {
|
|
11911
|
-
buffer.push(key + " { " + value + " }");
|
|
11912
|
-
});
|
|
11913
|
-
this.nodeStyle.innerHTML += "\n/* Custom styles */\n" + buffer.join("\n");
|
|
11934
|
+
this.customStyleDefs = defs;
|
|
11914
11935
|
};
|
|
11915
11936
|
/**
|
|
11916
11937
|
* Retieve an old (cached) element.
|