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
77 KiB

5 years ago
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("lodash"),require("d3"),require("heap"),require("d3kit"),require("webcola/WebCola/cola.js")):"function"==typeof define&&define.amd?define(["lodash","d3","heap","d3kit","webcola/WebCola/cola.js"],n):"object"==typeof exports?exports.SentenTree=n(require("lodash"),require("d3"),require("heap"),require("d3kit"),require("webcola/WebCola/cola.js")):t.SentenTree=n(t._,t.d3,t.Heap,t.d3Kit,t.cola)}(this,function(t,n,e,r,i){return function(t){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}var e={};return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get: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,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=137)}([function(t,n,e){"use strict";function r(t,n){this._groups=t,this._parents=n}function i(){return new r([[document.documentElement]],C)}var u=e(104),o=e(105),a=e(93),s=e(87),c=e(37),l=e(92),f=e(97),h=e(100),d=e(107),p=e(85),v=e(99),g=e(98),y=e(106),m=e(91),w=e(90),b=e(84),_=e(108),k=e(101),x=e(86),M=e(109),L=e(94),E=e(102),O=e(96),S=e(83),P=e(95),A=e(103),N=e(88),j=e(18),q=e(89);e.d(n,"c",function(){return C}),n.b=r;var C=[null];r.prototype=i.prototype={constructor:r,select:u.a,selectAll:o.a,filter:a.a,data:s.a,enter:c.a,exit:l.a,merge:f.a,order:h.a,sort:d.a,call:p.a,nodes:v.a,node:g.a,size:y.a,empty:m.a,each:w.a,attr:b.a,style:_.a,property:k.a,classed:x.a,text:M.a,html:L.a,raise:E.a,lower:O.a,append:S.a,insert:P.a,remove:A.a,datum:N.a,on:j.b,dispatch:q.a},n.a=i},function(t,n,e){"use strict";function r(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>f)throw new Error("too late");return e}function i(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>d)throw new Error("too late");return e}function u(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function o(t,n,r){function i(t){r.state=h,r.timer.restart(u,r.delay,r.time),r.delay<=t&&u(t-r.delay)}function u(i){var f,g,m,w;if(r.state!==h)return a();for(f in l)if(w=l[f],w.name===r.name){if(w.state===p)return e.i(s.b)(u);w.state===v?(w.state=y,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete l[f]):n>+f&&(w.state=y,w.timer.stop(),delete l[f])}if(e.i(s.b)(function(){r.state===p&&(r.state=v,r.timer.restart(o,r.delay,r.time),o(i))}),r.state=d,r.on.call("start",t,t.__data__,r.index,r.group),r.state===d){for(r.state=p,c=new Array(m=r.tween.length),f=0,g=-1;m>f;++f)(w=r.tween[f].value.call(t,t.__data__,r.index,r.group))&&(c[++g]=w);c.length=g+1}}function o(n){for(var e=n<r.duration?r.ease.call(null,n/r.duration):(r.timer.restart(a),r.state=g,1),i=-1,u=c.length;++i<u;)c[i].call(null,e);r.state===g&&(r.on.call("end",t,t.__data__,r.index,r.group),a())}function a(){r.state=y,r.timer.stop(),delete l[n];for(var e in l)return;delete t.__transition}var c,l=t.__transition;l[n]=r,r.timer=e.i(s.a)(i,0,r.time)}var a=e(55),s=e(40);e.d(n,"d",function(){return h}),e.d(n,"a",function(){return d}),e.d(n,"b",function(){return g}),e.d(n,"c",function(){return y}),n.g=r,n.e=i,n.f=u;var c=e.i(a.a)("start","end","interrupt"),l=[],f=0,h=1,d=2,p=3,v=4,g=5,y=6;n.h=function(t,n,e,r,i,u){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};o(t,e,{name:n,index:r,group:i,on:c,tween:l,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:f})}},function(t,n,e){"use strict";var r=(e(14),e(79),e(36));e.d(n,"d",function(){return r.a});var i=(e(80),e(15));e.d(n,"c",function(){return i.a});var u=(e(16),e(81),e(82),e(0));e.d(n,"a",function(){return u.a});var o=e(19);e.d(n,"f",function(){return o.a});var a=e(39);e.d(n,"e",function(){return a.a});var s=(e(110),e(111),e(21));e.d(n,"b",function(){return s.a});e(18)},function(t,n,e){"use strict";function r(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function i(t){retur
return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}}},function(t,n){"use strict";n.a=function(t){return new Array(t.length)}},function(t,n){"use strict";function e(){return[]}n.a=function(t){return null==t?e:function(){return this.querySelectorAll(t)}}},function(t,n,e){"use strict";var r=e(22);e.d(n,"c",function(){return r.c}),e.d(n,"a",function(){return r.a});var i=e(113);e.d(n,"b",function(){return i.a});e(112)},function(t,n,e){"use strict";var r=e(1);n.a=function(t,n){var e,i,u,o=t.__transition,a=!0;if(o){n=null==n?null:n+"";for(u in o)(e=o[u]).name===n?(i=e.state>r.a&&e.state<r.b,e.state=r.c,e.timer.stop(),i&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[u]):a=!1;a&&delete t.__transition}}},function(t,n,e){"use strict";var r=e(4),i=e(11);n.a=function(t,n){var u;return("number"==typeof n?i.b:n instanceof r.a?i.c:(u=e.i(r.a)(n))?(n=u,i.c):i.d)(t,n)}},function(t){t.exports=n},function(t){t.exports=e},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}(),o=e(23),a=r(o),s=e(50),c=r(s),l=e(24),f=r(l),h=e(25),d=function(t){return t},p=function(){function t(){i(this,t),this._tokenize=h.tokenize,this._transformToken=d;var n=f["default"].getDefault();this._filterToken=function(t){return!n.test(t)}}return u(t,[{key:"tokenize",value:function(){return 0===arguments.length?this._tokenize:(this._tokenize=arguments.length<=0?void 0:arguments[0],this)}},{key:"transformToken",value:function(){return 0===arguments.length?this._transformToken:(this._transformToken=arguments.length<=0?void 0:arguments[0],this)}},{key:"filterToken",value:function(){return 0===arguments.length?this._filterToken:(this._filterToken=arguments.length<=0?void 0:arguments[0],this)}},{key:"buildTokenizedDataset",value:function(t){var n=this,e=t.map(function(t){return{id:t.id,count:t.count||1,tokens:n._tokenize(t.text).map(n._transformToken).filter(n._filterToken),rawText:t.text}}).filter(function(t){return t.tokens.length>0});return new c["default"](e)}},{key:"buildModel",value:function(t,n){return new a["default"](this.buildTokenizedDataset(t),n)}}]),t}();n["default"]=p},function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function u(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}(),c=function m(t,n,e){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:m(i,n,e)}if("value"in r)return r.value;var u=r.get;return void 0===u?void 0:u.call(e)};e(114);var l=e(43),f=i(l),h=e(135),d=e(5),p=e(51),v=r(p),g=e(52),y=function(t){function n(t,e){u(this,n);var r=o(
}function i(t,n,e,r,i,u,a){var c,l,f,h={},d=n.length,p=u.length,v=new Array(d);for(c=0;d>c;++c)(l=n[c])&&(v[c]=f=s+a.call(l,l.__data__,c,n),f in h?i[c]=l:h[f]=l);for(c=0;p>c;++c)f=s+a.call(t,u[c],c,u),(l=h[f])?(r[c]=l,l.__data__=u[c],h[f]=null):e[c]=new o.b(t,u[c]);for(c=0;d>c;++c)(l=n[c])&&h[v[c]]===l&&(i[c]=l)}var u=e(0),o=e(37),a=e(78),s="$";n.a=function(t,n){if(!t)return m=new Array(this.size()),p=-1,this.each(function(t){m[++p]=t}),m;var o=n?i:r,s=this._parents,c=this._groups;"function"!=typeof t&&(t=e.i(a.a)(t));for(var l=c.length,f=new Array(l),h=new Array(l),d=new Array(l),p=0;l>p;++p){var v=s[p],g=c[p],y=g.length,m=t.call(v,v&&v.__data__,p,s),w=m.length,b=h[p]=new Array(w),_=f[p]=new Array(w),k=d[p]=new Array(y);o(v,g,b,_,k,m,n);for(var x,M,L=0,E=0;w>L;++L)if(x=b[L]){for(L>=E&&(E=L+1);!(M=_[E])&&++E<w;);x._next=M||null}}return f=new u.b(f,s),f._enter=h,f._exit=d,f}},function(t,n){"use strict";n.a=function(t){return arguments.length?this.property("__data__",t):this.node().__data__}},function(t,n,e){"use strict";function r(t,n,r){var i=e.i(o.a)(t),u=i.CustomEvent;u?u=new u(n,r):(u=i.document.createEvent("Event"),r?(u.initEvent(n,r.bubbles,r.cancelable),u.detail=r.detail):u.initEvent(n,!1,!1)),t.dispatchEvent(u)}function i(t,n){return function(){return r(this,t,n)}}function u(t,n){return function(){return r(this,t,n.apply(this,arguments))}}var o=e(21);n.a=function(t,n){return this.each(("function"==typeof n?u:i)(t,n))}},function(t,n){"use strict";n.a=function(t){for(var n=this._groups,e=0,r=n.length;r>e;++e)for(var i,u=n[e],o=0,a=u.length;a>o;++o)(i=u[o])&&t.call(i,i.__data__,o,u);return this}},function(t,n){"use strict";n.a=function(){return!this.node()}},function(t,n,e){"use strict";var r=e(38),i=e(0);n.a=function(){return new i.b(this._exit||this._groups.map(r.a),this._parents)}},function(t,n,e){"use strict";var r=e(0),i=e(36);n.a=function(t){"function"!=typeof t&&(t=e.i(i.a)(t));for(var n=this._groups,u=n.length,o=new Array(u),a=0;u>a;++a)for(var s,c=n[a],l=c.length,f=o[a]=[],h=0;l>h;++h)(s=c[h])&&t.call(s,s.__data__,h,c)&&f.push(s);return new r.b(o,this._parents)}},function(t,n){"use strict";function e(){this.innerHTML=""}function r(t){return function(){this.innerHTML=t}}function i(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}n.a=function(t){return arguments.length?this.each(null==t?e:("function"==typeof t?i:r)(t)):this.node().innerHTML}},function(t,n,e){"use strict";function r(){return null}var i=e(14),u=e(19);n.a=function(t,n){var o="function"==typeof t?t:e.i(i.a)(t),a=null==n?r:"function"==typeof n?n:e.i(u.a)(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),a.apply(this,arguments)||null)})}},function(t,n){"use strict";function e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}n.a=function(){return this.each(e)}},function(t,n,e){"use strict";var r=e(0);n.a=function(t){for(var n=this._groups,e=t._groups,i=n.length,u=e.length,o=Math.min(i,u),a=new Array(i),s=0;o>s;++s)for(var c,l=n[s],f=e[s],h=l.length,d=a[s]=new Array(h),p=0;h>p;++p)(c=l[p]||f[p])&&(d[p]=c);for(;i>s;++s)a[s]=n[s];return new r.b(a,this._parents)}},function(t,n){"use strict";n.a=function(){for(var t=this._groups,n=0,e=t.length;e>n;++n)for(var r=t[n],i=0,u=r.length;u>i;++i){var o=r[i];if(o)return o}return null}},function(t,n){"use strict";n.a=function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}},function(t,n){"use strict";n.a=function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],u=i.length-1,o=i[u];--u>=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this}},function(t,n){"use strict";function e(t){return function(){delete this[t]}}function r(t,n){return function(){this[t]=n}}function i(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}n.a=function(t,n){return arguments.length>1?this.each((null==n?e:"function"==typeof n?i:r)(t,n)):this.node()[t]}},function(t,n){"use strict";function e(){this.nextSibling&&this.parentNod