You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
200 KiB

2 weeks ago
"use strict";var t=require("obsidian");function e(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function n(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function r(t){let r,a,l;function o(t,e,n=0,i=t.length){if(n<i){if(0!==r(e,e))return i;do{const r=n+i>>>1;a(t[r],e)<0?n=r+1:i=r}while(n<i)}return n}return 2!==t.length?(r=e,a=(n,r)=>e(t(n),r),l=(e,n)=>t(e)-n):(r=t===e||t===n?t:i,a=t,l=t),{left:o,center:function(t,e,n=0,r=t.length){const i=o(t,e,n,r-1);return i>n&&l(t[i-1],e)>-l(t[i],e)?i-1:i},right:function(t,e,n=0,i=t.length){if(n<i){if(0!==r(e,e))return i;do{const r=n+i>>>1;a(t[r],e)<=0?n=r+1:i=r}while(n<i)}return n}}}function i(){return 0}const a=r(e).right;r((function(t){return null===t?NaN:+t})).center;class l extends Map{constructor(t,e=s){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(o(this,t))}has(t){return super.has(o(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function o({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function s(t){return null!==t&&"object"==typeof t?t.valueOf():t}function u(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}const c=Math.sqrt(50),f=Math.sqrt(10),h=Math.sqrt(2);function d(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=c?10:a>=f?5:a>=h?2:1;let o,s,u;return i<0?(u=Math.pow(10,-i)/l,o=Math.round(t*u),s=Math.round(e*u),o/u<t&&++o,s/u>e&&--s,u=-u):(u=Math.pow(10,i)*l,o=Math.round(t/u),s=Math.round(e/u),o*u<t&&++o,s*u>e&&--s),s<o&&.5<=n&&n<2?d(t,e,2*n):[o,s,u]}function g(t,e,n){return d(t=+t,e=+e,n=+n)[2]}function p(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?g(e,t,n):g(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function y(t,e){let n;for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);return n}function m(t,e){let n;for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);return n}function v(t,n,r=0,i=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),i=Math.floor(Math.min(t.length-1,i)),!(r<=n&&n<=i))return t;for(a=void 0===a?u:function(t=e){if(t===e)return u;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}(a);i>r;){if(i-r>600){const e=i-r+1,l=n-r+1,o=Math.log(e),s=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*s*(e-s)/e)*(l-e/2<0?-1:1);v(t,n,Math.max(r,Math.floor(n-l*s/e+u)),Math.min(i,Math.floor(n+(e-l)*s/e+u)),a)}const e=t[n];let l=r,o=i;for(x(t,r,n),a(t[i],e)>0&&x(t,r,i);l<o;){for(x(t,l,o),++l,--o;a(t[l],e)<0;)++l;for(;a(t[o],e)>0;)--o}0===a(t[r],e)?x(t,r,o):(++o,x(t,o,i)),o<=n&&(r=o+1),n<=o&&(i=o-1)}return t}function x(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function A(t,e){return function(t,e){if((n=(t=Float64Array.from(function*(t){for(let e of t)null!=e&&(e=+e)>=e&&(yield e)}(t))).length)&&!isNaN(e=+e)){if(e<=0||n<2)return m(t);if(e>=1)return y(t);var n,r=(n-1)*e,i=Math.floor(r),a=y(v(t,i).subarray(0,i+1));return a+(m(t.subarray(i+1))-a)*(r-i)}}(t,.5)}function w(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function b(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function D(t){return t}var k=1e-6;function C(t){return"translate("+t+",0)"}function M(t){return"translate(0,"+t+")"}function T(t){return e=>+t(e)}function _(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function E(){return!this.__axis}function F(t,e){var n=[],r=null,i=null,a=6,l=6,o=3,s="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,u=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",f=1===t||3===t?C:M;function h(h){var d=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,g=null==i?e.tickFormat?e.tickFormat.apply(e,n):D:i,p
/* nosourcemap */