Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/adjust

Package Overview
Dependencies
Maintainers
5
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/adjust - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

8

build/adjust.js

@@ -483,4 +483,10 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
};
var isObject = function isObject(value) {

@@ -487,0 +493,0 @@ /**

2

dist/adjust.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.adjust=e():t.adjust=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e,n){var r=n(12),o=n(1);t.exports=function(t,e){if(t)if(o(t))for(var n=0,i=t.length;n<i&&!1!==e(t[n],n);n++);else if(r(t))for(var u in t)if(t.hasOwnProperty(u)&&!1===e(t[u],u))break}},function(t,e,n){var r=n(6),o=Array.isArray?Array.isArray:function(t){return r(t,"Array")};t.exports=o},function(t,e,n){var r=n(4),o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._initDefaultCfg(),r(this,e)}return t.prototype._initDefaultCfg=function(){this.adjustNames=["x","y"]},t.prototype.processAdjust=function(){},t}();t.exports=o},function(t,e,n){var r=n(0),o=n(7),i=n(1);t.exports=function(t,e){for(var n=[],u={},s=0;s<t.length;s++){var a=t[s][e];o(a)||(i(a)||(a=[a]),r(a,function(t){u[t]||(n.push(t),u[t]=!0)}))}return n}},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}t.exports=function(t,e,r,o){return e&&n(t,e),r&&n(t,r),o&&n(t,o),t}},function(t,e){t.exports=function(t){for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e}},function(t,e){var n={}.toString;t.exports=function(t,e){return n.call(t)==="[object "+e+"]"}},function(t,e){t.exports=function(t){return null===t||void 0===t}},function(t,e,n){var r=n(0),o={values:n(3)};t.exports={isAdjust:function(t){return this.adjustNames.indexOf(t)>=0},_getDimValues:function(t){var e={},n=[];if(this.xField&&this.isAdjust("x")&&n.push(this.xField),this.yField&&this.isAdjust("y")&&n.push(this.yField),r(n,function(n){var r=o.values(t,n);r.sort(function(t,e){return t-e}),e[n]=r}),!this.yField&&this.isAdjust("y")){var i=[0,1];e.y=i}return e},adjustData:function(t,e){var n=this,o=n._getDimValues(e);r(t,function(e,i){r(o,function(r,o){n.adjustDim(o,r,e,t.length,i)})})},getAdjustRange:function(t,e,n){var r=n.indexOf(e),o=n.length,i=void 0,u=void 0;return!this.yField&&this.isAdjust("y")?(i=0,u=1):o>1?(i=0===r?n[0]:n[r-1],u=r===o-1?n[o-1]:n[r+1],0!==r?i+=(e-i)/2:i-=(u-e)/2,r!==o-1?u-=(u-e)/2:u+=(e-n[o-2])/2):(i=0===e?0:e-.5,u=0===e?1:e+.5),{pre:i,next:u}},groupData:function(t,e){var n={};return r(t,function(t){var r=t[e];void 0===r&&(r=t[e]=0),n[r]||(n[r]=[]),n[r].push(t)}),n}}},function(t,e,n){var r=n(6);t.exports=function(t){return r(t,"Function")}},function(t,e,n){var r=n(4),o=n(2),i=n(11),u=n(13),s=n(8),a=n(14),f=n(18);r(o.prototype,s),r(i.prototype,s,a),r(u.prototype,f),o.Jitter=n(19),o.Symmetric=n(20),o.Dodge=i,o.Stack=u,t.exports=o},function(t,e,n){var r=n(2),o=n(0),i=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.marginRatio=.5,this.dodgeRatio=.5,this.adjustNames=["x","y"]},e.prototype.getDodgeOffset=function(t,e,n){var r=t.pre,o=t.next,i=o-r,u=i*this.dodgeRatio/n,s=this.marginRatio*u;return(r+o)/2+(.5*(i-n*u-(n-1)*s)+((e+1)*u+e*s)-.5*u-.5*i)},e.prototype.processAdjust=function(t){var e=this,n=t.length,r=e.xField;o(t,function(t,o){for(var i=0,u=t.length;i<u;i++){var s=t[i],a=s[r],f={pre:a-.5,next:a+.5},c=e.getDodgeOffset(f,o,n);s[r]=c}})},e}(r);r.Dodge=i,t.exports=i},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){var e=void 0===t?"undefined":n(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){var r=n(1),o=n(7),i=n(2),u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.xField=null,this.yField=null},e.prototype.processAdjust=function(t){this.processStack(t)},e.prototype.processStack=function(t){var e=this.xField,n=this.yField,i=t.length,u={positive:{},negative:{}};this.reverseOrder&&(t=t.slice(0).reverse());for(var s=0;s<i;s++)for(var a=t[s],f=0,c=a.length;f<c;f++){var p=a[f],l=p[e]||0,h=p[n],y=l.toString();if(h=r(h)?h[1]:h,!o(h)){var d=h>=0?"positive":"negative";u[d][y]||(u[d][y]=0),p[n]=[u[d][y],h+u[d][y]],u[d][y]+=h}}},e}(i);i.Stack=u,t.exports=u},function(t,e,n){var r={merge:n(5),values:n(3)},o=n(15),i=n(0);t.exports={processAdjust:function(t){var e=r.merge(t),n=this.dodgeBy,i=t;n&&(i=o(e,n)),this.cacheMap={},this.adjDataArray=i,this.mergeData=e,this.adjustData(i,e),this.adjDataArray=null,this.mergeData=null},getDistribution:function(t){var e=this.adjDataArray,n=this.cacheMap,o=n[t];return o||(o={},i(e,function(e,n){var u=r.values(e,t);u.length||u.push(0),i(u,function(t){o[t]||(o[t]=[]),o[t].push(n)})}),n[t]=o),o},adjustDim:function(t,e,n,r,o){var u=this,s=u.getDistribution(t),a=u.groupData(n,t);i(a,function(n,r){r=parseFloat(r);var a=void 0;a=1===e.length?{pre:e[0]-1,next:e[0]+1}:u.getAdjustRange(t,r,e),i(n,function(e){var n=e[t],r=s[n],i=r.indexOf(o);e[t]=u.getDodgeOffset(a,i,r.length)})})}}},function(t,e,n){var r=n(16);t.exports=function(t,e){if(!e)return[t];var n=r(t,e),o=[];for(var i in n)o.push(n[i]);return o}},function(t,e,n){var r=n(9),o=n(1),i=n(17);t.exports=function(t,e){if(!e)return{0:t};if(!r(e)){var n=o(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,o=n.length;r<o;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return i(t,e)}},function(t,e,n){var r=n(0),o=n(1),i=Object.prototype.hasOwnProperty;t.exports=function(t,e){if(!e||!o(t))return t;var n={},u=null;return r(t,function(t){u=e(t),i.call(n,u)?n[u].push(t):n[u]=[t]}),n}},function(t,e){t.exports={_initDefaultCfg:function(){this.xField=null,this.yField=null,this.height=null,this.size=10,this.reverseOrder=!1,this.adjustNames=["y"]},processOneDimStack:function(t){var e=this.xField,n=this.yField||"y",r=this.height,o={};this.reverseOrder&&(t=t.slice(0).reverse());for(var i=0,u=t.length;i<u;i++)for(var s=t[i],a=0,f=s.length;a<f;a++){var c=s[a],p=2*(c.size||this.size)/r,l=c[e];o[l]||(o[l]=p/2),c[n]=o[l],o[l]+=p}},processAdjust:function(t){this.yField?this.processStack(t):this.processOneDimStack(t)}}},function(t,e,n){var r=n(0),o=n(4),i={merge:n(5),values:n(3)},u=n(2),s=n(8),a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.xField=null,this.yField=null,this.adjustNames=["x","y"],this.groupFields=null},e.prototype.processAdjust=function(t){var e=i.merge(t);this.adjDataArray=t,this.mergeData=e,this.adjustData(t,e),this.adjFrames=null,this.mergeData=null},e.prototype.getAdjustOffset=function(t,e){var n=e-t;return t+.05*n+.9*n*Math.random()},e.prototype._adjustGroup=function(t,e,n,o){var i=this,u=i.getAdjustRange(e,n,o);r(t,function(t){t[e]=i.getAdjustOffset(u.pre,u.next)})},e.prototype.adjustDim=function(t,e,n){var o=this,i=o.groupData(n,t);r(i,function(n,r){r=parseFloat(r),o._adjustGroup(n,t,r,e)})},e}(u);o(a.prototype,s),u.Jitter=a,t.exports=a},function(t,e,n){var r=n(0),o=n(21),i=n(1),u={merge:n(5),values:n(3)},s=n(2),a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},e.prototype._getMax=function(t){var e=this.mergeData,n=o(e,function(e){var n=e[t];return i(n)?Math.max.apply(null,n):n})[t];return i(n)?Math.max.apply(null,n):n},e.prototype._getXValuesMax=function(){var t=this.yField,e=this.xField,n={},o=this.mergeData;return r(o,function(r){var o=r[e],u=r[t],s=i(u)?Math.max.apply(null,u):u;n[o]=n[o]||0,n[o]<s&&(n[o]=s)}),n},e.prototype.processAdjust=function(t){var e=u.merge(t);this.mergeData=e,this._processSymmetric(t),this.mergeData=null},e.prototype._processSymmetric=function(t){var e=this.xField,n=this.yField,o=this._getMax(n),u=t[0][0],s=void 0;u&&i(u[n])&&(s=this._getXValuesMax()),r(t,function(t){r(t,function(t){var u=t[n],a=void 0;if(i(u)){var f=t[e],c=s[f];a=(o-c)/2;var p=[];r(u,function(t){p.push(a+t)}),t[n]=p}else a=(o-u)/2,t[n]=[a,u+a]})})},e}(s);s.Symmetric=a,t.exports=a},function(t,e,n){var r=n(1),o=n(9),i=n(0);t.exports=function(t,e){if(r(t)){var n=t[0],u=void 0;u=o(e)?e(t[0]):t[0][e];var s=void 0;return i(t,function(t){(s=o(e)?e(t):t[e])>u&&(n=t,u=s)}),n}}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.adjust=e():t.adjust=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e,n){var r=n(12),o=n(1);t.exports=function(t,e){if(t)if(o(t))for(var n=0,i=t.length;n<i&&!1!==e(t[n],n);n++);else if(r(t))for(var u in t)if(t.hasOwnProperty(u)&&!1===e(t[u],u))break}},function(t,e,n){var r=n(6),o=Array.isArray?Array.isArray:function(t){return r(t,"Array")};t.exports=o},function(t,e,n){var r=n(4),o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._initDefaultCfg(),r(this,e)}return t.prototype._initDefaultCfg=function(){this.adjustNames=["x","y"]},t.prototype.processAdjust=function(){},t}();t.exports=o},function(t,e,n){var r=n(0),o=n(7),i=n(1);t.exports=function(t,e){for(var n=[],u={},s=0;s<t.length;s++){var a=t[s][e];o(a)||(i(a)||(a=[a]),r(a,function(t){u[t]||(n.push(t),u[t]=!0)}))}return n}},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}t.exports=function(t,e,r,o){return e&&n(t,e),r&&n(t,r),o&&n(t,o),t}},function(t,e){t.exports=function(t){for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e}},function(t,e){var n={}.toString;t.exports=function(t,e){return n.call(t)==="[object "+e+"]"}},function(t,e){t.exports=function(t){return null===t||void 0===t}},function(t,e,n){var r=n(0),o={values:n(3)};t.exports={isAdjust:function(t){return this.adjustNames.indexOf(t)>=0},_getDimValues:function(t){var e={},n=[];if(this.xField&&this.isAdjust("x")&&n.push(this.xField),this.yField&&this.isAdjust("y")&&n.push(this.yField),r(n,function(n){var r=o.values(t,n);r.sort(function(t,e){return t-e}),e[n]=r}),!this.yField&&this.isAdjust("y")){var i=[0,1];e.y=i}return e},adjustData:function(t,e){var n=this,o=n._getDimValues(e);r(t,function(e,i){r(o,function(r,o){n.adjustDim(o,r,e,t.length,i)})})},getAdjustRange:function(t,e,n){var r=n.indexOf(e),o=n.length,i=void 0,u=void 0;return!this.yField&&this.isAdjust("y")?(i=0,u=1):o>1?(i=0===r?n[0]:n[r-1],u=r===o-1?n[o-1]:n[r+1],0!==r?i+=(e-i)/2:i-=(u-e)/2,r!==o-1?u-=(u-e)/2:u+=(e-n[o-2])/2):(i=0===e?0:e-.5,u=0===e?1:e+.5),{pre:i,next:u}},groupData:function(t,e){var n={};return r(t,function(t){var r=t[e];void 0===r&&(r=t[e]=0),n[r]||(n[r]=[]),n[r].push(t)}),n}}},function(t,e,n){var r=n(6);t.exports=function(t){return r(t,"Function")}},function(t,e,n){var r=n(4),o=n(2),i=n(11),u=n(13),s=n(8),a=n(14),f=n(18);r(o.prototype,s),r(i.prototype,s,a),r(u.prototype,f),o.Jitter=n(19),o.Symmetric=n(20),o.Dodge=i,o.Stack=u,t.exports=o},function(t,e,n){var r=n(2),o=n(0),i=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.marginRatio=.5,this.dodgeRatio=.5,this.adjustNames=["x","y"]},e.prototype.getDodgeOffset=function(t,e,n){var r=t.pre,o=t.next,i=o-r,u=i*this.dodgeRatio/n,s=this.marginRatio*u;return(r+o)/2+(.5*(i-n*u-(n-1)*s)+((e+1)*u+e*s)-.5*u-.5*i)},e.prototype.processAdjust=function(t){var e=this,n=t.length,r=e.xField;o(t,function(t,o){for(var i=0,u=t.length;i<u;i++){var s=t[i],a=s[r],f={pre:a-.5,next:a+.5},c=e.getDodgeOffset(f,o,n);s[r]=c}})},e}(r);r.Dodge=i,t.exports=i},function(t,e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return void 0===t?"undefined":n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":n(t)};t.exports=function(t){var e=void 0===t?"undefined":r(t);return null!==t&&"object"===e||"function"===e}},function(t,e,n){var r=n(1),o=n(7),i=n(2),u=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.xField=null,this.yField=null},e.prototype.processAdjust=function(t){this.processStack(t)},e.prototype.processStack=function(t){var e=this.xField,n=this.yField,i=t.length,u={positive:{},negative:{}};this.reverseOrder&&(t=t.slice(0).reverse());for(var s=0;s<i;s++)for(var a=t[s],f=0,c=a.length;f<c;f++){var p=a[f],l=p[e]||0,h=p[n],y=l.toString();if(h=r(h)?h[1]:h,!o(h)){var d=h>=0?"positive":"negative";u[d][y]||(u[d][y]=0),p[n]=[u[d][y],h+u[d][y]],u[d][y]+=h}}},e}(i);i.Stack=u,t.exports=u},function(t,e,n){var r={merge:n(5),values:n(3)},o=n(15),i=n(0);t.exports={processAdjust:function(t){var e=r.merge(t),n=this.dodgeBy,i=t;n&&(i=o(e,n)),this.cacheMap={},this.adjDataArray=i,this.mergeData=e,this.adjustData(i,e),this.adjDataArray=null,this.mergeData=null},getDistribution:function(t){var e=this.adjDataArray,n=this.cacheMap,o=n[t];return o||(o={},i(e,function(e,n){var u=r.values(e,t);u.length||u.push(0),i(u,function(t){o[t]||(o[t]=[]),o[t].push(n)})}),n[t]=o),o},adjustDim:function(t,e,n,r,o){var u=this,s=u.getDistribution(t),a=u.groupData(n,t);i(a,function(n,r){r=parseFloat(r);var a=void 0;a=1===e.length?{pre:e[0]-1,next:e[0]+1}:u.getAdjustRange(t,r,e),i(n,function(e){var n=e[t],r=s[n],i=r.indexOf(o);e[t]=u.getDodgeOffset(a,i,r.length)})})}}},function(t,e,n){var r=n(16);t.exports=function(t,e){if(!e)return[t];var n=r(t,e),o=[];for(var i in n)o.push(n[i]);return o}},function(t,e,n){var r=n(9),o=n(1),i=n(17);t.exports=function(t,e){if(!e)return{0:t};if(!r(e)){var n=o(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,o=n.length;r<o;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return i(t,e)}},function(t,e,n){var r=n(0),o=n(1),i=Object.prototype.hasOwnProperty;t.exports=function(t,e){if(!e||!o(t))return t;var n={},u=null;return r(t,function(t){u=e(t),i.call(n,u)?n[u].push(t):n[u]=[t]}),n}},function(t,e){t.exports={_initDefaultCfg:function(){this.xField=null,this.yField=null,this.height=null,this.size=10,this.reverseOrder=!1,this.adjustNames=["y"]},processOneDimStack:function(t){var e=this.xField,n=this.yField||"y",r=this.height,o={};this.reverseOrder&&(t=t.slice(0).reverse());for(var i=0,u=t.length;i<u;i++)for(var s=t[i],a=0,f=s.length;a<f;a++){var c=s[a],p=2*(c.size||this.size)/r,l=c[e];o[l]||(o[l]=p/2),c[n]=o[l],o[l]+=p}},processAdjust:function(t){this.yField?this.processStack(t):this.processOneDimStack(t)}}},function(t,e,n){var r=n(0),o=n(4),i={merge:n(5),values:n(3)},u=n(2),s=n(8),a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.xField=null,this.yField=null,this.adjustNames=["x","y"],this.groupFields=null},e.prototype.processAdjust=function(t){var e=i.merge(t);this.adjDataArray=t,this.mergeData=e,this.adjustData(t,e),this.adjFrames=null,this.mergeData=null},e.prototype.getAdjustOffset=function(t,e){var n=e-t;return t+.05*n+.9*n*Math.random()},e.prototype._adjustGroup=function(t,e,n,o){var i=this,u=i.getAdjustRange(e,n,o);r(t,function(t){t[e]=i.getAdjustOffset(u.pre,u.next)})},e.prototype.adjustDim=function(t,e,n){var o=this,i=o.groupData(n,t);r(i,function(n,r){r=parseFloat(r),o._adjustGroup(n,t,r,e)})},e}(u);o(a.prototype,s),u.Jitter=a,t.exports=a},function(t,e,n){var r=n(0),o=n(21),i=n(1),u={merge:n(5),values:n(3)},s=n(2),a=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype._initDefaultCfg=function(){this.xField=null,this.yField=null,this.cacheMax=null,this.adjustNames=["y"],this.groupFields=null},e.prototype._getMax=function(t){var e=this.mergeData,n=o(e,function(e){var n=e[t];return i(n)?Math.max.apply(null,n):n})[t];return i(n)?Math.max.apply(null,n):n},e.prototype._getXValuesMax=function(){var t=this.yField,e=this.xField,n={},o=this.mergeData;return r(o,function(r){var o=r[e],u=r[t],s=i(u)?Math.max.apply(null,u):u;n[o]=n[o]||0,n[o]<s&&(n[o]=s)}),n},e.prototype.processAdjust=function(t){var e=u.merge(t);this.mergeData=e,this._processSymmetric(t),this.mergeData=null},e.prototype._processSymmetric=function(t){var e=this.xField,n=this.yField,o=this._getMax(n),u=t[0][0],s=void 0;u&&i(u[n])&&(s=this._getXValuesMax()),r(t,function(t){r(t,function(t){var u=t[n],a=void 0;if(i(u)){var f=t[e],c=s[f];a=(o-c)/2;var p=[];r(u,function(t){p.push(a+t)}),t[n]=p}else a=(o-u)/2,t[n]=[a,u+a]})})},e}(s);s.Symmetric=a,t.exports=a},function(t,e,n){var r=n(1),o=n(9),i=n(0);t.exports=function(t,e){if(r(t)){var n=t[0],u=void 0;u=o(e)?e(t[0]):t[0][e];var s=void 0;return i(t,function(t){(s=o(e)?e(t):t[e])>u&&(n=t,u=s)}),n}}}])});
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var mix = require('@antv/util/src/mix');
var mix = require('@antv/util/lib/mix');

@@ -5,0 +5,0 @@ var Adjust = function () {

@@ -8,3 +8,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Adjust = require('./base');
var each = require('@antv/util/src/each');
var each = require('@antv/util/lib/each');

@@ -11,0 +11,0 @@ var MARGIN_RATIO = 1 / 2;

// 完整版下使用支持按照某个字段进行分组的 dodge
var mix = require('@antv/util/src/mix');
var mix = require('@antv/util/lib/mix');
var Adjust = require('./base');

@@ -4,0 +4,0 @@ var Dodge = require('./dodge');

@@ -7,7 +7,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var each = require('@antv/util/src/each');
var mix = require('@antv/util/src/mix');
var each = require('@antv/util/lib/each');
var mix = require('@antv/util/lib/mix');
var ArrayUtil = {
merge: require('@antv/util/src/array/merge'),
values: require('@antv/util/src/array/values')
merge: require('@antv/util/lib/array/merge'),
values: require('@antv/util/lib/array/values')
};

@@ -14,0 +14,0 @@

var DEFAULT_Y = 0; // 默认的y的值
var each = require('@antv/util/src/each');
var each = require('@antv/util/lib/each');
var ArrayUtil = {
values: require('@antv/util/src/array/values')
values: require('@antv/util/lib/array/values')
};

@@ -6,0 +6,0 @@ module.exports = {

var ArrayUtil = {
merge: require('@antv/util/src/array/merge'),
values: require('@antv/util/src/array/values')
merge: require('@antv/util/lib/array/merge'),
values: require('@antv/util/lib/array/values')
};
var group = require('@antv/util/src/group');
var each = require('@antv/util/src/each');
var group = require('@antv/util/lib/group');
var each = require('@antv/util/lib/each');

@@ -9,0 +9,0 @@ module.exports = {

@@ -7,4 +7,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var isArray = require('@antv/util/src/type/isArray');
var isNil = require('@antv/util/src/type/isNil');
var isArray = require('@antv/util/lib/type/isArray');
var isNil = require('@antv/util/lib/type/isNil');
var Adjust = require('./base');

@@ -11,0 +11,0 @@

@@ -7,8 +7,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var each = require('@antv/util/src/each');
var maxBy = require('@antv/util/src/math/maxBy');
var isArray = require('@antv/util/src/type/isArray');
var each = require('@antv/util/lib/each');
var maxBy = require('@antv/util/lib/math/maxBy');
var isArray = require('@antv/util/lib/type/isArray');
var ArrayUtil = {
merge: require('@antv/util/src/array/merge'),
values: require('@antv/util/src/array/values')
merge: require('@antv/util/lib/array/merge'),
values: require('@antv/util/lib/array/values')
};

@@ -15,0 +15,0 @@ var Adjust = require('./base');

{
"name": "@antv/adjust",
"version": "0.0.4",
"version": "0.0.5",
"description": "Data Adjust module for G2, F2.",

@@ -5,0 +5,0 @@ "browser": "build/adjust.js",

@@ -1,2 +0,2 @@

const mix = require('@antv/util/src/mix');
const mix = require('@antv/util/lib/mix');

@@ -3,0 +3,0 @@ class Adjust {

const Adjust = require('./base');
const each = require('@antv/util/src/each');
const each = require('@antv/util/lib/each');

@@ -4,0 +4,0 @@ const MARGIN_RATIO = 1 / 2;

// 完整版下使用支持按照某个字段进行分组的 dodge
const mix = require('@antv/util/src/mix');
const mix = require('@antv/util/lib/mix');
const Adjust = require('./base');

@@ -4,0 +4,0 @@ const Dodge = require('./dodge');

@@ -1,6 +0,6 @@

const each = require('@antv/util/src/each');
const mix = require('@antv/util/src/mix');
const each = require('@antv/util/lib/each');
const mix = require('@antv/util/lib/mix');
const ArrayUtil = {
merge: require('@antv/util/src/array/merge'),
values: require('@antv/util/src/array/values')
merge: require('@antv/util/lib/array/merge'),
values: require('@antv/util/lib/array/values')
};

@@ -7,0 +7,0 @@

const DEFAULT_Y = 0; // 默认的y的值
const each = require('@antv/util/src/each');
const each = require('@antv/util/lib/each');
const ArrayUtil = {
values: require('@antv/util/src/array/values')
values: require('@antv/util/lib/array/values')
};

@@ -6,0 +6,0 @@ module.exports = {

const ArrayUtil = {
merge: require('@antv/util/src/array/merge'),
values: require('@antv/util/src/array/values')
merge: require('@antv/util/lib/array/merge'),
values: require('@antv/util/lib/array/values')
};
const group = require('@antv/util/src/group');
const each = require('@antv/util/src/each');
const group = require('@antv/util/lib/group');
const each = require('@antv/util/lib/each');

@@ -9,0 +9,0 @@ module.exports = {

@@ -1,3 +0,3 @@

const isArray = require('@antv/util/src/type/isArray');
const isNil = require('@antv/util/src/type/isNil');
const isArray = require('@antv/util/lib/type/isArray');
const isNil = require('@antv/util/lib/type/isNil');
const Adjust = require('./base');

@@ -4,0 +4,0 @@

@@ -1,7 +0,7 @@

const each = require('@antv/util/src/each');
const maxBy = require('@antv/util/src/math/maxBy');
const isArray = require('@antv/util/src/type/isArray');
const each = require('@antv/util/lib/each');
const maxBy = require('@antv/util/lib/math/maxBy');
const isArray = require('@antv/util/lib/type/isArray');
const ArrayUtil = {
merge: require('@antv/util/src/array/merge'),
values: require('@antv/util/src/array/values')
merge: require('@antv/util/lib/array/merge'),
values: require('@antv/util/lib/array/values')
};

@@ -8,0 +8,0 @@ const Adjust = require('./base');

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc