@hpcc-js/react 2.53.8 → 2.53.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es6.js +77 -72
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +551 -546
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +5 -5
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,573 +1,578 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/react"] = {}, global["@hpcc-js/common"]));
|
|
5
5
|
})(this, (function (exports, common) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var PKG_NAME$1 = "@hpcc-js/react";
|
|
8
|
+
var PKG_VERSION$1 = "2.53.10";
|
|
9
|
+
var BUILD_VERSION$1 = "2.104.32";
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var PKG_NAME = "@hpcc-js/preact-shim";
|
|
12
|
+
var PKG_VERSION = "2.16.7";
|
|
13
|
+
var BUILD_VERSION = "2.104.32";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
var n,l$1,u$1,i$1,o$1,r$1,f$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$1(l,f,i,o,null)}function d$1(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function k$1(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$1(n,l){if(null==l)return n.__?g$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__d||u.__e;return "function"==typeof n.type?g$1(n):null}function m$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m$1(n)}}function w$1(n){(!n.__d&&(n.__d=!0)&&i$1.push(n)&&!x.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||r$1)(x);}function x(){var n,l,u,t,o,r,e,c,s;for(i$1.sort(f$1);n=i$1.shift();)n.__d&&(l=i$1.length,t=void 0,o=void 0,r=void 0,c=(e=(u=n).__v).__e,(s=u.__P)&&(t=[],o=[],(r=h$1({},e)).__v=e.__v+1,z$1(s,e,r,u.__n,void 0!==s.ownerSVGElement,null!=e.__h?[c]:null,t,null==c?g$1(e):c,e.__h,o),L(t,e,o),e.__e!=c&&m$1(e)),i$1.length>l&&i$1.sort(f$1));x.__r=0;}function P(n,l,u,t,i,o,r,f,e,a,h){var p,y,_,b,m,w,x,P,C,D=0,H=t&&t.__k||s$1,I=H.length,T=I,j=l.length;for(u.__k=[],p=0;p<j;p++)null!=(b=u.__k[p]=null==(b=l[p])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d$1(null,b,null,null,b):v$1(b)?d$1(k$1,{children:b},null,null,null):b.__b>0?d$1(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=u,b.__b=u.__b+1,-1===(P=A(b,H,x=p+D,T))?_=c$1:(_=H[P]||c$1,H[P]=void 0,T--),z$1(n,b,_,i,o,r,f,e,a,h),m=b.__e,(y=b.ref)&&_.ref!=y&&(_.ref&&N(_.ref,null,b),h.push(y,b.__c||m,b)),null!=m&&(null==w&&(w=m),(C=_===c$1||null===_.__v)?-1==P&&D--:P!==x&&(P===x+1?D++:P>x?T>j-x?D+=P-x:D--:D=P<x&&P==x-1?P-x:0),x=p+D,"function"!=typeof b.type||P===x&&_.__k!==b.__k?"function"==typeof b.type||P===x&&!C?void 0!==b.__d?(e=b.__d,b.__d=void 0):e=m.nextSibling:e=S(n,m,e):e=$(b,e,n),"function"==typeof u.type&&(u.__d=e))):(_=H[p])&&null==_.key&&_.__e&&(_.__e==e&&(_.__=t,e=g$1(_)),O(_,_,!1),H[p]=null);for(u.__e=w,p=I;p--;)null!=H[p]&&("function"==typeof u.type&&null!=H[p].__e&&H[p].__e==u.__d&&(u.__d=H[p].__e.nextSibling),O(H[p],H[p]));}function $(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$(t,l,u):S(u,t.__e,l));return l}function S(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function A(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&i==e.key&&o===e.type)return r;r--;}if(f<l.length){if((e=l[f])&&i==e.key&&o===e.type)return f;f++;}}return -1}function D(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||I(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||I(n,o,l[o],u[o],t);}function H(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function I(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||H(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||H(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?j$1:T$1,o)):n.removeEventListener(l,o?j$1:T$1,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function T$1(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return}else n.t=Date.now();return u(l$1.event?l$1.event(n):n)}function j$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function z$1(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,g,m,w,x,$,C,S,A,D,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);n:if("function"==typeof I)try{if(w=u.props,x=(a=I.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(w,$):(u.__c=p=new b$1(w,$),p.constructor=I,p.render=q),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=$,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h$1({},p.__s)),h$1(p.__s,I.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else {if(null==I.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,$),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,$)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,$),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,g);});}if(p.context=$,p.props=w,p.__P=n,p.__e=!1,S=l$1.__r,A=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[];}else do{p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=h$1(h$1({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(d,_)),P(n,v$1(H=null!=a&&a.type===k$1&&null==a.key?a.props.children:a)?H:[H],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),m&&(p.__E=p.__=null);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,t);}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=M(t.__e,u,t,i,o,r,f,c,s);(a=l$1.diffed)&&a(u);}function L(n,u,t){for(var i=0;i<t.length;i++)N(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function M(l,u,t,i,o,r,f,e,s){var a,h,y,d=t.props,_=u.props,k=u.type,b=0;if("svg"===k&&(o=!0),null!=r)for(;b<r.length;b++)if((a=r[b])&&"setAttribute"in a==!!k&&(k?a.localName===k:3===a.nodeType)){l=a,r[b]=null;break}if(null==l){if(null===k)return document.createTextNode(_);l=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,_.is&&_),r=null,e=!1;}if(null===k)d===_||e&&l.data===_||(l.data=_);else {if(r=r&&n.call(l.childNodes),h=(d=t.props||c$1).dangerouslySetInnerHTML,y=_.dangerouslySetInnerHTML,!e){if(null!=r)for(d={},b=0;b<l.attributes.length;b++)d[l.attributes[b].name]=l.attributes[b].value;(y||h)&&(y&&(h&&y.__html==h.__html||y.__html===l.innerHTML)||(l.innerHTML=y&&y.__html||""));}if(D(l,_,d,o,e),y)u.__k=[];else if(P(l,v$1(b=u.props.children)?b:[b],u,t,i,o&&"foreignObject"!==k,r,f,r?r[0]:t.__k&&g$1(t,0),e,s),null!=r)for(b=r.length;b--;)null!=r[b]&&p$1(r[b]);e||("value"in _&&void 0!==(b=_.value)&&(b!==l.value||"progress"===k&&!b||"option"===k&&b!==d.value)&&I(l,"value",b,d.value,!1),"checked"in _&&void 0!==(b=_.checked)&&b!==l.checked&&I(l,"checked",b,d.checked,!1));}return l}function N(n,u,t){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,t);}}function O(n,u,t){var i,o;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null,n.__c=void 0;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&O(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function q(n,l,u){return this.constructor(n,u)}function B$1(u,t,i){var o,r,f,e;l$1.__&&l$1.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],z$1(t,u=(!o&&i||t).__k=y(k$1,null,[u]),r||c$1,c$1,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),L(f,u,e);}n=s$1.slice,l$1={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$1(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$1(this));},b$1.prototype.render=k$1,i$1=[],r$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x.__r=0;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
var t,r,u,i,o=0,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function h(n){return o=1,s(B,n)}function s(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r.u=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function p(u,i){var o=d(t++,3);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[],t=0)),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w(n){var t=r;n.__c=n.__(),r=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B(n,t){return "function"==typeof t?t(n):t}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
var index_es6 = /*#__PURE__*/Object.freeze({
|
|
20
|
+
__proto__: null,
|
|
21
|
+
BUILD_VERSION: BUILD_VERSION,
|
|
22
|
+
Component: b$1,
|
|
23
|
+
Fragment: k$1,
|
|
24
|
+
PKG_NAME: PKG_NAME,
|
|
25
|
+
PKG_VERSION: PKG_VERSION,
|
|
26
|
+
createElement: y,
|
|
27
|
+
h: y,
|
|
28
|
+
render: B$1,
|
|
29
|
+
useCallback: T,
|
|
30
|
+
useEffect: p,
|
|
31
|
+
useMemo: F,
|
|
32
|
+
useReducer: s,
|
|
33
|
+
useState: h
|
|
34
|
+
});
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
40
|
-
purpose with or without fee is hereby granted.
|
|
41
|
-
|
|
42
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
43
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
44
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
45
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
46
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
47
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
48
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
49
|
-
***************************************************************************** */
|
|
50
|
-
/* global Reflect, Promise */
|
|
51
|
-
|
|
52
|
-
var extendStatics = function(d, b) {
|
|
53
|
-
extendStatics = Object.setPrototypeOf ||
|
|
54
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
55
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
56
|
-
return extendStatics(d, b);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
function __extends(d, b) {
|
|
60
|
-
if (typeof b !== "function" && b !== null)
|
|
61
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
62
|
-
extendStatics(d, b);
|
|
63
|
-
function __() { this.constructor = d; }
|
|
64
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
var __assign = function() {
|
|
68
|
-
__assign = Object.assign || function __assign(t) {
|
|
69
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
70
|
-
s = arguments[i];
|
|
71
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
72
|
-
}
|
|
73
|
-
return t;
|
|
74
|
-
};
|
|
75
|
-
return __assign.apply(this, arguments);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
function __decorate(decorators, target, key, desc) {
|
|
79
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
80
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
81
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
82
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function __metadata(metadataKey, metadataValue) {
|
|
86
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
87
|
-
}
|
|
36
|
+
/******************************************************************************
|
|
37
|
+
Copyright (c) Microsoft Corporation.
|
|
88
38
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return y("image", { href: href, x: x - height / 2, y: y$1 - height / 2, width: height, height: height });
|
|
92
|
-
};
|
|
39
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
40
|
+
purpose with or without fee is hereby granted.
|
|
93
41
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
43
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
44
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
45
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
46
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
47
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
48
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
49
|
+
***************************************************************************** */
|
|
50
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
101
51
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
default:
|
|
123
|
-
return y(Circle, { radius: height / 2, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering });
|
|
52
|
+
var extendStatics = function(d, b) {
|
|
53
|
+
extendStatics = Object.setPrototypeOf ||
|
|
54
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
55
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
56
|
+
return extendStatics(d, b);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
function __extends(d, b) {
|
|
60
|
+
if (typeof b !== "function" && b !== null)
|
|
61
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
62
|
+
extendStatics(d, b);
|
|
63
|
+
function __() { this.constructor = d; }
|
|
64
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var __assign = function() {
|
|
68
|
+
__assign = Object.assign || function __assign(t) {
|
|
69
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
70
|
+
s = arguments[i];
|
|
71
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
124
72
|
}
|
|
73
|
+
return t;
|
|
125
74
|
};
|
|
75
|
+
return __assign.apply(this, arguments);
|
|
76
|
+
};
|
|
126
77
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
y(ImageChar, { x: xOffset, y: yOffset, height: height - padding, fontFamily: imageFontFamily, char: imageChar, fill: imageCharFill, "font-weight": 400 }));
|
|
134
|
-
};
|
|
135
|
-
var Icons = function (_a) {
|
|
136
|
-
var _b = _a.icons, icons = _b === void 0 ? [] : _b;
|
|
137
|
-
var IconComponents = icons.map(function (cat) {
|
|
138
|
-
return y("g", { key: cat.id, id: cat.id },
|
|
139
|
-
y(Icon, __assign({}, cat)));
|
|
140
|
-
});
|
|
141
|
-
return y(k$1, null, IconComponents);
|
|
142
|
-
};
|
|
78
|
+
function __decorate(decorators, target, key, desc) {
|
|
79
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
80
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
81
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
82
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
83
|
+
}
|
|
143
84
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
};
|
|
148
|
-
var Text = function (_a) {
|
|
149
|
-
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.fontFamily, fontFamily = _c === void 0 ? "Verdana" : _c, _d = _a.fill, fill = _d === void 0 ? "black" : _d, onSizeUpdate = _a.onSizeUpdate;
|
|
150
|
-
var _e = h(0), totalWidth = _e[0], setTotalWidthUpdate = _e[1];
|
|
151
|
-
var _f = h(0), totalHeight = _f[0], setTotalHeightUpdate = _f[1];
|
|
152
|
-
p(function () {
|
|
153
|
-
onSizeUpdate && onSizeUpdate({ width: totalWidth, height: totalHeight });
|
|
154
|
-
}, [totalWidth, totalHeight, onSizeUpdate]);
|
|
155
|
-
var parts = F(function () {
|
|
156
|
-
return text.split("\n");
|
|
157
|
-
}, [text]);
|
|
158
|
-
var ts = F(function () {
|
|
159
|
-
return common.Utility.textSize(parts, fontFamily, height);
|
|
160
|
-
}, [fontFamily, height, parts]);
|
|
161
|
-
setTotalWidthUpdate(ts.width);
|
|
162
|
-
setTotalHeightUpdate(parts.length * (height + 2) - 2);
|
|
163
|
-
var yOffset = -(totalHeight / 2) + (height / 2);
|
|
164
|
-
var TextLines = F(function () {
|
|
165
|
-
return parts.map(function (p, i) {
|
|
166
|
-
return y("g", { key: i, transform: "translate(0 ".concat(yOffset + i * (height + 2), ")") },
|
|
167
|
-
y(TextLine, { text: p, height: height, fontFamily: fontFamily, fill: fill }));
|
|
168
|
-
});
|
|
169
|
-
}, [fill, fontFamily, height, parts, yOffset]);
|
|
170
|
-
return y(k$1, null, TextLines);
|
|
171
|
-
};
|
|
172
|
-
var TextBox = function (_a) {
|
|
173
|
-
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.fontFamily, fontFamily = _c === void 0 ? "Verdana" : _c, _d = _a.padding, padding = _d === void 0 ? 4 : _d, _e = _a.fill, fill = _e === void 0 ? "whitesmoke" : _e, _f = _a.stroke, stroke = _f === void 0 ? "lightgray" : _f, _g = _a.textFill, textFill = _g === void 0 ? "black" : _g, _h = _a.strokeWidth, strokeWidth = _h === void 0 ? 1 : _h, _j = _a.cornerRadius, cornerRadius = _j === void 0 ? 0 : _j, onSizeUpdate = _a.onSizeUpdate;
|
|
174
|
-
var _k = h(0), textWidth = _k[0], setTextWidthUpdate = _k[1];
|
|
175
|
-
var _l = h(0), textHeight = _l[0], setTextHeightUpdate = _l[1];
|
|
176
|
-
p(function () {
|
|
177
|
-
onSizeUpdate && onSizeUpdate({ width: textWidth, height: textHeight });
|
|
178
|
-
}, [textWidth, textHeight, onSizeUpdate]);
|
|
179
|
-
var onTextSizeUpdate = T(function (size) {
|
|
180
|
-
setTextWidthUpdate(size.width);
|
|
181
|
-
setTextHeightUpdate(size.height);
|
|
182
|
-
}, []);
|
|
183
|
-
var w = textWidth + padding * 2 + strokeWidth;
|
|
184
|
-
var h$1 = textHeight + padding * 2 + strokeWidth;
|
|
185
|
-
var textOffsetY = Math.floor(height / 10);
|
|
186
|
-
return y(k$1, null,
|
|
187
|
-
y(Rectangle, { width: w, height: h$1, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
188
|
-
y("g", { transform: "translate(0 ".concat(textOffsetY, ")") },
|
|
189
|
-
y(Text, { text: text, fontFamily: fontFamily, height: height, fill: textFill, onSizeUpdate: onTextSizeUpdate })));
|
|
190
|
-
};
|
|
191
|
-
var LabelledRect = function (_a) {
|
|
192
|
-
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.width, width = _c === void 0 ? 12 : _c, _d = _a.fontFamily, fontFamily = _d === void 0 ? "Verdana" : _d, _e = _a.fontSize, fontSize = _e === void 0 ? 10 : _e, _f = _a.padding, padding = _f === void 0 ? 3 : _f, _g = _a.fill, fill = _g === void 0 ? "whitesmoke" : _g, _h = _a.stroke, stroke = _h === void 0 ? "lightgray" : _h, _j = _a.textFill, textFill = _j === void 0 ? "black" : _j, _k = _a.strokeWidth, strokeWidth = _k === void 0 ? 1 : _k, _l = _a.cornerRadius, cornerRadius = _l === void 0 ? 0 : _l; _a.onSizeUpdate;
|
|
193
|
-
return y(k$1, null,
|
|
194
|
-
y(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
195
|
-
y("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
196
|
-
y(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
197
|
-
};
|
|
198
|
-
var IconLabelledRect = function (_a) {
|
|
199
|
-
var icon = _a.icon, iconFontFamily = _a.iconFontFamily, text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.width, width = _c === void 0 ? 12 : _c, _d = _a.fontFamily, fontFamily = _d === void 0 ? "Verdana" : _d, _e = _a.fontSize, fontSize = _e === void 0 ? 10 : _e, _f = _a.padding, padding = _f === void 0 ? 3 : _f, _g = _a.fill, fill = _g === void 0 ? "whitesmoke" : _g, _h = _a.stroke, stroke = _h === void 0 ? "lightgray" : _h, _j = _a.textFill, textFill = _j === void 0 ? "black" : _j, _k = _a.strokeWidth, strokeWidth = _k === void 0 ? 1 : _k, _l = _a.cornerRadius, cornerRadius = _l === void 0 ? 0 : _l; _a.onSizeUpdate;
|
|
200
|
-
return y(k$1, null,
|
|
201
|
-
y(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
202
|
-
y("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
203
|
-
y(Icon, { shape: "square", imageFontFamily: iconFontFamily, imageChar: icon, height: height, fill: fill, imageCharFill: textFill })),
|
|
204
|
-
y("g", { transform: "translate(".concat(-(width / 2) + (padding * 2) + height, " ").concat(-(height / 2) + padding, ")") },
|
|
205
|
-
y(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
206
|
-
};
|
|
85
|
+
function __metadata(metadataKey, metadataValue) {
|
|
86
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
87
|
+
}
|
|
207
88
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
label && labelPos && labelPos.length === 2 ?
|
|
213
|
-
y("g", { transform: "translate(".concat(labelPos[0], " ").concat(labelPos[1], ")") },
|
|
214
|
-
y(Text, { text: label, fill: labelFill, height: labelHeight })) : undefined);
|
|
215
|
-
};
|
|
89
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
90
|
+
var e = new Error(message);
|
|
91
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
92
|
+
};
|
|
216
93
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
D(y("svg", null, y(C, props)), parent, replaceNode);
|
|
222
|
-
}
|
|
223
|
-
var HTMLAdapter = /** @class */ (function (_super) {
|
|
224
|
-
__extends(HTMLAdapter, _super);
|
|
225
|
-
function HTMLAdapter(_component) {
|
|
226
|
-
var _this = _super.call(this) || this;
|
|
227
|
-
_this._component = _component;
|
|
228
|
-
_this._props = {};
|
|
229
|
-
return _this;
|
|
230
|
-
}
|
|
231
|
-
HTMLAdapter.prototype.props = function (_) {
|
|
232
|
-
if (!arguments.length)
|
|
233
|
-
return this._props;
|
|
234
|
-
this._props = __assign(__assign({}, this._props), _);
|
|
235
|
-
return this;
|
|
236
|
-
};
|
|
237
|
-
HTMLAdapter.prototype.prop = function (_, value) {
|
|
238
|
-
if (arguments.length === 1)
|
|
239
|
-
return this._props[_];
|
|
240
|
-
this._props[_] = value;
|
|
241
|
-
return this;
|
|
242
|
-
};
|
|
243
|
-
HTMLAdapter.prototype.update = function (domNode, element) {
|
|
244
|
-
_super.prototype.update.call(this, domNode, element);
|
|
245
|
-
render(this._component, this._props, domNode);
|
|
246
|
-
};
|
|
247
|
-
__decorate([
|
|
248
|
-
common.publish({}, "object", "Properties"),
|
|
249
|
-
__metadata("design:type", Object)
|
|
250
|
-
], HTMLAdapter.prototype, "_props", void 0);
|
|
251
|
-
return HTMLAdapter;
|
|
252
|
-
}(common.HTMLWidget));
|
|
253
|
-
var SVGAdapter = /** @class */ (function (_super) {
|
|
254
|
-
__extends(SVGAdapter, _super);
|
|
255
|
-
function SVGAdapter(_component) {
|
|
256
|
-
var _this = _super.call(this) || this;
|
|
257
|
-
_this._component = _component;
|
|
258
|
-
_this._props = {};
|
|
259
|
-
return _this;
|
|
260
|
-
}
|
|
261
|
-
SVGAdapter.prototype.props = function (_) {
|
|
262
|
-
if (!arguments.length)
|
|
263
|
-
return this._props;
|
|
264
|
-
this._props = __assign(__assign({}, this._props), _);
|
|
265
|
-
return this;
|
|
266
|
-
};
|
|
267
|
-
SVGAdapter.prototype.prop = function (_, value) {
|
|
268
|
-
if (arguments.length === 1)
|
|
269
|
-
return this._props[_];
|
|
270
|
-
this._props[_] = value;
|
|
271
|
-
return this;
|
|
272
|
-
};
|
|
273
|
-
SVGAdapter.prototype.update = function (domNode, element) {
|
|
274
|
-
_super.prototype.update.call(this, domNode, element);
|
|
275
|
-
render(this._component, this._props, domNode);
|
|
276
|
-
};
|
|
277
|
-
__decorate([
|
|
278
|
-
common.publish({}, "object", "Properties"),
|
|
279
|
-
__metadata("design:type", Object)
|
|
280
|
-
], SVGAdapter.prototype, "_props", void 0);
|
|
281
|
-
return SVGAdapter;
|
|
282
|
-
}(common.SVGWidget));
|
|
94
|
+
var Image = function (_a) {
|
|
95
|
+
var href = _a.href, x = _a.x, _b = _a.y, y$1 = _b === void 0 ? 0 : _b, _c = _a.height, height = _c === void 0 ? 12 : _c;
|
|
96
|
+
return y("image", { href: href, x: x - height / 2, y: y$1 - height / 2, width: height, height: height });
|
|
97
|
+
};
|
|
283
98
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var _b = _a.categoryID, categoryID = _b === void 0 ? "" : _b, _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 12 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 4 : _e, _f = _a.icon, icon = _f === void 0 ? {} : _f, _g = _a.annotationsHeight, annotationsHeight = _g === void 0 ? 12 : _g, _h = _a.annotationIDs, annotationIDs = _h === void 0 ? [] : _h, textFill = _a.textFill, textboxFill = _a.textboxFill, textboxStroke = _a.textboxStroke, textFontFamily = _a.textFontFamily, onSizeUpdate = _a.onSizeUpdate, _j = _a.showLabel, showLabel = _j === void 0 ? true : _j, _k = _a.scale, scale = _k === void 0 ? 1 : _k;
|
|
292
|
-
var _l = h(0), textBoxWidth = _l[0], setTextBoxWidthUpdate = _l[1];
|
|
293
|
-
var _m = h(0), textBoxHeight = _m[0], setTextBoxHeightUpdate = _m[1];
|
|
294
|
-
p(function () {
|
|
295
|
-
onSizeUpdate && onSizeUpdate({ width: 0, height: 0 });
|
|
296
|
-
}, [textBoxWidth, textBoxHeight, onSizeUpdate]);
|
|
297
|
-
icon = __assign({ imageChar: "fa-question", height: 32, fill: "transparent" }, icon);
|
|
298
|
-
var width = textBoxWidth;
|
|
299
|
-
width += 4;
|
|
300
|
-
var offsetY = -(icon.height * 2 / 6 + textHeight + 8) / 2;
|
|
301
|
-
var textboxOffsetY = icon.height / 3 + textBoxHeight / 2 + textPadding;
|
|
302
|
-
var annotationOffsetY = icon.height / 3 + textBoxHeight + textPadding + annotationsHeight / 3;
|
|
303
|
-
if (!showLabel) {
|
|
304
|
-
offsetY += (textHeight + 8) / 2;
|
|
305
|
-
annotationOffsetY -= textBoxHeight + textPadding;
|
|
306
|
-
}
|
|
307
|
-
var onTextBoxSizeUpdate = T(function (size) {
|
|
308
|
-
setTextBoxWidthUpdate(size.width);
|
|
309
|
-
setTextBoxHeightUpdate(size.height);
|
|
310
|
-
}, []);
|
|
311
|
-
var label = showLabel ? y("g", { transform: "translate(0 ".concat(textboxOffsetY, ")") },
|
|
312
|
-
y(TextBox, { text: text, height: textHeight, padding: textPadding, onSizeUpdate: onTextBoxSizeUpdate, textFill: textFill, fill: textboxFill, stroke: textboxStroke, fontFamily: textFontFamily })) : undefined;
|
|
313
|
-
return categoryID ?
|
|
314
|
-
y("g", { transform: "translate(0 ".concat(offsetY, ") scale(").concat(scale, ")") },
|
|
315
|
-
y("use", { href: "#" + categoryID }),
|
|
316
|
-
label,
|
|
317
|
-
y(Annotations, { x: width / 2, y: annotationOffsetY, annotationIDs: annotationIDs })) :
|
|
318
|
-
y("g", { transform: "translate(0 ".concat(offsetY, ") scale(").concat(scale, ")") },
|
|
319
|
-
y(Icon, __assign({}, icon)),
|
|
320
|
-
label);
|
|
321
|
-
};
|
|
99
|
+
var ImageChar = function (_a) {
|
|
100
|
+
var x = _a.x, _b = _a.y, y$1 = _b === void 0 ? 0 : _b, _c = _a.height, height = _c === void 0 ? 12 : _c, fill = _a.fill, stroke = _a.stroke, _d = _a.fontFamily, fontFamily = _d === void 0 ? "FontAwesome" : _d, _e = _a.char, char = _e === void 0 ? "" : _e;
|
|
101
|
+
var renderChar = F(function () {
|
|
102
|
+
return fontFamily === "FontAwesome" ? common.Utility.faChar(char) : char;
|
|
103
|
+
}, [char, fontFamily]);
|
|
104
|
+
return y("text", { x: x, y: y$1, fill: fill, stroke: stroke, "font-family": fontFamily, "font-size": "".concat(height, "px"), "dominant-baseline": "middle", style: "text-anchor: middle;alignment-baseline:middle;" }, renderChar);
|
|
105
|
+
};
|
|
322
106
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
y(Annotations, { x: annotationOffsetX, y: annotationOffsetY, annotationIDs: annotationIDs, stepSize: stepSize }))
|
|
348
|
-
:
|
|
349
|
-
y(k$1, null,
|
|
350
|
-
y("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")scale(1.0002)") },
|
|
351
|
-
y(Icon, __assign({}, icon, { shape: "square" }))),
|
|
352
|
-
y("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")scale(1.0002)") },
|
|
353
|
-
y(TextBox, { text: text, height: textHeight, padding: textPadding, stroke: textboxStroke, fill: textboxFill })));
|
|
354
|
-
};
|
|
107
|
+
var Circle = function (_a) {
|
|
108
|
+
var _b = _a.radius, radius = _b === void 0 ? 32 : _b, _c = _a.fill, fill = _c === void 0 ? "navy" : _c, _d = _a.stroke, stroke = _d === void 0 ? fill : _d, _e = _a.strokeWidth, strokeWidth = _e === void 0 ? 1 : _e, shapeRendering = _a.shapeRendering;
|
|
109
|
+
return y("circle", { r: radius, fill: fill, stroke: stroke, "stroke-width": strokeWidth, "shape-rendering": shapeRendering });
|
|
110
|
+
};
|
|
111
|
+
var Square = function (_a) {
|
|
112
|
+
var _b = _a.radius, radius = _b === void 0 ? 30 : _b, _c = _a.cornerRadius, cornerRadius = _c === void 0 ? 0 : _c, _d = _a.fill, fill = _d === void 0 ? "white" : _d, stroke = _a.stroke, _e = _a.strokeWidth, strokeWidth = _e === void 0 ? 1 : _e, shapeRendering = _a.shapeRendering;
|
|
113
|
+
return y("rect", { x: -radius, y: -radius, rx: cornerRadius, ry: cornerRadius, width: radius * 2, height: radius * 2, fill: fill, stroke: stroke || fill, "stroke-width": strokeWidth, "shape-rendering": shapeRendering });
|
|
114
|
+
};
|
|
115
|
+
var Rectangle = function (_a) {
|
|
116
|
+
var _b = _a.width, width = _b === void 0 ? 30 : _b, _c = _a.height, height = _c === void 0 ? 30 : _c, _d = _a.cornerRadius, cornerRadius = _d === void 0 ? 0 : _d, _e = _a.fill, fill = _e === void 0 ? "white" : _e, _f = _a.stroke, stroke = _f === void 0 ? "black" : _f, _g = _a.strokeWidth, strokeWidth = _g === void 0 ? 1 : _g, shapeRendering = _a.shapeRendering;
|
|
117
|
+
return y("rect", { x: -width / 2, y: -height / 2, rx: cornerRadius, ry: cornerRadius, width: width, height: height, fill: fill, stroke: stroke || fill, "stroke-width": strokeWidth, "shape-rendering": shapeRendering });
|
|
118
|
+
};
|
|
119
|
+
var Shape = function (_a) {
|
|
120
|
+
var _b = _a.shape, shape = _b === void 0 ? "circle" : _b, _c = _a.height, height = _c === void 0 ? 128 : _c, width = _a.width, fill = _a.fill, stroke = _a.stroke, _d = _a.strokeWidth, strokeWidth = _d === void 0 ? 1 : _d, shapeRendering = _a.shapeRendering, cornerRadius = _a.cornerRadius;
|
|
121
|
+
switch (shape) {
|
|
122
|
+
case "square":
|
|
123
|
+
return y(Square, { radius: height / 2, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius });
|
|
124
|
+
case "rectangle":
|
|
125
|
+
return y(Rectangle, { width: width !== null && width !== void 0 ? width : height, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius });
|
|
126
|
+
case "circle":
|
|
127
|
+
default:
|
|
128
|
+
return y(Circle, { radius: height / 2, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering });
|
|
129
|
+
}
|
|
130
|
+
};
|
|
355
131
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
var textShapeHeight = textHeight + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
373
|
-
var annotationArr = [];
|
|
374
|
-
annotations.forEach(function (anno, idx) {
|
|
375
|
-
var annoText = anno.imageChar;
|
|
376
|
-
var annoShapeWidth = textShapeHeight;
|
|
377
|
-
fullAnnotationWidth += annoShapeWidth + annotationGutter;
|
|
378
|
-
var annoOffsetX = fullAnnotationWidth - (annoShapeWidth / 2);
|
|
379
|
-
annotationArr.push(y("g", { key: idx, class: "vertex3-anno", "data-click": "annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(annoOffsetX, " ").concat(annoOffsetY, ")") },
|
|
380
|
-
y(Icon, __assign({}, anno, { shape: "square", height: textShapeHeight, imageChar: annoText, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, strokeWidth: 0 }))));
|
|
381
|
-
});
|
|
382
|
-
if (annotations.length > 0) {
|
|
383
|
-
fullAnnotationWidth += annotationGutter * (annotations.length - 1);
|
|
384
|
-
}
|
|
385
|
-
var textElement = y("g", { "data-click": "text", transform: "translate(".concat(textOffsetX, " ").concat(annoOffsetY, ")") }, !showLabel || text === "" ? y("circle", { r: noLabelRadius, stroke: textboxStroke, fill: textFill }) : y(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily, cornerRadius: cornerRadius }));
|
|
386
|
-
var iconHeight = icon.height || 20;
|
|
387
|
-
var iconStrokeWidth = icon.strokeWidth || 0;
|
|
388
|
-
var iconOffsetX = 0;
|
|
389
|
-
var iconOffsetY = 0;
|
|
390
|
-
var subTextOffsetX = 0;
|
|
391
|
-
var subTextOffsetY = textShapeHeight + (annotationGutter * 2);
|
|
392
|
-
if (text !== "" || annotationArr.length > 0) {
|
|
393
|
-
iconOffsetY = -(iconHeight / 2) - (iconStrokeWidth) - (textShapeHeight / 2) - (annotationGutter * 2);
|
|
394
|
-
}
|
|
395
|
-
else if (subText.text !== "") {
|
|
396
|
-
subTextOffsetY = (iconHeight / 2) + iconStrokeWidth + (annotationGutter * 2);
|
|
397
|
-
}
|
|
398
|
-
var subtextElement = subText.text === "" ? null : y("g", { "data-click": "subtext", transform: "translate(".concat(subTextOffsetX, " ").concat(subTextOffsetY, ")") },
|
|
399
|
-
y(TextBox, __assign({ fill: subText.fill || "#FFFFFF", textFill: subText.textFill || textFill }, subText, { height: textHeight, padding: textPadding, strokeWidth: 0, stroke: textboxStroke, fontFamily: textFontFamily, cornerRadius: cornerRadius })));
|
|
400
|
-
return y("g", { transform: "scale(".concat(scale, ")") },
|
|
401
|
-
y("g", { "data-click": "icon", transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
402
|
-
y(Icon, __assign({}, icon)),
|
|
403
|
-
expansionIcon &&
|
|
404
|
-
y("g", { "data-click": "expanded-icon", "data-click-data": JSON.stringify(expansionIcon), transform: "translate(".concat((icon.height + iconStrokeWidth) / 2 - expansionIcon.height / 2, " ").concat(-(icon.height + iconStrokeWidth) / 2 + expansionIcon.height / 2, ")") },
|
|
405
|
-
y(Icon, __assign({}, expansionIcon)))),
|
|
406
|
-
y("g", { transform: "translate(".concat(-fullAnnotationWidth / 2, " ").concat(annoOffsetY, ")") },
|
|
407
|
-
textElement,
|
|
408
|
-
annotationArr),
|
|
409
|
-
subtextElement);
|
|
410
|
-
};
|
|
411
|
-
var CentroidVertex3 = function (_a) {
|
|
412
|
-
var id = _a.id, _b = _a.categoryID, categoryID = _b === void 0 ? "" : _b, _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 12 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 10 : _e, _f = _a.textFill, textFill = _f === void 0 ? "#287EC4" : _f, _g = _a.textboxFill, textboxFill = _g === void 0 ? "white" : _g, _h = _a.textboxStroke, textboxStroke = _h === void 0 ? "#CCCCCC" : _h, _j = _a.textboxStrokeWidth, textboxStrokeWidth = _j === void 0 ? 1 : _j, _k = _a.textFontFamily, textFontFamily = _k === void 0 ? "Verdana" : _k, _l = _a.annotationGutter, annotationGutter = _l === void 0 ? 2 : _l, _m = _a.annotations, annotations = _m === void 0 ? [] : _m, cornerRadius = _a.cornerRadius, _o = _a.icon, icon = _o === void 0 ? {} : _o, _p = _a.subText, subText = _p === void 0 ? {} : _p, expansionIcon = _a.expansionIcon, _q = _a.scale, scale = _q === void 0 ? 1 : _q;
|
|
413
|
-
icon = __assign({ height: 91, padding: 40, imageCharFill: "#555555", imageFontFamily: "FontAwesome", fill: "#FFCC33", stroke: "#DFDFDF", imageChar: "?", strokeWidth: 4, yOffset: -15 }, icon);
|
|
414
|
-
subText = __assign({ text: "", fill: "transparent", textFill: "#555555" }, subText);
|
|
415
|
-
var props = {
|
|
416
|
-
id: id,
|
|
417
|
-
categoryID: categoryID,
|
|
418
|
-
text: text,
|
|
419
|
-
textHeight: textHeight,
|
|
420
|
-
textPadding: textPadding,
|
|
421
|
-
textFill: textFill,
|
|
422
|
-
textboxFill: textboxFill,
|
|
423
|
-
textboxStroke: textboxStroke,
|
|
424
|
-
textboxStrokeWidth: textboxStrokeWidth,
|
|
425
|
-
textFontFamily: textFontFamily,
|
|
426
|
-
annotationGutter: annotationGutter,
|
|
427
|
-
annotations: annotations,
|
|
428
|
-
cornerRadius: cornerRadius,
|
|
429
|
-
icon: icon,
|
|
430
|
-
subText: subText,
|
|
431
|
-
expansionIcon: expansionIcon,
|
|
432
|
-
scale: scale
|
|
433
|
-
};
|
|
434
|
-
return y(Vertex3, __assign({}, props, { icon: icon, subText: subText }));
|
|
435
|
-
};
|
|
132
|
+
var Icon = function (_a) {
|
|
133
|
+
var _b = _a.shape, shape = _b === void 0 ? "circle" : _b, width = _a.width, _c = _a.height, height = _c === void 0 ? 32 : _c, fill = _a.fill, stroke = _a.stroke, _d = _a.strokeWidth, strokeWidth = _d === void 0 ? 0 : _d, _e = _a.imageUrl, imageUrl = _e === void 0 ? "" : _e, _f = _a.imageFontFamily, imageFontFamily = _f === void 0 ? "FontAwesome" : _f, _g = _a.imageChar, imageChar = _g === void 0 ? "" : _g, _h = _a.imageCharFill, imageCharFill = _h === void 0 ? common.Palette.textColor(fill) : _h, _j = _a.padding, padding = _j === void 0 ? height / 5 : _j, _k = _a.xOffset, xOffset = _k === void 0 ? 0 : _k, _l = _a.yOffset, yOffset = _l === void 0 ? 0 : _l, cornerRadius = _a.cornerRadius, shapeRendering = _a.shapeRendering;
|
|
134
|
+
return y(k$1, null,
|
|
135
|
+
y(Shape, { shape: shape, width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius }),
|
|
136
|
+
imageUrl ?
|
|
137
|
+
y(Image, { href: imageUrl, x: xOffset, y: yOffset, height: height - padding }) :
|
|
138
|
+
y(ImageChar, { x: xOffset, y: yOffset, height: height - padding, fontFamily: imageFontFamily, char: imageChar, fill: imageCharFill, "font-weight": 400 }));
|
|
139
|
+
};
|
|
140
|
+
var Icons = function (_a) {
|
|
141
|
+
var _b = _a.icons, icons = _b === void 0 ? [] : _b;
|
|
142
|
+
var IconComponents = icons.map(function (cat) {
|
|
143
|
+
return y("g", { key: cat.id, id: cat.id },
|
|
144
|
+
y(Icon, __assign({}, cat)));
|
|
145
|
+
});
|
|
146
|
+
return y(k$1, null, IconComponents);
|
|
147
|
+
};
|
|
436
148
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
textPadding: textPadding,
|
|
501
|
-
textFill: textFill,
|
|
502
|
-
textboxFill: textboxFill,
|
|
503
|
-
textboxStroke: textboxStroke,
|
|
504
|
-
textboxStrokeWidth: textboxStrokeWidth,
|
|
505
|
-
textFontFamily: textFontFamily,
|
|
506
|
-
annotationGutter: annotationGutter,
|
|
507
|
-
annotations: annotations,
|
|
508
|
-
iconAnnotations: iconAnnotations,
|
|
509
|
-
cornerRadius: cornerRadius,
|
|
510
|
-
icon: icon,
|
|
511
|
-
subText: subText,
|
|
512
|
-
showLabel: showLabel,
|
|
513
|
-
noLabelRadius: noLabelRadius,
|
|
514
|
-
iconBorderWidth: iconBorderWidth,
|
|
515
|
-
iconBorderColor: iconBorderColor,
|
|
516
|
-
iconBackgroundColor: iconBackgroundColor,
|
|
517
|
-
iconFontColor: iconFontColor,
|
|
518
|
-
iconFontSize: iconFontSize,
|
|
519
|
-
iconFontFamily: iconFontFamily,
|
|
520
|
-
shapeOffsetX: shapeOffsetX,
|
|
521
|
-
shapeOffsetY: shapeOffsetY,
|
|
522
|
-
iconOffsetX: iconOffsetX,
|
|
523
|
-
iconOffsetY: iconOffsetY,
|
|
524
|
-
iconPadding: iconPadding,
|
|
525
|
-
iconText: iconText,
|
|
526
|
-
shapeRendering: shapeRendering
|
|
527
|
-
};
|
|
528
|
-
return y(Vertex4, __assign({}, props, { icon: icon, subText: subText }));
|
|
529
|
-
};
|
|
149
|
+
var TextLine = function (_a) {
|
|
150
|
+
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.anchor, anchor = _c === void 0 ? "middle" : _c, _d = _a.baseline, baseline = _d === void 0 ? "middle" : _d, _e = _a.fontFamily, fontFamily = _e === void 0 ? "Verdana" : _e, _f = _a.fill, fill = _f === void 0 ? "black" : _f;
|
|
151
|
+
return y("text", { "font-family": fontFamily, "font-size": "".concat(height, "px"), "text-anchor": anchor, "dominant-baseline": baseline, fill: fill }, text);
|
|
152
|
+
};
|
|
153
|
+
var Text = function (_a) {
|
|
154
|
+
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.fontFamily, fontFamily = _c === void 0 ? "Verdana" : _c, _d = _a.fill, fill = _d === void 0 ? "black" : _d, onSizeUpdate = _a.onSizeUpdate;
|
|
155
|
+
var _e = h(0), totalWidth = _e[0], setTotalWidthUpdate = _e[1];
|
|
156
|
+
var _f = h(0), totalHeight = _f[0], setTotalHeightUpdate = _f[1];
|
|
157
|
+
p(function () {
|
|
158
|
+
onSizeUpdate && onSizeUpdate({ width: totalWidth, height: totalHeight });
|
|
159
|
+
}, [totalWidth, totalHeight, onSizeUpdate]);
|
|
160
|
+
var parts = F(function () {
|
|
161
|
+
return text.split("\n");
|
|
162
|
+
}, [text]);
|
|
163
|
+
var ts = F(function () {
|
|
164
|
+
return common.Utility.textSize(parts, fontFamily, height);
|
|
165
|
+
}, [fontFamily, height, parts]);
|
|
166
|
+
setTotalWidthUpdate(ts.width);
|
|
167
|
+
setTotalHeightUpdate(parts.length * (height + 2) - 2);
|
|
168
|
+
var yOffset = -(totalHeight / 2) + (height / 2);
|
|
169
|
+
var TextLines = F(function () {
|
|
170
|
+
return parts.map(function (p, i) {
|
|
171
|
+
return y("g", { key: i, transform: "translate(0 ".concat(yOffset + i * (height + 2), ")") },
|
|
172
|
+
y(TextLine, { text: p, height: height, fontFamily: fontFamily, fill: fill }));
|
|
173
|
+
});
|
|
174
|
+
}, [fill, fontFamily, height, parts, yOffset]);
|
|
175
|
+
return y(k$1, null, TextLines);
|
|
176
|
+
};
|
|
177
|
+
var TextBox = function (_a) {
|
|
178
|
+
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.fontFamily, fontFamily = _c === void 0 ? "Verdana" : _c, _d = _a.padding, padding = _d === void 0 ? 4 : _d, _e = _a.fill, fill = _e === void 0 ? "whitesmoke" : _e, _f = _a.stroke, stroke = _f === void 0 ? "lightgray" : _f, _g = _a.textFill, textFill = _g === void 0 ? "black" : _g, _h = _a.strokeWidth, strokeWidth = _h === void 0 ? 1 : _h, _j = _a.cornerRadius, cornerRadius = _j === void 0 ? 0 : _j, onSizeUpdate = _a.onSizeUpdate;
|
|
179
|
+
var _k = h(0), textWidth = _k[0], setTextWidthUpdate = _k[1];
|
|
180
|
+
var _l = h(0), textHeight = _l[0], setTextHeightUpdate = _l[1];
|
|
181
|
+
p(function () {
|
|
182
|
+
onSizeUpdate && onSizeUpdate({ width: textWidth, height: textHeight });
|
|
183
|
+
}, [textWidth, textHeight, onSizeUpdate]);
|
|
184
|
+
var onTextSizeUpdate = T(function (size) {
|
|
185
|
+
setTextWidthUpdate(size.width);
|
|
186
|
+
setTextHeightUpdate(size.height);
|
|
187
|
+
}, []);
|
|
188
|
+
var w = textWidth + padding * 2 + strokeWidth;
|
|
189
|
+
var h$1 = textHeight + padding * 2 + strokeWidth;
|
|
190
|
+
var textOffsetY = Math.floor(height / 10);
|
|
191
|
+
return y(k$1, null,
|
|
192
|
+
y(Rectangle, { width: w, height: h$1, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
193
|
+
y("g", { transform: "translate(0 ".concat(textOffsetY, ")") },
|
|
194
|
+
y(Text, { text: text, fontFamily: fontFamily, height: height, fill: textFill, onSizeUpdate: onTextSizeUpdate })));
|
|
195
|
+
};
|
|
196
|
+
var LabelledRect = function (_a) {
|
|
197
|
+
var text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.width, width = _c === void 0 ? 12 : _c, _d = _a.fontFamily, fontFamily = _d === void 0 ? "Verdana" : _d, _e = _a.fontSize, fontSize = _e === void 0 ? 10 : _e, _f = _a.padding, padding = _f === void 0 ? 3 : _f, _g = _a.fill, fill = _g === void 0 ? "whitesmoke" : _g, _h = _a.stroke, stroke = _h === void 0 ? "lightgray" : _h, _j = _a.textFill, textFill = _j === void 0 ? "black" : _j, _k = _a.strokeWidth, strokeWidth = _k === void 0 ? 1 : _k, _l = _a.cornerRadius, cornerRadius = _l === void 0 ? 0 : _l; _a.onSizeUpdate;
|
|
198
|
+
return y(k$1, null,
|
|
199
|
+
y(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
200
|
+
y("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
201
|
+
y(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
202
|
+
};
|
|
203
|
+
var IconLabelledRect = function (_a) {
|
|
204
|
+
var icon = _a.icon, iconFontFamily = _a.iconFontFamily, text = _a.text, _b = _a.height, height = _b === void 0 ? 12 : _b, _c = _a.width, width = _c === void 0 ? 12 : _c, _d = _a.fontFamily, fontFamily = _d === void 0 ? "Verdana" : _d, _e = _a.fontSize, fontSize = _e === void 0 ? 10 : _e, _f = _a.padding, padding = _f === void 0 ? 3 : _f, _g = _a.fill, fill = _g === void 0 ? "whitesmoke" : _g, _h = _a.stroke, stroke = _h === void 0 ? "lightgray" : _h, _j = _a.textFill, textFill = _j === void 0 ? "black" : _j, _k = _a.strokeWidth, strokeWidth = _k === void 0 ? 1 : _k, _l = _a.cornerRadius, cornerRadius = _l === void 0 ? 0 : _l; _a.onSizeUpdate;
|
|
205
|
+
return y(k$1, null,
|
|
206
|
+
y(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
207
|
+
y("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
208
|
+
y(Icon, { shape: "square", imageFontFamily: iconFontFamily, imageChar: icon, height: height, fill: fill, imageCharFill: textFill })),
|
|
209
|
+
y("g", { transform: "translate(".concat(-(width / 2) + (padding * 2) + height, " ").concat(-(height / 2) + padding, ")") },
|
|
210
|
+
y(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
211
|
+
};
|
|
530
212
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
213
|
+
var Edge = function (_a) {
|
|
214
|
+
var label = _a.label, labelPos = _a.labelPos, _b = _a.labelFill, labelFill = _b === void 0 ? "black" : _b, _c = _a.labelHeight, labelHeight = _c === void 0 ? 12 : _c, path = _a.path, stroke = _a.stroke, strokeWidth = _a.strokeWidth, strokeDasharray = _a.strokeDasharray;
|
|
215
|
+
return y(k$1, null,
|
|
216
|
+
y("path", { d: path, stroke: stroke, style: { strokeWidth: strokeWidth, strokeDasharray: strokeDasharray } }),
|
|
217
|
+
label && labelPos && labelPos.length === 2 ?
|
|
218
|
+
y("g", { transform: "translate(".concat(labelPos[0], " ").concat(labelPos[1], ")") },
|
|
219
|
+
y(Text, { text: label, fill: labelFill, height: labelHeight })) : undefined);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
function render(C, props, parent, replaceNode) {
|
|
223
|
+
B$1(y(C, props), parent, replaceNode);
|
|
224
|
+
}
|
|
225
|
+
function svgRender(C, props, parent, replaceNode) {
|
|
226
|
+
B$1(y("svg", null, y(C, props)), parent, replaceNode);
|
|
227
|
+
}
|
|
228
|
+
var HTMLAdapter = /** @class */ (function (_super) {
|
|
229
|
+
__extends(HTMLAdapter, _super);
|
|
230
|
+
function HTMLAdapter(_component) {
|
|
231
|
+
var _this = _super.call(this) || this;
|
|
232
|
+
_this._component = _component;
|
|
233
|
+
_this._props = {};
|
|
234
|
+
return _this;
|
|
235
|
+
}
|
|
236
|
+
HTMLAdapter.prototype.props = function (_) {
|
|
237
|
+
if (!arguments.length)
|
|
238
|
+
return this._props;
|
|
239
|
+
this._props = __assign(__assign({}, this._props), _);
|
|
240
|
+
return this;
|
|
241
|
+
};
|
|
242
|
+
HTMLAdapter.prototype.prop = function (_, value) {
|
|
243
|
+
if (arguments.length === 1)
|
|
244
|
+
return this._props[_];
|
|
245
|
+
this._props[_] = value;
|
|
246
|
+
return this;
|
|
247
|
+
};
|
|
248
|
+
HTMLAdapter.prototype.update = function (domNode, element) {
|
|
249
|
+
_super.prototype.update.call(this, domNode, element);
|
|
250
|
+
render(this._component, this._props, domNode);
|
|
251
|
+
};
|
|
252
|
+
__decorate([
|
|
253
|
+
common.publish({}, "object", "Properties"),
|
|
254
|
+
__metadata("design:type", Object)
|
|
255
|
+
], HTMLAdapter.prototype, "_props", void 0);
|
|
256
|
+
return HTMLAdapter;
|
|
257
|
+
}(common.HTMLWidget));
|
|
258
|
+
var SVGAdapter = /** @class */ (function (_super) {
|
|
259
|
+
__extends(SVGAdapter, _super);
|
|
260
|
+
function SVGAdapter(_component) {
|
|
261
|
+
var _this = _super.call(this) || this;
|
|
262
|
+
_this._component = _component;
|
|
263
|
+
_this._props = {};
|
|
264
|
+
return _this;
|
|
265
|
+
}
|
|
266
|
+
SVGAdapter.prototype.props = function (_) {
|
|
267
|
+
if (!arguments.length)
|
|
268
|
+
return this._props;
|
|
269
|
+
this._props = __assign(__assign({}, this._props), _);
|
|
270
|
+
return this;
|
|
271
|
+
};
|
|
272
|
+
SVGAdapter.prototype.prop = function (_, value) {
|
|
273
|
+
if (arguments.length === 1)
|
|
274
|
+
return this._props[_];
|
|
275
|
+
this._props[_] = value;
|
|
276
|
+
return this;
|
|
277
|
+
};
|
|
278
|
+
SVGAdapter.prototype.update = function (domNode, element) {
|
|
279
|
+
_super.prototype.update.call(this, domNode, element);
|
|
280
|
+
render(this._component, this._props, domNode);
|
|
281
|
+
};
|
|
282
|
+
__decorate([
|
|
283
|
+
common.publish({}, "object", "Properties"),
|
|
284
|
+
__metadata("design:type", Object)
|
|
285
|
+
], SVGAdapter.prototype, "_props", void 0);
|
|
286
|
+
return SVGAdapter;
|
|
287
|
+
}(common.SVGWidget));
|
|
288
|
+
|
|
289
|
+
var Annotations = function (_a) {
|
|
290
|
+
var x = _a.x, y$1 = _a.y, _b = _a.annotationIDs, annotationIDs = _b === void 0 ? [] : _b, _c = _a.stepSize, stepSize = _c === void 0 ? -16 : _c;
|
|
291
|
+
var IconComponents = annotationIDs.map(function (id, i) { return y("g", { key: id, transform: "translate(".concat(x + i * stepSize, " ").concat(y$1, ")") },
|
|
292
|
+
y("use", { href: "#" + id })); });
|
|
293
|
+
return y(k$1, null, IconComponents);
|
|
294
|
+
};
|
|
295
|
+
var Vertex = function (_a) {
|
|
296
|
+
var _b = _a.categoryID, categoryID = _b === void 0 ? "" : _b, _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 12 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 4 : _e, _f = _a.icon, icon = _f === void 0 ? {} : _f, _g = _a.annotationsHeight, annotationsHeight = _g === void 0 ? 12 : _g, _h = _a.annotationIDs, annotationIDs = _h === void 0 ? [] : _h, textFill = _a.textFill, textboxFill = _a.textboxFill, textboxStroke = _a.textboxStroke, textFontFamily = _a.textFontFamily, onSizeUpdate = _a.onSizeUpdate, _j = _a.showLabel, showLabel = _j === void 0 ? true : _j, _k = _a.scale, scale = _k === void 0 ? 1 : _k;
|
|
297
|
+
var _l = h(0), textBoxWidth = _l[0], setTextBoxWidthUpdate = _l[1];
|
|
298
|
+
var _m = h(0), textBoxHeight = _m[0], setTextBoxHeightUpdate = _m[1];
|
|
299
|
+
p(function () {
|
|
300
|
+
onSizeUpdate && onSizeUpdate({ width: 0, height: 0 });
|
|
301
|
+
}, [textBoxWidth, textBoxHeight, onSizeUpdate]);
|
|
302
|
+
icon = __assign({ imageChar: "fa-question", height: 32, fill: "transparent" }, icon);
|
|
303
|
+
var width = textBoxWidth;
|
|
304
|
+
width += 4;
|
|
305
|
+
var offsetY = -(icon.height * 2 / 6 + textHeight + 8) / 2;
|
|
306
|
+
var textboxOffsetY = icon.height / 3 + textBoxHeight / 2 + textPadding;
|
|
307
|
+
var annotationOffsetY = icon.height / 3 + textBoxHeight + textPadding + annotationsHeight / 3;
|
|
308
|
+
if (!showLabel) {
|
|
309
|
+
offsetY += (textHeight + 8) / 2;
|
|
310
|
+
annotationOffsetY -= textBoxHeight + textPadding;
|
|
311
|
+
}
|
|
312
|
+
var onTextBoxSizeUpdate = T(function (size) {
|
|
313
|
+
setTextBoxWidthUpdate(size.width);
|
|
314
|
+
setTextBoxHeightUpdate(size.height);
|
|
315
|
+
}, []);
|
|
316
|
+
var label = showLabel ? y("g", { transform: "translate(0 ".concat(textboxOffsetY, ")") },
|
|
317
|
+
y(TextBox, { text: text, height: textHeight, padding: textPadding, onSizeUpdate: onTextBoxSizeUpdate, textFill: textFill, fill: textboxFill, stroke: textboxStroke, fontFamily: textFontFamily })) : undefined;
|
|
318
|
+
return categoryID ?
|
|
319
|
+
y("g", { transform: "translate(0 ".concat(offsetY, ") scale(").concat(scale, ")") },
|
|
320
|
+
y("use", { href: "#" + categoryID }),
|
|
321
|
+
label,
|
|
322
|
+
y(Annotations, { x: width / 2, y: annotationOffsetY, annotationIDs: annotationIDs })) :
|
|
323
|
+
y("g", { transform: "translate(0 ".concat(offsetY, ") scale(").concat(scale, ")") },
|
|
324
|
+
y(Icon, __assign({}, icon)),
|
|
325
|
+
label);
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
var Vertex2 = function (_a) {
|
|
329
|
+
var _b = _a.categoryID, categoryID = _b === void 0 ? "" : _b, _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 12 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 4 : _e, _f = _a.icon, icon = _f === void 0 ? {} : _f, _g = _a.textFill, textFill = _g === void 0 ? "black" : _g, _h = _a.textboxFill, textboxFill = _h === void 0 ? "white" : _h, _j = _a.textboxStroke, textboxStroke = _j === void 0 ? "black" : _j, textFontFamily = _a.textFontFamily, _k = _a.annotationsHeight, annotationsHeight = _k === void 0 ? 12 : _k, _l = _a.annotationIDs, annotationIDs = _l === void 0 ? [] : _l;
|
|
330
|
+
icon = __assign({ imageChar: "fa-question", imageCharFill: "white", height: 32, fill: "black", shape: "square" }, icon);
|
|
331
|
+
var textBoxHeight = textHeight + textPadding * 2;
|
|
332
|
+
var width = F(function () {
|
|
333
|
+
return common.Utility.textSize(text, textFontFamily, textHeight, false);
|
|
334
|
+
}, [text, textFontFamily, textHeight]).width;
|
|
335
|
+
var stepSize = annotationsHeight;
|
|
336
|
+
var textboxStrokeWidth = 1;
|
|
337
|
+
var halfTextboxHeight = textBoxHeight / 2;
|
|
338
|
+
var offsetX = 0;
|
|
339
|
+
var offsetY = -(icon.height * 2 / 6 + textHeight + 8) / 2;
|
|
340
|
+
var iconOffsetX = -icon.height / 2;
|
|
341
|
+
var iconOffsetY = 0;
|
|
342
|
+
var textboxOffsetX = Math.ceil((width / 2) + textPadding);
|
|
343
|
+
var textboxOffsetY = halfTextboxHeight - (icon.height / 2);
|
|
344
|
+
var annotationOffsetX = stepSize / 2;
|
|
345
|
+
var annotationOffsetY = halfTextboxHeight;
|
|
346
|
+
return categoryID ?
|
|
347
|
+
y("g", { transform: "translate(".concat(offsetX, " ").concat(offsetY, ")") },
|
|
348
|
+
y("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
349
|
+
y("use", { href: "#" + categoryID })),
|
|
350
|
+
y("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")") },
|
|
351
|
+
y(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily })),
|
|
352
|
+
y(Annotations, { x: annotationOffsetX, y: annotationOffsetY, annotationIDs: annotationIDs, stepSize: stepSize }))
|
|
353
|
+
:
|
|
354
|
+
y(k$1, null,
|
|
355
|
+
y("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")scale(1.0002)") },
|
|
356
|
+
y(Icon, __assign({}, icon, { shape: "square" }))),
|
|
357
|
+
y("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")scale(1.0002)") },
|
|
358
|
+
y(TextBox, { text: text, height: textHeight, padding: textPadding, stroke: textboxStroke, fill: textboxFill })));
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
var Vertex3 = function (_a) {
|
|
362
|
+
var _b = _a.text, text = _b === void 0 ? "" : _b, _c = _a.textHeight, textHeight = _c === void 0 ? 10 : _c, _d = _a.textPadding, textPadding = _d === void 0 ? 4 : _d, _e = _a.textFill, textFill = _e === void 0 ? "#287EC4" : _e, _f = _a.textboxFill, textboxFill = _f === void 0 ? "white" : _f, _g = _a.textboxStroke, textboxStroke = _g === void 0 ? "#CCCCCC" : _g, _h = _a.textboxStrokeWidth, textboxStrokeWidth = _h === void 0 ? 1 : _h, _j = _a.textFontFamily, textFontFamily = _j === void 0 ? "Verdana" : _j, _k = _a.annotationGutter, annotationGutter = _k === void 0 ? 2 : _k, _l = _a.annotations, annotations = _l === void 0 ? [] : _l, _m = _a.cornerRadius, cornerRadius = _m === void 0 ? 3 : _m, _o = _a.icon, icon = _o === void 0 ? {} : _o, _p = _a.subText, subText = _p === void 0 ? { text: "" } : _p, _q = _a.showLabel, showLabel = _q === void 0 ? true : _q, _r = _a.noLabelRadius, noLabelRadius = _r === void 0 ? 5 : _r, expansionIcon = _a.expansionIcon, _s = _a.scale, scale = _s === void 0 ? 1 : _s;
|
|
363
|
+
icon = __assign({ height: 50, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "#555555", fill: "transparent", strokeWidth: 0 }, icon);
|
|
364
|
+
subText = __assign({ text: "", fill: "white", textFill: "#555555" }, subText);
|
|
365
|
+
expansionIcon = expansionIcon ? __assign({ height: 16, shape: "circle", padding: 6, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "black", fill: "whitesmoke", stroke: "whitesmoke", strokeWidth: 0 }, expansionIcon) : undefined;
|
|
366
|
+
var fullAnnotationWidth = 0;
|
|
367
|
+
var annoOffsetY = 0;
|
|
368
|
+
var labelWidth = F(function () {
|
|
369
|
+
return common.Utility.textSize(text, textFontFamily, textHeight, false).width;
|
|
370
|
+
}, [text, textFontFamily, textHeight]);
|
|
371
|
+
var labelShapeWidth = 0;
|
|
372
|
+
if (text !== "") {
|
|
373
|
+
labelShapeWidth = labelWidth + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
374
|
+
}
|
|
375
|
+
fullAnnotationWidth += labelShapeWidth + annotationGutter;
|
|
376
|
+
var textOffsetX = fullAnnotationWidth - (labelShapeWidth / 2);
|
|
377
|
+
var textShapeHeight = textHeight + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
378
|
+
var annotationArr = [];
|
|
379
|
+
annotations.forEach(function (anno, idx) {
|
|
380
|
+
var annoText = anno.imageChar;
|
|
381
|
+
var annoShapeWidth = textShapeHeight;
|
|
382
|
+
fullAnnotationWidth += annoShapeWidth + annotationGutter;
|
|
383
|
+
var annoOffsetX = fullAnnotationWidth - (annoShapeWidth / 2);
|
|
384
|
+
annotationArr.push(y("g", { key: idx, class: "vertex3-anno", "data-click": "annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(annoOffsetX, " ").concat(annoOffsetY, ")") },
|
|
385
|
+
y(Icon, __assign({}, anno, { shape: "square", height: textShapeHeight, imageChar: annoText, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, strokeWidth: 0 }))));
|
|
386
|
+
});
|
|
387
|
+
if (annotations.length > 0) {
|
|
388
|
+
fullAnnotationWidth += annotationGutter * (annotations.length - 1);
|
|
389
|
+
}
|
|
390
|
+
var textElement = y("g", { "data-click": "text", transform: "translate(".concat(textOffsetX, " ").concat(annoOffsetY, ")") }, !showLabel || text === "" ? y("circle", { r: noLabelRadius, stroke: textboxStroke, fill: textFill }) : y(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily, cornerRadius: cornerRadius }));
|
|
391
|
+
var iconHeight = icon.height || 20;
|
|
392
|
+
var iconStrokeWidth = icon.strokeWidth || 0;
|
|
393
|
+
var iconOffsetX = 0;
|
|
394
|
+
var iconOffsetY = 0;
|
|
395
|
+
var subTextOffsetX = 0;
|
|
396
|
+
var subTextOffsetY = textShapeHeight + (annotationGutter * 2);
|
|
397
|
+
if (text !== "" || annotationArr.length > 0) {
|
|
398
|
+
iconOffsetY = -(iconHeight / 2) - (iconStrokeWidth) - (textShapeHeight / 2) - (annotationGutter * 2);
|
|
399
|
+
}
|
|
400
|
+
else if (subText.text !== "") {
|
|
401
|
+
subTextOffsetY = (iconHeight / 2) + iconStrokeWidth + (annotationGutter * 2);
|
|
402
|
+
}
|
|
403
|
+
var subtextElement = subText.text === "" ? null : y("g", { "data-click": "subtext", transform: "translate(".concat(subTextOffsetX, " ").concat(subTextOffsetY, ")") },
|
|
404
|
+
y(TextBox, __assign({ fill: subText.fill || "#FFFFFF", textFill: subText.textFill || textFill }, subText, { height: textHeight, padding: textPadding, strokeWidth: 0, stroke: textboxStroke, fontFamily: textFontFamily, cornerRadius: cornerRadius })));
|
|
405
|
+
return y("g", { transform: "scale(".concat(scale, ")") },
|
|
406
|
+
y("g", { "data-click": "icon", transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
407
|
+
y(Icon, __assign({}, icon)),
|
|
408
|
+
expansionIcon &&
|
|
409
|
+
y("g", { "data-click": "expanded-icon", "data-click-data": JSON.stringify(expansionIcon), transform: "translate(".concat((icon.height + iconStrokeWidth) / 2 - expansionIcon.height / 2, " ").concat(-(icon.height + iconStrokeWidth) / 2 + expansionIcon.height / 2, ")") },
|
|
410
|
+
y(Icon, __assign({}, expansionIcon)))),
|
|
411
|
+
y("g", { transform: "translate(".concat(-fullAnnotationWidth / 2, " ").concat(annoOffsetY, ")") },
|
|
412
|
+
textElement,
|
|
413
|
+
annotationArr),
|
|
414
|
+
subtextElement);
|
|
415
|
+
};
|
|
416
|
+
var CentroidVertex3 = function (_a) {
|
|
417
|
+
var id = _a.id, _b = _a.categoryID, categoryID = _b === void 0 ? "" : _b, _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 12 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 10 : _e, _f = _a.textFill, textFill = _f === void 0 ? "#287EC4" : _f, _g = _a.textboxFill, textboxFill = _g === void 0 ? "white" : _g, _h = _a.textboxStroke, textboxStroke = _h === void 0 ? "#CCCCCC" : _h, _j = _a.textboxStrokeWidth, textboxStrokeWidth = _j === void 0 ? 1 : _j, _k = _a.textFontFamily, textFontFamily = _k === void 0 ? "Verdana" : _k, _l = _a.annotationGutter, annotationGutter = _l === void 0 ? 2 : _l, _m = _a.annotations, annotations = _m === void 0 ? [] : _m, cornerRadius = _a.cornerRadius, _o = _a.icon, icon = _o === void 0 ? {} : _o, _p = _a.subText, subText = _p === void 0 ? {} : _p, expansionIcon = _a.expansionIcon, _q = _a.scale, scale = _q === void 0 ? 1 : _q;
|
|
418
|
+
icon = __assign({ height: 91, padding: 40, imageCharFill: "#555555", imageFontFamily: "FontAwesome", fill: "#FFCC33", stroke: "#DFDFDF", imageChar: "?", strokeWidth: 4, yOffset: -15 }, icon);
|
|
419
|
+
subText = __assign({ text: "", fill: "transparent", textFill: "#555555" }, subText);
|
|
420
|
+
var props = {
|
|
421
|
+
id: id,
|
|
422
|
+
categoryID: categoryID,
|
|
423
|
+
text: text,
|
|
424
|
+
textHeight: textHeight,
|
|
425
|
+
textPadding: textPadding,
|
|
426
|
+
textFill: textFill,
|
|
427
|
+
textboxFill: textboxFill,
|
|
428
|
+
textboxStroke: textboxStroke,
|
|
429
|
+
textboxStrokeWidth: textboxStrokeWidth,
|
|
430
|
+
textFontFamily: textFontFamily,
|
|
431
|
+
annotationGutter: annotationGutter,
|
|
432
|
+
annotations: annotations,
|
|
433
|
+
cornerRadius: cornerRadius,
|
|
434
|
+
icon: icon,
|
|
435
|
+
subText: subText,
|
|
436
|
+
expansionIcon: expansionIcon,
|
|
437
|
+
scale: scale
|
|
438
|
+
};
|
|
439
|
+
return y(Vertex3, __assign({}, props, { icon: icon, subText: subText }));
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
var Vertex4 = function (_a) {
|
|
443
|
+
_a.categoryID; var _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 10 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 4 : _e, _f = _a.textFill, textFill = _f === void 0 ? "#287EC4" : _f, _g = _a.textboxFill, textboxFill = _g === void 0 ? "white" : _g, _h = _a.textboxStroke, textboxStroke = _h === void 0 ? "#CCCCCC" : _h, _j = _a.textboxStrokeWidth, textboxStrokeWidth = _j === void 0 ? 1 : _j, _k = _a.textFontFamily, textFontFamily = _k === void 0 ? "Verdana" : _k, _l = _a.annotationGutter, annotationGutter = _l === void 0 ? 2 : _l, _m = _a.annotations, annotations = _m === void 0 ? [] : _m, _o = _a.iconAnnotations, iconAnnotations = _o === void 0 ? [] : _o, _p = _a.cornerRadius, cornerRadius = _p === void 0 ? 3 : _p, _q = _a.icon, icon = _q === void 0 ? {} : _q, _r = _a.subText, subText = _r === void 0 ? {} : _r, _s = _a.showLabel, showLabel = _s === void 0 ? true : _s, _t = _a.noLabelRadius, noLabelRadius = _t === void 0 ? 5 : _t, _u = _a.iconBorderWidth, iconBorderWidth = _u === void 0 ? 1 : _u, _v = _a.iconBorderColor, iconBorderColor = _v === void 0 ? "#333" : _v, _w = _a.iconBackgroundColor, iconBackgroundColor = _w === void 0 ? "#fff" : _w, _x = _a.iconFontColor, iconFontColor = _x === void 0 ? "#000" : _x, _y = _a.iconFontSize, iconFontSize = _y === void 0 ? 20 : _y, _z = _a.iconFontFamily, iconFontFamily = _z === void 0 ? "FontAwesome" : _z, _0 = _a.shapeOffsetX, shapeOffsetX = _0 === void 0 ? 0 : _0, _1 = _a.shapeOffsetY, shapeOffsetY = _1 === void 0 ? 0 : _1, _2 = _a.iconOffsetX, iconOffsetX = _2 === void 0 ? 0 : _2, _3 = _a.iconOffsetY, iconOffsetY = _3 === void 0 ? 0 : _3, _4 = _a.iconPadding, iconPadding = _4 === void 0 ? 4 : _4, _5 = _a.iconText, iconText = _5 === void 0 ? "?" : _5, _6 = _a.shapeRendering, shapeRendering = _6 === void 0 ? "auto" : _6;
|
|
444
|
+
icon = __assign({ height: 50, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "#555555", fill: "transparent", strokeWidth: 0 }, icon);
|
|
445
|
+
subText = __assign({ text: "", fill: "white", textFill: "#555555" }, subText);
|
|
446
|
+
var annoOffsetY = 0;
|
|
447
|
+
var labelWidth = F(function () {
|
|
448
|
+
return common.Utility.textSize(text, textFontFamily, textHeight, false).width;
|
|
449
|
+
}, [text, textFontFamily, textHeight]);
|
|
450
|
+
var labelShapeWidth = 0;
|
|
451
|
+
if (text !== "") {
|
|
452
|
+
labelShapeWidth = labelWidth + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
453
|
+
}
|
|
454
|
+
var fullAnnotationWidth = labelShapeWidth + annotationGutter;
|
|
455
|
+
var textOffsetX = fullAnnotationWidth - (labelShapeWidth / 2);
|
|
456
|
+
var textShapeHeight = textHeight + (annotationGutter * 2) + (textboxStrokeWidth * 2);
|
|
457
|
+
var annoWidthArr = annotations.map(function (anno, i) {
|
|
458
|
+
return common.Utility.textSize(anno.imageChar, anno.imageFontFamily, anno.height, false).width;
|
|
459
|
+
});
|
|
460
|
+
var annotationArr = [];
|
|
461
|
+
var _labelAnnoOffsetX = fullAnnotationWidth;
|
|
462
|
+
annotations.forEach(function (anno, i) {
|
|
463
|
+
var _a;
|
|
464
|
+
var annoText = anno.imageChar;
|
|
465
|
+
var annoTextHeight = (_a = anno.height) !== null && _a !== void 0 ? _a : textShapeHeight;
|
|
466
|
+
_labelAnnoOffsetX += annoWidthArr[i] + annotationGutter;
|
|
467
|
+
var annoOffsetX = _labelAnnoOffsetX - (annoWidthArr[i] / 2);
|
|
468
|
+
annotationArr.push(y("g", { key: i, class: "vertex3-anno", "data-click": "annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(annoOffsetX, " ").concat(annoOffsetY, ")") },
|
|
469
|
+
y(Icon, __assign({}, anno, { shape: "rectangle", width: annoWidthArr[i], height: annoTextHeight, imageChar: annoText, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, strokeWidth: 0 }))));
|
|
470
|
+
});
|
|
471
|
+
if (annotations.length > 0) {
|
|
472
|
+
fullAnnotationWidth += annotationGutter * (annotations.length - 1);
|
|
473
|
+
}
|
|
474
|
+
var iconAnnotationArr = [];
|
|
475
|
+
iconAnnotations.forEach(function (anno, i) {
|
|
476
|
+
var _a;
|
|
477
|
+
var x = anno.shapeOffsetX;
|
|
478
|
+
var y$1 = anno.shapeOffsetY;
|
|
479
|
+
iconAnnotationArr.push(y("g", { key: i, class: "vertex3-iconAnno", "data-click": "icon-annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(x, " ").concat(y$1, ")") },
|
|
480
|
+
y(Icon, __assign({}, anno, { shape: (_a = anno.shape) !== null && _a !== void 0 ? _a : "square", imageChar: anno.imageChar, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, stroke: anno.stroke, strokeWidth: anno.strokeWidth }))));
|
|
481
|
+
});
|
|
482
|
+
var textElement = y("g", { "data-click": "text", transform: "translate(".concat(textOffsetX, " ").concat(annoOffsetY, ")") }, !showLabel || text === "" ? y("circle", { r: noLabelRadius, stroke: textboxStroke, fill: textFill }) : y(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily, cornerRadius: cornerRadius }));
|
|
483
|
+
var subTextOffsetX = 0;
|
|
484
|
+
var subTextOffsetY = textShapeHeight + (annotationGutter * 2);
|
|
485
|
+
var subtextElement = subText.text === "" ? null : y("g", { "data-click": "subtext", transform: "translate(".concat(subTextOffsetX, " ").concat(subTextOffsetY, ")") },
|
|
486
|
+
y(TextBox, __assign({ fill: subText.fill || "#FFFFFF", textFill: subText.textFill || textFill }, subText, { height: textHeight, padding: textPadding, strokeWidth: 0, stroke: textboxStroke, fontFamily: textFontFamily, cornerRadius: cornerRadius })));
|
|
487
|
+
return y("g", null,
|
|
488
|
+
y("g", { "data-click": "icon", transform: "translate(".concat(shapeOffsetX, " ").concat(shapeOffsetY, ")") },
|
|
489
|
+
y(Icon, __assign({}, icon, { strokeWidth: iconBorderWidth, shape: "circle", height: iconFontSize, fill: iconBackgroundColor, stroke: iconBorderColor, imageFontFamily: iconFontFamily, imageChar: iconText, imageCharFill: iconFontColor, padding: iconPadding, xOffset: iconOffsetX, yOffset: iconOffsetY, cornerRadius: cornerRadius, shapeRendering: shapeRendering })),
|
|
490
|
+
iconAnnotationArr),
|
|
491
|
+
y("g", { transform: "translate(".concat(-fullAnnotationWidth / 2, " ").concat(annoOffsetY, ")") },
|
|
492
|
+
textElement,
|
|
493
|
+
annotationArr),
|
|
494
|
+
subtextElement);
|
|
495
|
+
};
|
|
496
|
+
var CentroidVertex4 = function (_a) {
|
|
497
|
+
var id = _a.id, _b = _a.categoryID, categoryID = _b === void 0 ? "" : _b, _c = _a.text, text = _c === void 0 ? "" : _c, _d = _a.textHeight, textHeight = _d === void 0 ? 12 : _d, _e = _a.textPadding, textPadding = _e === void 0 ? 10 : _e, _f = _a.textFill, textFill = _f === void 0 ? "#287EC4" : _f, _g = _a.textboxFill, textboxFill = _g === void 0 ? "white" : _g, _h = _a.textboxStroke, textboxStroke = _h === void 0 ? "#CCCCCC" : _h, _j = _a.textboxStrokeWidth, textboxStrokeWidth = _j === void 0 ? 1 : _j, _k = _a.textFontFamily, textFontFamily = _k === void 0 ? "Verdana" : _k, _l = _a.annotationGutter, annotationGutter = _l === void 0 ? 2 : _l, _m = _a.annotations, annotations = _m === void 0 ? [] : _m, _o = _a.iconAnnotations, iconAnnotations = _o === void 0 ? [] : _o, cornerRadius = _a.cornerRadius, _p = _a.icon, icon = _p === void 0 ? {} : _p, _q = _a.subText, subText = _q === void 0 ? {} : _q, _r = _a.showLabel, showLabel = _r === void 0 ? true : _r, _s = _a.noLabelRadius, noLabelRadius = _s === void 0 ? 5 : _s, _t = _a.iconBorderWidth, iconBorderWidth = _t === void 0 ? 1 : _t, _u = _a.iconBorderColor, iconBorderColor = _u === void 0 ? "#333" : _u, _v = _a.iconBackgroundColor, iconBackgroundColor = _v === void 0 ? "#fff" : _v, _w = _a.iconFontColor, iconFontColor = _w === void 0 ? "#000" : _w, _x = _a.iconFontSize, iconFontSize = _x === void 0 ? 20 : _x, _y = _a.iconFontFamily, iconFontFamily = _y === void 0 ? "FontAwesome" : _y, _z = _a.shapeOffsetX, shapeOffsetX = _z === void 0 ? 0 : _z, _0 = _a.shapeOffsetY, shapeOffsetY = _0 === void 0 ? 0 : _0, _1 = _a.iconOffsetX, iconOffsetX = _1 === void 0 ? 0 : _1, _2 = _a.iconOffsetY, iconOffsetY = _2 === void 0 ? 0 : _2, _3 = _a.iconPadding, iconPadding = _3 === void 0 ? 4 : _3, _4 = _a.iconText, iconText = _4 === void 0 ? "?" : _4, _5 = _a.shapeRendering, shapeRendering = _5 === void 0 ? "auto" : _5;
|
|
498
|
+
icon = __assign({ height: 91, padding: 40, imageCharFill: "#555555", imageFontFamily: "FontAwesome", fill: "#FFCC33", stroke: "#DFDFDF", imageChar: "?", strokeWidth: 4, yOffset: -15 }, icon);
|
|
499
|
+
subText = __assign({ text: "", fill: "transparent", textFill: "#555555" }, subText);
|
|
500
|
+
var props = {
|
|
501
|
+
id: id,
|
|
502
|
+
categoryID: categoryID,
|
|
503
|
+
text: text,
|
|
504
|
+
textHeight: textHeight,
|
|
505
|
+
textPadding: textPadding,
|
|
506
|
+
textFill: textFill,
|
|
507
|
+
textboxFill: textboxFill,
|
|
508
|
+
textboxStroke: textboxStroke,
|
|
509
|
+
textboxStrokeWidth: textboxStrokeWidth,
|
|
510
|
+
textFontFamily: textFontFamily,
|
|
511
|
+
annotationGutter: annotationGutter,
|
|
512
|
+
annotations: annotations,
|
|
513
|
+
iconAnnotations: iconAnnotations,
|
|
514
|
+
cornerRadius: cornerRadius,
|
|
515
|
+
icon: icon,
|
|
516
|
+
subText: subText,
|
|
517
|
+
showLabel: showLabel,
|
|
518
|
+
noLabelRadius: noLabelRadius,
|
|
519
|
+
iconBorderWidth: iconBorderWidth,
|
|
520
|
+
iconBorderColor: iconBorderColor,
|
|
521
|
+
iconBackgroundColor: iconBackgroundColor,
|
|
522
|
+
iconFontColor: iconFontColor,
|
|
523
|
+
iconFontSize: iconFontSize,
|
|
524
|
+
iconFontFamily: iconFontFamily,
|
|
525
|
+
shapeOffsetX: shapeOffsetX,
|
|
526
|
+
shapeOffsetY: shapeOffsetY,
|
|
527
|
+
iconOffsetX: iconOffsetX,
|
|
528
|
+
iconOffsetY: iconOffsetY,
|
|
529
|
+
iconPadding: iconPadding,
|
|
530
|
+
iconText: iconText,
|
|
531
|
+
shapeRendering: shapeRendering
|
|
532
|
+
};
|
|
533
|
+
return y(Vertex4, __assign({}, props, { icon: icon, subText: subText }));
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
var Subgraph = function (_a) {
|
|
537
|
+
var text = _a.text, _b = _a.width, width = _b === void 0 ? 100 : _b, _c = _a.height, height = _c === void 0 ? 100 : _c, _d = _a.fill, fill = _d === void 0 ? "transparent" : _d, _e = _a.stroke, stroke = _e === void 0 ? "black" : _e, _f = _a.fontHeight, fontHeight = _f === void 0 ? 12 : _f, fontFamily = _a.fontFamily;
|
|
538
|
+
var tSize = common.Utility.textSize(text, fontFamily, fontHeight, false);
|
|
539
|
+
return y(k$1, null,
|
|
540
|
+
y(Rectangle, { width: width, height: height, fill: fill, stroke: stroke }),
|
|
541
|
+
y("g", { transform: "translate(".concat((-width + tSize.width) / 2 + 4, " ").concat((-height + tSize.height) / 2 + 4, ")") },
|
|
542
|
+
y(Text, { height: fontHeight, text: text, fontFamily: fontFamily })));
|
|
543
|
+
};
|
|
539
544
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
545
|
+
exports.Annotations = Annotations;
|
|
546
|
+
exports.BUILD_VERSION = BUILD_VERSION$1;
|
|
547
|
+
exports.CentroidVertex3 = CentroidVertex3;
|
|
548
|
+
exports.CentroidVertex4 = CentroidVertex4;
|
|
549
|
+
exports.Circle = Circle;
|
|
550
|
+
exports.Edge = Edge;
|
|
551
|
+
exports.HTMLAdapter = HTMLAdapter;
|
|
552
|
+
exports.Icon = Icon;
|
|
553
|
+
exports.IconLabelledRect = IconLabelledRect;
|
|
554
|
+
exports.Icons = Icons;
|
|
555
|
+
exports.ImageChar = ImageChar;
|
|
556
|
+
exports.LabelledRect = LabelledRect;
|
|
557
|
+
exports.PKG_NAME = PKG_NAME$1;
|
|
558
|
+
exports.PKG_VERSION = PKG_VERSION$1;
|
|
559
|
+
exports.React = index_es6;
|
|
560
|
+
exports.Rectangle = Rectangle;
|
|
561
|
+
exports.SVGAdapter = SVGAdapter;
|
|
562
|
+
exports.Shape = Shape;
|
|
563
|
+
exports.Square = Square;
|
|
564
|
+
exports.Subgraph = Subgraph;
|
|
565
|
+
exports.Text = Text;
|
|
566
|
+
exports.TextBox = TextBox;
|
|
567
|
+
exports.TextLine = TextLine;
|
|
568
|
+
exports.Vertex = Vertex;
|
|
569
|
+
exports.Vertex2 = Vertex2;
|
|
570
|
+
exports.Vertex3 = Vertex3;
|
|
571
|
+
exports.Vertex4 = Vertex4;
|
|
572
|
+
exports.render = render;
|
|
573
|
+
exports.svgRender = svgRender;
|
|
569
574
|
|
|
570
|
-
|
|
575
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
571
576
|
|
|
572
577
|
}));
|
|
573
578
|
//# sourceMappingURL=index.js.map
|