flow like the river

This commit is contained in:
root 2025-11-07 00:06:12 +01:00
commit 013fe673f3
42435 changed files with 5764238 additions and 0 deletions

21
VISUALIZACION/node_modules/data-joint/LICENSE generated vendored Executable file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Vasco Asturiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

74
VISUALIZACION/node_modules/data-joint/README.md generated vendored Executable file
View file

@ -0,0 +1,74 @@
data-joint
==========
[![NPM package][npm-img]][npm-url]
[![Build Size][build-size-img]][build-size-url]
[![NPM Downloads][npm-downloads-img]][npm-downloads-url]
Library to perform data joins with any type of JavaScript objects.
Useful in digest cycles where it's important to minimize changes to a view for performance reasons, such as DOM manipulation.
The module binds data points to objects via hidden attributes, and performs diffing comparisons across multiple iterations to ensure objects are not created or removed unnecessarily, thus keeping view changes to a minimum.
## Quick start
```js
import dataJoint from 'data-joint';
```
or using a *script* tag
```html
<script src="//unpkg.com/data-joint"></script>
```
then
```js
const myData = [{ id: 0, val: 2 }, { id: 1, val: 4 }, { id: 2, val: 7 }];
const myView = new Set();
dataJoint(myData, [...myView],
obj => myView.add(obj), // append obj
obj => myView.delete(obj), // remove obj
{
createObj: () => ({}),
updateObj: (obj, d) => { obj.double = d.val * 2 },
exitObj: obj => { obj.double = 0 },
idAccessor: d => d.id
}
);
```
## API reference
### Syntax
<b>dataJoint</b>(<i>data</i>, <i>existingObjs</i>, <i>appendObjFn</i>, <i>removeObjFn</i>, [{<i>options</i>}]);
### Arguments
<b>data</b>: An array of data points. Each point should be an object that supports attribute binding.
<b>existingObjs</b>: An array of view objects to join the data with.
<b>appendObjFn</b>: The method to add a new object to the view. The object is passed as single argument: `obj => { ... }`.
<b>removeObjFn</b>: The method to remove an existing object from the view. The object is passed as single argument: `obj => { ... }`.
### Options
An optional configuration object supporting the additional arguments:
| Option | Description | Default |
| --- | --- | --- |
| <b>createObj</b> | The method to create an entering view object for a new data point that does not have a corresponding object. The data point is passed as single argument: `d => { ... }`. The method should return a new object. | `d => ({})` |
| <b>updateObj</b> | The method to update an existing bound object with new data. The object and the data point are passed as arguments: `(obj, d) => { ... }`. This method is also called for entering objects after `createObj`. | `(obj, d) => {}` |
| <b>exitObj</b> | The method to handle exiting objects which no longer have a corresponding data point. The unbound object is passed as single argument: `obj => { ... }`. This method is called prior to removing it from the view via `removeObjectFn`. | `obj => {}` |
| <b>objBindAttr</b> | The attribute name used to bind data points to view objects. Each data point passed through the digest will be added this attribute, and it will be used for diffing across multiple iterations. | `__obj` |
| <b>dataBindAttr</b> | The attribute name used to bind view objects to data points. Each object maintained by the digest will be added this attribute, and it will be used for diffing across multiple iterations. | `__data` |
| <b>idAccessor</b> | A data point accessor function to extract the point unique identifier. This is used for comparing data points across multiple iterations. If no `idAccessor` is supplied, the data point object reference will be used instead for comparisons. The data point is passed as single argument: `d => {...}`. The method should return a unique identifier. | `undefined` |
| <b>purge</b> | A boolean value. If set to `true` it will bypass the data diffing, resulting in all the `existingObjs` being marked for removal and new objects created for the all the items in the input `data`. | `false` |
[npm-img]: https://img.shields.io/npm/v/data-joint
[npm-url]: https://npmjs.org/package/data-joint
[build-size-img]: https://img.shields.io/bundlephobia/minzip/data-joint
[build-size-url]: https://bundlephobia.com/result?p=data-joint
[npm-downloads-img]: https://img.shields.io/npm/dt/data-joint
[npm-downloads-url]: https://www.npmtrends.com/data-joint

20
VISUALIZACION/node_modules/data-joint/dist/data-joint.d.ts generated vendored Executable file
View file

@ -0,0 +1,20 @@
type Datum = object;
type Obj = object;
declare function dataJoint(
data: Datum[],
existingObjs: Obj[],
appendObj: (obj: Obj) => void,
removeObj: (obj: Obj) => void,
options: {
createObj?(d: Datum): Obj,
updateObj?(obj: Obj, d: Datum): void,
exitObj?(obj: Obj): void,
objBindAttr?: string,
dataBindAttr?: string,
idAccessor?: string | ((Datum) => string | number) | null,
purge?: boolean;
}
): void;
export { dataJoint as default };

480
VISUALIZACION/node_modules/data-joint/dist/data-joint.js generated vendored Executable file
View file

@ -0,0 +1,480 @@
// Version 1.3.1 data-joint - https://github.com/vasturiano/data-joint
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.dataJoint = factory());
})(this, (function () { 'use strict';
function _iterableToArrayLimit$1(arr, i) {
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
if (null != _i) {
var _s,
_e,
_x,
_r,
_arr = [],
_n = !0,
_d = !1;
try {
if (_x = (_i = _i.call(arr)).next, 0 === i) {
if (Object(_i) !== _i) return;
_n = !1;
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
} catch (err) {
_d = !0, _e = err;
} finally {
try {
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
} finally {
if (_d) throw _e;
}
}
return _arr;
}
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
enumerableOnly && (symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
_defineProperty(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey$1(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _objectWithoutPropertiesLoose$1(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties$1(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose$1(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _slicedToArray$1(arr, i) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
}
function _toConsumableArray$1(arr) {
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
}
function _arrayWithoutHoles$1(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArray$1(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray$1(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
}
function _arrayLikeToArray$1(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread$1() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive$1(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey$1(arg) {
var key = _toPrimitive$1(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
function _iterableToArrayLimit(arr, i) {
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
if (null != _i) {
var _s,
_e,
_x,
_r,
_arr = [],
_n = !0,
_d = !1;
try {
if (_x = (_i = _i.call(arr)).next, 0 === i) {
if (Object(_i) !== _i) return;
_n = !1;
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
} catch (err) {
_d = !0, _e = err;
} finally {
try {
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
} finally {
if (_d) throw _e;
}
}
return _arr;
}
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
var index = (function () {
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var keyAccessors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var multiItem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var flattenKeys = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var keys = (keyAccessors instanceof Array ? keyAccessors.length ? keyAccessors : [undefined] : [keyAccessors]).map(function (key) {
return {
keyAccessor: key,
isProp: !(key instanceof Function)
};
});
var indexedResult = list.reduce(function (res, item) {
var iterObj = res;
var itemVal = item;
keys.forEach(function (_ref, idx) {
var keyAccessor = _ref.keyAccessor,
isProp = _ref.isProp;
var key;
if (isProp) {
var _itemVal = itemVal,
propVal = _itemVal[keyAccessor],
rest = _objectWithoutProperties(_itemVal, [keyAccessor].map(_toPropertyKey));
key = propVal;
itemVal = rest;
} else {
key = keyAccessor(itemVal, idx);
}
if (idx + 1 < keys.length) {
if (!iterObj.hasOwnProperty(key)) {
iterObj[key] = {};
}
iterObj = iterObj[key];
} else {
// Leaf key
if (multiItem) {
if (!iterObj.hasOwnProperty(key)) {
iterObj[key] = [];
}
iterObj[key].push(itemVal);
} else {
iterObj[key] = itemVal;
}
}
});
return res;
}, {});
if (multiItem instanceof Function) {
// Reduce leaf multiple values
(function reduce(node) {
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
if (level === keys.length) {
Object.keys(node).forEach(function (k) {
return node[k] = multiItem(node[k]);
});
} else {
Object.values(node).forEach(function (child) {
return reduce(child, level + 1);
});
}
})(indexedResult); // IIFE
}
var result = indexedResult;
if (flattenKeys) {
// flatten into array
result = [];
(function flatten(node) {
var accKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
if (accKeys.length === keys.length) {
result.push({
keys: accKeys,
vals: node
});
} else {
Object.entries(node).forEach(function (_ref2) {
var _ref3 = _slicedToArray(_ref2, 2),
key = _ref3[0],
val = _ref3[1];
return flatten(val, [].concat(_toConsumableArray(accKeys), [key]));
});
}
})(indexedResult); //IIFE
if (keyAccessors instanceof Array && keyAccessors.length === 0 && result.length === 1) {
// clear keys if there's no key accessors (single result)
result[0].keys = [];
}
}
return result;
});
var _excluded = ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"];
function diffArrays(prev, next, idAccessor) {
var result = {
enter: [],
update: [],
exit: []
};
if (!idAccessor) {
// use object references for comparison
var prevSet = new Set(prev);
var nextSet = new Set(next);
new Set([].concat(_toConsumableArray$1(prevSet), _toConsumableArray$1(nextSet))).forEach(function (item) {
var type = !prevSet.has(item) ? 'enter' : !nextSet.has(item) ? 'exit' : 'update';
result[type].push(type === 'update' ? [item, item] : item);
});
} else {
// compare by id (duplicate keys are ignored)
var prevById = index(prev, idAccessor, false);
var nextById = index(next, idAccessor, false);
var byId = Object.assign({}, prevById, nextById);
Object.entries(byId).forEach(function (_ref) {
var _ref2 = _slicedToArray$1(_ref, 2),
id = _ref2[0],
item = _ref2[1];
var type = !prevById.hasOwnProperty(id) ? 'enter' : !nextById.hasOwnProperty(id) ? 'exit' : 'update';
result[type].push(type === 'update' ? [prevById[id], nextById[id]] : item);
});
}
return result;
}
function dataBindDiff(data, existingObjs, _ref3) {
var _ref3$objBindAttr = _ref3.objBindAttr,
objBindAttr = _ref3$objBindAttr === void 0 ? '__obj' : _ref3$objBindAttr,
_ref3$dataBindAttr = _ref3.dataBindAttr,
dataBindAttr = _ref3$dataBindAttr === void 0 ? '__data' : _ref3$dataBindAttr,
idAccessor = _ref3.idAccessor,
_ref3$purge = _ref3.purge,
purge = _ref3$purge === void 0 ? false : _ref3$purge;
var isObjValid = function isObjValid(obj) {
return obj.hasOwnProperty(dataBindAttr);
};
var removeObjs = existingObjs.filter(function (obj) {
return !isObjValid(obj);
});
var prevD = existingObjs.filter(isObjValid).map(function (obj) {
return obj[dataBindAttr];
});
var nextD = data;
var diff = purge ? {
enter: nextD,
exit: prevD,
update: []
} // don't diff data in purge mode
: diffArrays(prevD, nextD, idAccessor);
diff.update = diff.update.map(function (_ref4) {
var _ref5 = _slicedToArray$1(_ref4, 2),
prevD = _ref5[0],
nextD = _ref5[1];
if (prevD !== nextD) {
// transfer obj to new data point (if different)
nextD[objBindAttr] = prevD[objBindAttr];
nextD[objBindAttr][dataBindAttr] = nextD;
}
return nextD;
});
diff.exit = diff.exit.concat(removeObjs.map(function (obj) {
return _defineProperty({}, objBindAttr, obj);
}));
return diff;
}
function viewDigest(data, existingObjs,
// list
appendObj,
// item => {...} function
removeObj, // item => {...} function
_ref7) {
var _ref7$createObj = _ref7.createObj,
createObj = _ref7$createObj === void 0 ? function (d) {
return {};
} : _ref7$createObj,
_ref7$updateObj = _ref7.updateObj,
updateObj = _ref7$updateObj === void 0 ? function (obj, d) {} : _ref7$updateObj,
_ref7$exitObj = _ref7.exitObj,
exitObj = _ref7$exitObj === void 0 ? function (obj) {} : _ref7$exitObj,
_ref7$objBindAttr = _ref7.objBindAttr,
objBindAttr = _ref7$objBindAttr === void 0 ? '__obj' : _ref7$objBindAttr,
_ref7$dataBindAttr = _ref7.dataBindAttr,
dataBindAttr = _ref7$dataBindAttr === void 0 ? '__data' : _ref7$dataBindAttr,
dataDiffOptions = _objectWithoutProperties$1(_ref7, _excluded);
var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2({
objBindAttr: objBindAttr,
dataBindAttr: dataBindAttr
}, dataDiffOptions)),
enter = _dataBindDiff.enter,
update = _dataBindDiff.update,
exit = _dataBindDiff.exit;
// Remove exiting points
exit.forEach(function (d) {
var obj = d[objBindAttr];
delete d[objBindAttr]; // unbind obj
exitObj(obj);
removeObj(obj);
});
var newObjs = createObjs(enter);
var pointsData = [].concat(_toConsumableArray$1(enter), _toConsumableArray$1(update));
updateObjs(pointsData);
// Add new points
newObjs.forEach(appendObj);
//
function createObjs(data) {
var newObjs = [];
data.forEach(function (d) {
var obj = createObj(d);
if (obj) {
obj[dataBindAttr] = d;
d[objBindAttr] = obj;
newObjs.push(obj);
}
});
return newObjs;
}
function updateObjs(data) {
data.forEach(function (d) {
var obj = d[objBindAttr];
if (obj) {
obj[dataBindAttr] = d;
updateObj(obj, d);
}
});
}
}
return viewDigest;
}));
//# sourceMappingURL=data-joint.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

278
VISUALIZACION/node_modules/data-joint/dist/data-joint.mjs generated vendored Executable file
View file

@ -0,0 +1,278 @@
import indexBy from 'index-array-by';
function _iterableToArrayLimit(arr, i) {
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
if (null != _i) {
var _s,
_e,
_x,
_r,
_arr = [],
_n = !0,
_d = !1;
try {
if (_x = (_i = _i.call(arr)).next, 0 === i) {
if (Object(_i) !== _i) return;
_n = !1;
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
} catch (err) {
_d = !0, _e = err;
} finally {
try {
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
} finally {
if (_d) throw _e;
}
}
return _arr;
}
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
enumerableOnly && (symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
_defineProperty(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
var _excluded = ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"];
function diffArrays(prev, next, idAccessor) {
var result = {
enter: [],
update: [],
exit: []
};
if (!idAccessor) {
// use object references for comparison
var prevSet = new Set(prev);
var nextSet = new Set(next);
new Set([].concat(_toConsumableArray(prevSet), _toConsumableArray(nextSet))).forEach(function (item) {
var type = !prevSet.has(item) ? 'enter' : !nextSet.has(item) ? 'exit' : 'update';
result[type].push(type === 'update' ? [item, item] : item);
});
} else {
// compare by id (duplicate keys are ignored)
var prevById = indexBy(prev, idAccessor, false);
var nextById = indexBy(next, idAccessor, false);
var byId = Object.assign({}, prevById, nextById);
Object.entries(byId).forEach(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
id = _ref2[0],
item = _ref2[1];
var type = !prevById.hasOwnProperty(id) ? 'enter' : !nextById.hasOwnProperty(id) ? 'exit' : 'update';
result[type].push(type === 'update' ? [prevById[id], nextById[id]] : item);
});
}
return result;
}
function dataBindDiff(data, existingObjs, _ref3) {
var _ref3$objBindAttr = _ref3.objBindAttr,
objBindAttr = _ref3$objBindAttr === void 0 ? '__obj' : _ref3$objBindAttr,
_ref3$dataBindAttr = _ref3.dataBindAttr,
dataBindAttr = _ref3$dataBindAttr === void 0 ? '__data' : _ref3$dataBindAttr,
idAccessor = _ref3.idAccessor,
_ref3$purge = _ref3.purge,
purge = _ref3$purge === void 0 ? false : _ref3$purge;
var isObjValid = function isObjValid(obj) {
return obj.hasOwnProperty(dataBindAttr);
};
var removeObjs = existingObjs.filter(function (obj) {
return !isObjValid(obj);
});
var prevD = existingObjs.filter(isObjValid).map(function (obj) {
return obj[dataBindAttr];
});
var nextD = data;
var diff = purge ? {
enter: nextD,
exit: prevD,
update: []
} // don't diff data in purge mode
: diffArrays(prevD, nextD, idAccessor);
diff.update = diff.update.map(function (_ref4) {
var _ref5 = _slicedToArray(_ref4, 2),
prevD = _ref5[0],
nextD = _ref5[1];
if (prevD !== nextD) {
// transfer obj to new data point (if different)
nextD[objBindAttr] = prevD[objBindAttr];
nextD[objBindAttr][dataBindAttr] = nextD;
}
return nextD;
});
diff.exit = diff.exit.concat(removeObjs.map(function (obj) {
return _defineProperty({}, objBindAttr, obj);
}));
return diff;
}
function viewDigest(data, existingObjs,
// list
appendObj,
// item => {...} function
removeObj, // item => {...} function
_ref7) {
var _ref7$createObj = _ref7.createObj,
createObj = _ref7$createObj === void 0 ? function (d) {
return {};
} : _ref7$createObj,
_ref7$updateObj = _ref7.updateObj,
updateObj = _ref7$updateObj === void 0 ? function (obj, d) {} : _ref7$updateObj,
_ref7$exitObj = _ref7.exitObj,
exitObj = _ref7$exitObj === void 0 ? function (obj) {} : _ref7$exitObj,
_ref7$objBindAttr = _ref7.objBindAttr,
objBindAttr = _ref7$objBindAttr === void 0 ? '__obj' : _ref7$objBindAttr,
_ref7$dataBindAttr = _ref7.dataBindAttr,
dataBindAttr = _ref7$dataBindAttr === void 0 ? '__data' : _ref7$dataBindAttr,
dataDiffOptions = _objectWithoutProperties(_ref7, _excluded);
var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2({
objBindAttr: objBindAttr,
dataBindAttr: dataBindAttr
}, dataDiffOptions)),
enter = _dataBindDiff.enter,
update = _dataBindDiff.update,
exit = _dataBindDiff.exit;
// Remove exiting points
exit.forEach(function (d) {
var obj = d[objBindAttr];
delete d[objBindAttr]; // unbind obj
exitObj(obj);
removeObj(obj);
});
var newObjs = createObjs(enter);
var pointsData = [].concat(_toConsumableArray(enter), _toConsumableArray(update));
updateObjs(pointsData);
// Add new points
newObjs.forEach(appendObj);
//
function createObjs(data) {
var newObjs = [];
data.forEach(function (d) {
var obj = createObj(d);
if (obj) {
obj[dataBindAttr] = d;
d[objBindAttr] = obj;
newObjs.push(obj);
}
});
return newObjs;
}
function updateObjs(data) {
data.forEach(function (d) {
var obj = d[objBindAttr];
if (obj) {
obj[dataBindAttr] = d;
updateObj(obj, d);
}
});
}
}
export { viewDigest as default };

35
VISUALIZACION/node_modules/data-joint/example/index.html generated vendored Executable file
View file

@ -0,0 +1,35 @@
<head>
<script src="//unpkg.com/data-joint"></script>
<!--<script src="../dist/data-joint.js"></script>-->
</head>
<body>
<script>
const myView = new Set();
digest([{ id: 0, val: 2 }, { id: 1, val: 4 }, { id: 2, val: 7 }]);
digest([{ id: 1, val: 4 }, { id: 2, val: 3 }, { id: 3, val: 9 }]);
console.log('final data', [...myView]);
function digest(data) {
dataJoint(data, [...myView],
obj => myView.add(obj), // append obj
obj => myView.delete(obj), // remove obj
{
createObj: (d) => {
console.log('createObj', d);
return {};
},
updateObj: (obj, d) => {
obj.double = d.val * 2;
console.log('updateObj', obj, d);
},
exitObj: obj => {
obj.double = 0;
console.log('exitObj', obj);
},
idAccessor: d => d.id
}
);
}
</script>
</body>

63
VISUALIZACION/node_modules/data-joint/package.json generated vendored Executable file
View file

@ -0,0 +1,63 @@
{
"name": "data-joint",
"version": "1.3.1",
"description": "Perform data joins with any type of JS objects",
"type": "module",
"unpkg": "dist/data-joint.min.js",
"main": "dist/data-joint.mjs",
"module": "dist/data-joint.mjs",
"types": "dist/data-joint.d.ts",
"exports": {
"umd": "./dist/data-joint.min.js",
"default": "./dist/data-joint.mjs"
},
"sideEffects": false,
"homepage": "https://github.com/vasturiano/data-joint",
"repository": {
"type": "git",
"url": "git+https://github.com/vasturiano/data-joint.git"
},
"bugs": {
"url": "https://github.com/vasturiano/data-joint/issues"
},
"license": "MIT",
"keywords": [
"data",
"array",
"join",
"digest",
"performance"
],
"author": {
"name": "Vasco Asturiano",
"url": "https://github.com/vasturiano"
},
"files": [
"src/**/*",
"dist/**/*",
"example/**/*"
],
"scripts": {
"build": "rimraf dist && rollup -c",
"dev": "rollup -w -c",
"prepare": "npm run build"
},
"dependencies": {
"index-array-by": "^1.4.0"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"rimraf": "^4.1.2",
"rollup": "^3.14.0",
"rollup-plugin-dts": "^5.1.1",
"typescript": "^4.9.5"
},
"engines": {
"node": ">=12"
}
}

20
VISUALIZACION/node_modules/data-joint/src/index.d.ts generated vendored Executable file
View file

@ -0,0 +1,20 @@
type Datum = object;
type Obj = object;
declare function dataJoint(
data: Datum[],
existingObjs: Obj[],
appendObj: (obj: Obj) => void,
removeObj: (obj: Obj) => void,
options: {
createObj?(d: Datum): Obj,
updateObj?(obj: Obj, d: Datum): void,
exitObj?(obj: Obj): void,
objBindAttr?: string,
dataBindAttr?: string,
idAccessor?: string | ((Datum) => string | number) | null,
purge?: boolean;
}
): void;
export default dataJoint;

135
VISUALIZACION/node_modules/data-joint/src/index.js generated vendored Executable file
View file

@ -0,0 +1,135 @@
import indexBy from 'index-array-by';
function diffArrays(prev, next, idAccessor) {
const result = { enter: [], update: [], exit: [] };
if (!idAccessor) { // use object references for comparison
const prevSet = new Set(prev);
const nextSet = new Set(next);
new Set([...prevSet, ...nextSet]).forEach(item => {
const type = !prevSet.has(item)
? 'enter'
: !nextSet.has(item)
? 'exit'
: 'update';
result[type].push(type === 'update' ? [item, item]: item);
});
} else { // compare by id (duplicate keys are ignored)
const prevById = indexBy(prev, idAccessor, false);
const nextById = indexBy(next, idAccessor, false);
const byId = Object.assign({}, prevById, nextById);
Object.entries(byId).forEach(([id, item]) => {
const type = !prevById.hasOwnProperty(id)
? 'enter'
: !nextById.hasOwnProperty(id)
? 'exit'
: 'update';
result[type].push(type === 'update' ? [prevById[id], nextById[id]]: item);
});
}
return result;
}
function dataBindDiff(
data,
existingObjs,
{
objBindAttr = '__obj',
dataBindAttr = '__data',
idAccessor,
purge = false
}
) {
const isObjValid = obj => obj.hasOwnProperty(dataBindAttr);
const removeObjs = existingObjs.filter(obj => !isObjValid(obj));
const prevD = existingObjs.filter(isObjValid).map(obj => obj[dataBindAttr]);
const nextD = data;
const diff = purge
? { enter: nextD, exit: prevD, update: [] } // don't diff data in purge mode
: diffArrays(prevD, nextD, idAccessor);
diff.update = diff.update.map(([prevD, nextD]) => {
if (prevD !== nextD) {
// transfer obj to new data point (if different)
nextD[objBindAttr] = prevD[objBindAttr];
nextD[objBindAttr][dataBindAttr] = nextD;
}
return nextD;
});
diff.exit = diff.exit.concat(removeObjs.map(obj => ({
[objBindAttr]: obj
})));
return diff;
}
function viewDigest(
data,
existingObjs, // list
appendObj, // item => {...} function
removeObj, // item => {...} function
{
createObj = d => ({}),
updateObj = (obj, d) => {},
exitObj = obj => {},
objBindAttr = '__obj',
dataBindAttr = '__data',
...dataDiffOptions
}
) {
const { enter, update, exit } = dataBindDiff(data, existingObjs, { objBindAttr, dataBindAttr, ...dataDiffOptions });
// Remove exiting points
exit.forEach(d => {
const obj = d[objBindAttr];
delete(d[objBindAttr]); // unbind obj
exitObj(obj);
removeObj(obj);
});
const newObjs = createObjs(enter);
const pointsData = [...enter, ...update];
updateObjs(pointsData);
// Add new points
newObjs.forEach(appendObj);
//
function createObjs(data) {
const newObjs = [];
data.forEach(d => {
const obj = createObj(d);
if (obj) {
obj[dataBindAttr] = d;
d[objBindAttr] = obj;
newObjs.push(obj);
}
});
return newObjs;
}
function updateObjs(data) {
data.forEach(d => {
const obj = d[objBindAttr];
if (obj) {
obj[dataBindAttr] = d;
updateObj(obj, d);
}
});
}
}
export default viewDigest;