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

protvista-utils

Package Overview
Dependencies
Maintainers
7
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protvista-utils - npm Package Compare versions

Comparing version 2.18.0 to 3.0.0-alpha.21

README.md

2

dist/protvista-utils.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ProtvistaUtils=e():t.ProtvistaUtils=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t.exports=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}},function(t,e,n){var i=n(4),r=n(5),o=n(6),l=n(8);t.exports=function(t,e){return i(t)||r(t,e)||o(t,e)||l()}},function(t,e,n){t.exports=n(9)},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],i=!0,r=!1,o=void 0;try{for(var l,h=t[Symbol.iterator]();!(i=(l=h.next()).done)&&(n.push(l.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==h.return||h.return()}finally{if(r)throw o}}return n}}},function(t,e,n){var i=n(7);t.exports=function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}},function(t,e){t.exports=function(){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(t,e,n){"use strict";n.r(e),n.d(e,"Region",(function(){return m})),n.d(e,"TrackHighlighter",(function(){return d})),n.d(e,"ColorScaleParser",(function(){return p})),n.d(e,"String2Object",(function(){return v})),n.d(e,"ScrollFilter",(function(){return b}));var i=n(2),r=n.n(i),o=n(0),l=n.n(o),h=n(1),a=n.n(h),s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.min,i=void 0===n?-1/0:n,r=e.max,o=void 0===r?1/0:r;l()(this,t),this.segments=[],this.max=o,this.min=i,this.regionString=null}return a()(t,[{key:"encode",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.segments.map((function(n){var i=n.start,r=n.end;if(e)return"".concat(i,":").concat(r);var o=i===t.min?"":i,l=r===t.max?"":r;return"".concat(o,":").concat(l)})).join(",")}},{key:"decode",value:function(t){var e=this;void 0!==t&&(this.regionString=t),this.regionString?this.segments=this.regionString.split(",").map((function(t){var n=t.split(":"),i=r()(n,3),o=i[0],l=i[1];if(void 0!==i[2])throw new Error("there should be at most 1 ':' per region. Region: ".concat(t));var h=o?Number(o):e.min,a=l?Number(l):e.max;if(h>a){var s=[a,h];h=s[0],a=s[1]}if(h<e.min&&(h=e.min),a>e.max&&(a=e.max),Number.isNaN(h))throw new Error("The parsed value of ".concat(o," is NaN. Region: ").concat(t));if(Number.isNaN(a))throw new Error("The parsed value of ".concat(l," is NaN. Region: ").concat(t));return{start:h,end:a}})):this.segments=[]}}]),t}(),u=function(t,e){return t?e?"".concat(t,",").concat(e):t:e},c=function(){function t(e){var n=e.element,i=e.min,r=e.max;l()(this,t),this.element=n,this.region=new s({min:i,max:r}),this.fixedHighlight=null}return a()(t,[{key:"setAttributesInElement",value:function(){this.region.decode(this.element.getAttribute("highlight")),0===this.region.segments.length&&(this.element._highlightstart=Number(this.element.getAttribute("highlightstart")),this.element._highlightend=Number(this.element.getAttribute("highlightend")),null!==this.element._highlightstart&&null!==this.element._highlightend&&"number"==typeof this.element._highlightstart&&"number"==typeof this.element._highlightend&&(this.element._highlight="".concat(this.element._highlightstart,":").concat(this.element._highlightend),this.region.decode(u(this.fixedHighlight,this.element._highlight))))}},{key:"setFloatAttribute",value:function(t,e){var n=parseFloat(e);this.element["_".concat(t)]=Number.isNaN(n)?e:n}},{key:"changedCallBack",value:function(t,e){switch(t){case"highlightstart":case"highlightend":this.setFloatAttribute(t,e),this.element._highlight=Number.isNaN(this.element._highlightstart)||Number.isNaN(this.element._highlightend)||void 0===this.element._highlightstart||void 0===this.element._highlightend||null===this.element._highlightstart||null===this.element._highlightend?"":"".concat(Math.max(this.region.min,this.element._highlightstart),":").concat(Math.min(this.region.max,this.element._highlightend));break;default:this.element._highlight=e}this.region.decode(u(this.fixedHighlight,this.element._highlight)),this.element.refresh()}},{key:"setFixedHighlight",value:function(t){this.fixedHighlight=t,this.region.decode(u(t,this.element._highlight)),this.element.refresh()}},{key:"appendHighlightTo",value:function(t){this.highlighted=t.append("g").attr("class","highlighted")}},{key:"updateHighlight",value:function(){var t=this,e=this.highlighted.selectAll("rect").data(this.region.segments);e.enter().append("rect").style("opacity",.5).attr("fill","rgba(255, 235, 59, 0.8)").style("pointer-events","none").merge(e).attr("height",this.element._height).attr("x",(function(e){return t.element.getXFromSeqPosition(e.start)})).attr("width",(function(e){return t.element.getSingleBaseWidth()*(e.end-e.start+1)})),e.exit().remove()}},{key:"max",set:function(t){this.region.max=t}}]),t}();function g(t){var e=document.createElement("div");return e.style.borderColor="",e.style.borderColor=t,""!==e.style.borderColor}var f=function(t){return t},m=s,d=c,p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=[],n=[];if(null!==t&&"string"!=typeof t)throw new Error("The attribute text has to be of type string");if(t&&""!==t.trim()){var i=t.split(",").map((function(t){return t.split(":")}));if(i.length<2)throw new Error("There should be at least 2 points to create a scale");e=i.map((function(t){var e=t[0].trim().toUpperCase();if(!g(e))throw new Error("The color '".concat(e," is not valid'"));return e})),n=i.map((function(t,e){var n=parseFloat(t[1]);if(Number.isNaN(n))throw new Error("The second part of every point should be a number. Error in point ".concat(e,": ").concat(t));return n}))}return{range:e,domain:n}},v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.keyFormatter,i=void 0===n?f:n,r=e.valueFormatter,o=void 0===r?f:r;if(null!==t&&"string"!=typeof t)throw new Error("The attribute text has to be of type string");if(t&&""!==t.trim()){var l=t.split(",").map((function(t){return t.split(":")})),h={};return l.forEach((function(t){if(2!==t.length)throw new Error("Bad block: ".concat(t.join(":"),"\n The blocks of the string should follow the format KEY:VALUE"));h[i(t[0])]=o(t[1])})),h}return{}},b=function(){function t(e){l()(this,t),this.element=e,this.timeStampWheelOutside=0,this.resetScrollableTimeout=null}return a()(t,[{key:"setElementScrollable",value:function(t){this.element.setAttribute("scrollable",t)}},{key:"startResetScrollableTimer",value:function(){var t=this;this.resetScrollableTimeout&&clearTimeout(this.resetScrollableTimeout),this.resetScrollableTimeout=setTimeout((function(){t.setElementScrollable(!0),t.resetScrollableTimeout=null}),400)}},{key:"blockScroll",value:function(t){this.timeStampWheelOutside=t,this.setElementScrollable(!1),this.startResetScrollableTimer()}},{key:"isWheelEventInsideElement",value:function(t,e){var n=this.element.getBoundingClientRect(),i=n.height,r=n.width,o=n.x,l=n.y;return t>o&&e<o+r&&e>l&&e<l+i}},{key:"wheel",value:function(t){var e=t.x,n=t.y,i=t.timeStamp;this.isWheelEventInsideElement(e,n)?i<this.timeStampWheelOutside+400?this.blockScroll(i):this.setElementScrollable(!0):this.blockScroll(i)}}]),t}()}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ProtvistaUtils=e():t.ProtvistaUtils=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){var r=n(14),i=n(15),o=n(5),l=n(16);t.exports=function(t){return r(t)||i(t)||o(t)||l()}},function(t,e,n){var r=n(17);function i(e,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,n){var i=r(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}},i(e,n,o||e)}t.exports=i},function(t,e,n){var r=n(6);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e,n){var r=n(11),i=n(12),o=n(5),l=n(13);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||l()}},function(t,e,n){var r=n(18);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(19),i=n(20);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e,n){t.exports=n(21)},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var l,u=t[Symbol.iterator]();!(r=(l=u.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){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(t,e,n){var r=n(6);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e){t.exports=function(){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(t,e,n){var r=n(2);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";n.r(e),n.d(e,"Region",(function(){return T})),n.d(e,"TrackHighlighter",(function(){return P})),n.d(e,"ColorScaleParser",(function(){return R})),n.d(e,"String2Object",(function(){return C})),n.d(e,"ScrollFilter",(function(){return I})),n.d(e,"withMargin",(function(){return F}));var r=n(7),i=n.n(r),o=n(0),l=n.n(o),u=n(1),a=n.n(u),c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.min,r=void 0===n?-1/0:n,i=e.max,o=void 0===i?1/0:i;l()(this,t),this.segments=[],this.max=o,this.min=r,this.regionString=null}return a()(t,[{key:"encode",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.segments.map((function(n){var r=n.start,i=n.end;if(e)return"".concat(r,":").concat(i);var o=r===t.min?"":r,l=i===t.max?"":i;return"".concat(o,":").concat(l)})).join(",")}},{key:"decode",value:function(t){var e=this;void 0!==t&&(this.regionString=t),this.regionString?this.segments=this.regionString.split(",").map((function(t){var n=t.split(":"),r=i()(n,3),o=r[0],l=r[1];if(void 0!==r[2])throw new Error("there should be at most 1 ':' per region. Region: ".concat(t));var u=o?Number(o):e.min,a=l?Number(l):e.max;if(u>a){var c=[a,u];u=c[0],a=c[1]}if(u<e.min&&(u=e.min),a>e.max&&(a=e.max),Number.isNaN(u))throw new Error("The parsed value of ".concat(o," is NaN. Region: ").concat(t));if(Number.isNaN(a))throw new Error("The parsed value of ".concat(l," is NaN. Region: ").concat(t));return{start:u,end:a}})):this.segments=[]}}]),t}(),s=function(t,e){return t?e?"".concat(t,",").concat(e):t:e},h=function(){function t(e){var n=e.element,r=e.min,i=e.max;l()(this,t),this.element=n,this.region=new c({min:r,max:i}),this.fixedHighlight=null}return a()(t,[{key:"setAttributesInElement",value:function(){this.region.decode(this.element.getAttribute("highlight")),0===this.region.segments.length&&(this.element._highlightstart=Number(this.element.getAttribute("highlightstart")),this.element._highlightend=Number(this.element.getAttribute("highlightend")),null!==this.element._highlightstart&&null!==this.element._highlightend&&"number"==typeof this.element._highlightstart&&"number"==typeof this.element._highlightend&&(this.element._highlight="".concat(this.element._highlightstart,":").concat(this.element._highlightend),this.region.decode(s(this.fixedHighlight,this.element._highlight))))}},{key:"setFloatAttribute",value:function(t,e){var n=parseFloat(e);this.element["_".concat(t)]=Number.isNaN(n)?e:n}},{key:"changedCallBack",value:function(t,e){switch(t){case"highlightstart":case"highlightend":this.setFloatAttribute(t,e),this.element._highlight=Number.isNaN(this.element._highlightstart)||Number.isNaN(this.element._highlightend)||void 0===this.element._highlightstart||void 0===this.element._highlightend||null===this.element._highlightstart||null===this.element._highlightend?"":"".concat(Math.max(this.region.min,this.element._highlightstart),":").concat(Math.min(this.region.max,this.element._highlightend));break;default:this.element._highlight=e}this.region.decode(s(this.fixedHighlight,this.element._highlight)),this.element.refresh()}},{key:"setFixedHighlight",value:function(t){this.fixedHighlight=t,this.region.decode(s(t,this.element._highlight)),this.element.refresh()}},{key:"appendHighlightTo",value:function(t){this.highlighted=t.append("g").attr("class","highlighted")}},{key:"updateHighlight",value:function(){var t=this,e=this.highlighted.selectAll("rect").data(this.region.segments);e.enter().append("rect").style("opacity",.5).attr("fill","rgba(255, 235, 59, 0.8)").style("pointer-events","none").merge(e).attr("height",this.element._height).attr("x",(function(e){return t.element.getXFromSeqPosition(e.start)})).attr("width",(function(e){return t.element.getSingleBaseWidth()*(e.end-e.start+1)})),e.exit().remove()}},{key:"max",set:function(t){this.region.max=t}}]),t}();function f(t){var e=document.createElement("div");return e.style.borderColor="",e.style.borderColor=t,""!==e.style.borderColor}var g=function(t){return t},m=function(){function t(e){l()(this,t),this.element=e,this.timeStampWheelOutside=0,this.resetScrollableTimeout=null}return a()(t,[{key:"setElementScrollable",value:function(t){this.element.setAttribute("scrollable",t)}},{key:"startResetScrollableTimer",value:function(){var t=this;this.resetScrollableTimeout&&clearTimeout(this.resetScrollableTimeout),this.resetScrollableTimeout=setTimeout((function(){t.setElementScrollable(!0),t.resetScrollableTimeout=null}),400)}},{key:"blockScroll",value:function(t){this.timeStampWheelOutside=t,this.setElementScrollable(!1),this.startResetScrollableTimer()}},{key:"isWheelEventInsideElement",value:function(t,e){var n=this.element.getBoundingClientRect(),r=n.height,i=n.width,o=n.x,l=n.y;return t>o&&e<o+i&&e>l&&e<l+r}},{key:"wheel",value:function(t){var e=t.x,n=t.y,r=t.timeStamp;this.isWheelEventInsideElement(e,n)?r<this.timeStampWheelOutside+400?this.blockScroll(r):this.setElementScrollable(!0):this.blockScroll(r)}}]),t}(),p=n(3),d=n.n(p),y=n(4),b=n.n(y),v=n(8),x=n.n(v),S=n(9),w=n.n(S),_=n(2),j=n.n(_);function O(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return l=t.done,t},e:function(t){u=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(u)throw o}}}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=j()(t);if(e){var i=j()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w()(this,n)}}var A=["left","right","top","bottom"],N=A.map((function(t){return"margin".concat(t)})),T=c,P=h,R=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=[],n=[];if(null!==t&&"string"!=typeof t)throw new Error("The attribute text has to be of type string");if(t&&""!==t.trim()){var r=t.split(",").map((function(t){return t.split(":")}));if(r.length<2)throw new Error("There should be at least 2 points to create a scale");e=r.map((function(t){var e=t[0].trim().toUpperCase();if(!f(e))throw new Error("The color '".concat(e," is not valid'"));return e})),n=r.map((function(t,e){var n=parseFloat(t[1]);if(Number.isNaN(n))throw new Error("The second part of every point should be a number. Error in point ".concat(e,": ").concat(t));return n}))}return{range:e,domain:n}},C=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.keyFormatter,r=void 0===n?g:n,i=e.valueFormatter,o=void 0===i?g:i;if(null!==t&&"string"!=typeof t)throw new Error("The attribute text has to be of type string");if(t&&""!==t.trim()){var l=t.split(",").map((function(t){return t.split(":")})),u={};return l.forEach((function(t){if(2!==t.length)throw new Error("Bad block: ".concat(t.join(":"),"\n The blocks of the string should follow the format KEY:VALUE"));u[r(t[0])]=o(t[1])})),u}return{}},I=m,F=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{initialValue:{top:0,bottom:0,left:0,right:0}},r=function(t){x()(r,t);var e=k(r);function r(){var t;return l()(this,r),(t=e.call(this)).margin=n.initialValue,t}return a()(r,[{key:"attributeChangedCallback",value:function(t,e,n){e!==n&&N.includes(t)&&(this[t]=n),b()(j()(r.prototype),"attributeChangedCallback",this).call(this,t,e,n)}}],[{key:"observedAttributes",get:function(){return[].concat(d()(b()(j()(r),"observedAttributes",this)),d()(N))}}]),r}(t),i=O(A);try{var o=function(){var t=e.value;Object.defineProperty(r.prototype,"margin".concat(t),{get:function(){return this.margin[t]||0},set:function(e){this.margin[t]=+e}})};for(i.s();!(e=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}return r}}])}));
//# sourceMappingURL=protvista-utils.js.map
{
"name": "protvista-utils",
"version": "2.18.0",
"version": "3.0.0-alpha.21+d78f7ad",
"description": "Collection of utilities for ProtVista components",

@@ -29,3 +29,3 @@ "files": [

"license": "ISC",
"gitHead": "fcd6fd067f52f6033704f4efe01d989e948b357a"
"gitHead": "d78f7adb2f125a6716a35765ab177d3a7023b480"
}

@@ -6,2 +6,3 @@ import _Region from "./Region";

import _sf from "./ScrollFilter";
import _withMargin from "./withMargin";

@@ -13,1 +14,2 @@ export const Region = _Region;

export const ScrollFilter = _sf;
export const withMargin = _withMargin;

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