data-joint
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -256,16 +256,18 @@ 'use strict'; | ||
update = _dataBindDiff.update, | ||
exit = _dataBindDiff.exit; | ||
exit = _dataBindDiff.exit; // Remove exiting points | ||
var newObjs = createObjs(enter); | ||
var pointsData = [].concat(_toConsumableArray(enter), _toConsumableArray(update)); | ||
updateObjs(pointsData); // Add new points | ||
newObjs.forEach(appendObj); // 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) { | ||
@@ -272,0 +274,0 @@ var newObjs = []; |
@@ -1,2 +0,2 @@ | ||
// Version 1.2.0 data-joint - https://github.com/vasturiano/data-joint | ||
// Version 1.2.1 data-joint - https://github.com/vasturiano/data-joint | ||
(function (global, factory) { | ||
@@ -468,16 +468,18 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
update = _dataBindDiff.update, | ||
exit = _dataBindDiff.exit; | ||
exit = _dataBindDiff.exit; // Remove exiting points | ||
var newObjs = createObjs(enter); | ||
var pointsData = [].concat(_toConsumableArray(enter), _toConsumableArray(update)); | ||
updateObjs(pointsData); // Add new points | ||
newObjs.forEach(appendObj); // 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) { | ||
@@ -484,0 +486,0 @@ var newObjs = []; |
@@ -1,2 +0,2 @@ | ||
// Version 1.2.0 data-joint - https://github.com/vasturiano/data-joint | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).dataJoint=r()}(this,(function(){"use strict";function t(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function r(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function e(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function n(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function a(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}var f=function(t,r){var e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=(r instanceof Array?r:[r]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),f=t.reduce((function(t,r){var n=t,a=r;return o.forEach((function(t,r){var u,f=t.keyAccessor;if(t.isProp){var l=a,p=l[f],s=i(l,[f].map(c));u=p,a=s}else u=f(a,r);r+1<o.length?(n.hasOwnProperty(u)||(n[u]={}),n=n[u]):e?(n.hasOwnProperty(u)||(n[u]=[]),n[u].push(a)):n[u]=a})),t}),{});e instanceof Function&&function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===o.length?Object.keys(r).forEach((function(t){return r[t]=e(r[t])})):Object.values(r).forEach((function(r){return t(r,n+1)}))}(f);var l=f;return n&&(l=[],function t(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length===o.length?l.push({keys:e,vals:r}):Object.entries(r).forEach((function(r){var n=a(r,2),o=n[0],i=n[1];return t(i,[].concat(u(e),[o]))}))}(f)),l};function l(r,e,i){var a=i.objBindAttr,u=void 0===a?"__obj":a,c=i.dataBindAttr,l=void 0===c?"__data":c,p=i.idAccessor,s=i.purge,y=void 0!==s&&s,b=function(t){return t.hasOwnProperty(l)},d=e.filter((function(t){return!b(t)})),v=e.filter(b).map((function(t){return t[l]})),h=y?{enter:r,exit:v,update:[]}:function(t,r,e){var i={enter:[],update:[],exit:[]};if(e){var a=f(t,e,!1),u=f(r,e,!1),c=Object.assign({},a,u);Object.entries(c).forEach((function(t){var r=n(t,2),e=r[0],o=r[1],c=a.hasOwnProperty(e)?u.hasOwnProperty(e)?"update":"exit":"enter";i[c].push("update"===c?[a[e],u[e]]:o)}))}else{var l=new Set(t),p=new Set(r);new Set([].concat(o(l),o(p))).forEach((function(t){var r=l.has(t)?p.has(t)?"update":"exit":"enter";i[r].push("update"===r?[t,t]:t)}))}return i}(v,r,p);return h.update=h.update.map((function(t){var r=n(t,2),e=r[0],o=r[1];return e!==o&&(o[u]=e[u],o[u][l]=o),o})),h.exit=h.exit.concat(d.map((function(r){return t({},u,r)}))),h}return function(n,i,a,u,c){var f=c.createObj,p=void 0===f?function(t){return{}}:f,s=c.updateObj,y=void 0===s?function(t,r){}:s,b=c.exitObj,d=void 0===b?function(t){}:b,v=c.objBindAttr,h=void 0===v?"__obj":v,O=c.dataBindAttr,j=void 0===O?"__data":O,g=e(c,["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"]),m=l(n,i,function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(o,!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(o).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({objBindAttr:h,dataBindAttr:j},g)),w=m.enter,A=m.update,P=m.exit,S=function(t){var r=[];return t.forEach((function(t){var e=p(t);e&&(e[j]=t,t[h]=e,r.push(e))})),r}(w);!function(t){t.forEach((function(t){var r=t[h];r&&(r[j]=t,y(r,t))}))}([].concat(o(w),o(A))),S.forEach(a),P.forEach((function(t){var r=t[h];d(r),u(r)}))}})); | ||
// Version 1.2.1 data-joint - https://github.com/vasturiano/data-joint | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).dataJoint=r()}(this,(function(){"use strict";function t(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function r(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function e(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function n(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,r){if(null==t)return{};var e,n,o=function(t,r){if(null==t)return{};var e,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||(o[e]=t[e]);return o}(t,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)e=i[n],r.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(t,e)&&(o[e]=t[e])}return o}function a(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r<t.length;r++)e[r]=t[r];return e}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(t){var r=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==typeof r?r:String(r)}var f=function(t,r){var e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=(r instanceof Array?r:[r]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),f=t.reduce((function(t,r){var n=t,a=r;return o.forEach((function(t,r){var u,f=t.keyAccessor;if(t.isProp){var l=a,p=l[f],s=i(l,[f].map(c));u=p,a=s}else u=f(a,r);r+1<o.length?(n.hasOwnProperty(u)||(n[u]={}),n=n[u]):e?(n.hasOwnProperty(u)||(n[u]=[]),n[u].push(a)):n[u]=a})),t}),{});e instanceof Function&&function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;n===o.length?Object.keys(r).forEach((function(t){return r[t]=e(r[t])})):Object.values(r).forEach((function(r){return t(r,n+1)}))}(f);var l=f;return n&&(l=[],function t(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.length===o.length?l.push({keys:e,vals:r}):Object.entries(r).forEach((function(r){var n=a(r,2),o=n[0],i=n[1];return t(i,[].concat(u(e),[o]))}))}(f)),l};function l(r,e,i){var a=i.objBindAttr,u=void 0===a?"__obj":a,c=i.dataBindAttr,l=void 0===c?"__data":c,p=i.idAccessor,s=i.purge,y=void 0!==s&&s,b=function(t){return t.hasOwnProperty(l)},d=e.filter((function(t){return!b(t)})),v=e.filter(b).map((function(t){return t[l]})),h=y?{enter:r,exit:v,update:[]}:function(t,r,e){var i={enter:[],update:[],exit:[]};if(e){var a=f(t,e,!1),u=f(r,e,!1),c=Object.assign({},a,u);Object.entries(c).forEach((function(t){var r=n(t,2),e=r[0],o=r[1],c=a.hasOwnProperty(e)?u.hasOwnProperty(e)?"update":"exit":"enter";i[c].push("update"===c?[a[e],u[e]]:o)}))}else{var l=new Set(t),p=new Set(r);new Set([].concat(o(l),o(p))).forEach((function(t){var r=l.has(t)?p.has(t)?"update":"exit":"enter";i[r].push("update"===r?[t,t]:t)}))}return i}(v,r,p);return h.update=h.update.map((function(t){var r=n(t,2),e=r[0],o=r[1];return e!==o&&(o[u]=e[u],o[u][l]=o),o})),h.exit=h.exit.concat(d.map((function(r){return t({},u,r)}))),h}return function(n,i,a,u,c){var f=c.createObj,p=void 0===f?function(t){return{}}:f,s=c.updateObj,y=void 0===s?function(t,r){}:s,b=c.exitObj,d=void 0===b?function(t){}:b,v=c.objBindAttr,h=void 0===v?"__obj":v,O=c.dataBindAttr,j=void 0===O?"__data":O,g=e(c,["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"]),m=l(n,i,function(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(o,!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(o).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({objBindAttr:h,dataBindAttr:j},g)),w=m.enter,A=m.update;m.exit.forEach((function(t){var r=t[h];delete t[h],d(r),u(r)}));var P=function(t){var r=[];return t.forEach((function(t){var e=p(t);e&&(e[j]=t,t[h]=e,r.push(e))})),r}(w);!function(t){t.forEach((function(t){var r=t[h];r&&(r[j]=t,y(r,t))}))}([].concat(o(w),o(A))),P.forEach(a)}})); |
@@ -252,16 +252,18 @@ import indexBy from 'index-array-by'; | ||
update = _dataBindDiff.update, | ||
exit = _dataBindDiff.exit; | ||
exit = _dataBindDiff.exit; // Remove exiting points | ||
var newObjs = createObjs(enter); | ||
var pointsData = [].concat(_toConsumableArray(enter), _toConsumableArray(update)); | ||
updateObjs(pointsData); // Add new points | ||
newObjs.forEach(appendObj); // 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) { | ||
@@ -268,0 +270,0 @@ var newObjs = []; |
{ | ||
"name": "data-joint", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Perform data joins with any type of JS objects", | ||
@@ -5,0 +5,0 @@ "unpkg": "dist/data-joint.min.js", |
@@ -90,2 +90,11 @@ import indexBy from 'index-array-by'; | ||
// Remove exiting points | ||
exit.forEach(d => { | ||
const obj = d[objBindAttr]; | ||
delete(d[objBindAttr]); // unbind obj | ||
exitObj(obj); | ||
removeObj(obj); | ||
}); | ||
const newObjs = createObjs(enter); | ||
@@ -98,9 +107,2 @@ const pointsData = [...enter, ...update]; | ||
// Remove exiting points | ||
exit.forEach(d => { | ||
const obj = d[objBindAttr]; | ||
exitObj(obj); | ||
removeObj(obj); | ||
}); | ||
// | ||
@@ -107,0 +109,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69593
1021