@hpcc-js/react 2.50.0 → 2.52.0
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 +234 -117
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +235 -116
- 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 +7 -7
- package/src/ImageChar.tsx +9 -2
- package/src/__package__.ts +2 -2
- package/src/edge.tsx +4 -1
- package/src/icon.tsx +7 -1
- package/src/index.ts +1 -0
- package/src/shape.tsx +13 -1
- package/src/text.tsx +37 -29
- package/src/vertex.tsx +9 -7
- package/src/vertex2.tsx +3 -1
- package/src/vertex3.tsx +38 -20
- package/src/vertex4.tsx +307 -0
- package/types/ImageChar.d.ts.map +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/edge.d.ts.map +1 -1
- package/types/icon.d.ts +3 -1
- package/types/icon.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/shape.d.ts +2 -1
- package/types/shape.d.ts.map +1 -1
- package/types/text.d.ts.map +1 -1
- package/types/vertex.d.ts.map +1 -1
- package/types/vertex2.d.ts.map +1 -1
- package/types/vertex3.d.ts +1 -0
- package/types/vertex3.d.ts.map +1 -1
- package/types/vertex4.d.ts +32 -0
- package/types/vertex4.d.ts.map +1 -0
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/icon.d.ts +3 -1
- package/types-3.4/index.d.ts +1 -0
- package/types-3.4/shape.d.ts +2 -1
- package/types-3.4/vertex3.d.ts +1 -0
- package/types-3.4/vertex4.d.ts +32 -0
package/dist/index.es6.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { Utility, Palette, publish, HTMLWidget, SVGWidget } from '@hpcc-js/common';
|
|
2
2
|
|
|
3
3
|
var PKG_NAME$1 = "@hpcc-js/react";
|
|
4
|
-
var PKG_VERSION$1 = "2.
|
|
5
|
-
var BUILD_VERSION$1 = "2.104.
|
|
4
|
+
var PKG_VERSION$1 = "2.52.0";
|
|
5
|
+
var BUILD_VERSION$1 = "2.104.3";
|
|
6
6
|
|
|
7
7
|
var PKG_NAME = "@hpcc-js/preact-shim";
|
|
8
|
-
var PKG_VERSION = "2.
|
|
9
|
-
var BUILD_VERSION = "2.104.
|
|
8
|
+
var PKG_VERSION = "2.16.1";
|
|
9
|
+
var BUILD_VERSION = "2.104.3";
|
|
10
10
|
|
|
11
|
-
var n,l$1,u$1,t$1,o$1,
|
|
11
|
+
var n,l$1,u$1,t$1,o$1,f$1={},e$1=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a$1(n){var l=n.parentNode;l&&l.removeChild(n);}function h$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,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 p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _(n,l){if(null==l)return n.__?_(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.__e;return "function"==typeof n.type?_(n):null}function k$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 k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$1!==l$1.debounceRendering)&&((o$1=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$1,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$1(k,s,n):s=A(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=_(i,h+1)),N(x[h],x[h]));if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$1(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$1(i,l,u):A(u,i,i,t,i.__e,l));return l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$1.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I,o):n.removeEventListener(l,o?T$1:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof H){if(g=u.props,m=(a=H.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in H&&H.prototype.render?u.__c=h=new H(g,x):(u.__c=h=new d$1(g,x),h.constructor=H,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=H.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,H.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==H.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==H.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,A=l$1.__r,C=0,"prototype"in H&&H.prototype.render)h.state=h.__s,h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context);else do{h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++C<25);h.state=h.__s,null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),$=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray($)?$:[$],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){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 L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$1(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||a$1(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h$1(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}n=e$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$1=[],g$1.__r=0;
|
|
12
12
|
|
|
13
|
-
var t,u,
|
|
13
|
+
var t,r,u,i,o=0,c=[],f=[],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:f}),i.__[t]}function p(n){return o=1,y$1(z,n)}function y$1(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):z(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)){r.u=!0;var c=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});return u.every(function(n){return !n.__N})?!c||c.call(this,n,t,r):!u.every(function(n){if(!n.__N)return !0;var t=n.__[0];return n.__=n.__N,n.__N=void 0,t===n.__[0]})&&(!c||c.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t++,3);!l$1.__s&&w(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function F(n,r){var u=d(t++,7);return w(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=c.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(j),t.__H.__h.forEach(k),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=f,n.__N=n.i=void 0;})):(i.__h.forEach(j),i.__h.forEach(k),i.__h=[])),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==c.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||function(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));})(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==f&&(n.__=n.__V),n.i=void 0,n.__V=f;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(j),t.__h=t.__h.filter(function(n){return !n.__||k(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{j(n);}catch(n){r=n;}}),r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function k(n){var t=r;n.__c=n.__(),r=t;}function w(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function z(n,t){return "function"==typeof t?t(n):t}
|
|
14
14
|
|
|
15
15
|
var index_es6 = /*#__PURE__*/Object.freeze({
|
|
16
16
|
__proto__: null,
|
|
17
17
|
BUILD_VERSION: BUILD_VERSION,
|
|
18
|
-
Component:
|
|
19
|
-
Fragment:
|
|
18
|
+
Component: d$1,
|
|
19
|
+
Fragment: p$1,
|
|
20
20
|
PKG_NAME: PKG_NAME,
|
|
21
21
|
PKG_VERSION: PKG_VERSION,
|
|
22
|
-
createElement:
|
|
23
|
-
h:
|
|
24
|
-
render:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
createElement: h$1,
|
|
23
|
+
h: h$1,
|
|
24
|
+
render: P,
|
|
25
|
+
useCallback: T,
|
|
26
|
+
useEffect: h,
|
|
27
|
+
useMemo: F,
|
|
28
|
+
useReducer: y$1,
|
|
29
|
+
useState: p
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
var pi = Math.PI,
|
|
@@ -325,15 +326,21 @@ function calcArc(points, curveDepth) {
|
|
|
325
326
|
}
|
|
326
327
|
var Edge = function (_a) {
|
|
327
328
|
var _b = _a.points, points = _b === void 0 ? [] : _b, _c = _a.curveDepth, curveDepth = _c === void 0 ? 16 : _c, _d = _a.stroke, stroke = _d === void 0 ? "black" : _d, strokeDasharray = _a.strokeDasharray;
|
|
328
|
-
|
|
329
|
+
var d = F(function () {
|
|
330
|
+
return line(calcArc(points, curveDepth));
|
|
331
|
+
}, [curveDepth, points]);
|
|
332
|
+
return h$1("path", { stroke: stroke, "stroke-dasharray": strokeDasharray, d: d });
|
|
329
333
|
};
|
|
330
334
|
|
|
331
335
|
var ImageChar = function (_a) {
|
|
332
336
|
var x = _a.x, _b = _a.y, y = _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;
|
|
333
|
-
|
|
337
|
+
var renderChar = F(function () {
|
|
338
|
+
return fontFamily === "FontAwesome" ? Utility.faChar(char) : char;
|
|
339
|
+
}, [char, fontFamily]);
|
|
340
|
+
return h$1("text", { x: x, y: y, fill: fill, stroke: stroke, "font-family": fontFamily, "font-size": "".concat(height, "px"), "dominant-baseline": "middle", style: "text-anchor: middle;alignment-baseline:middle;" }, renderChar);
|
|
334
341
|
};
|
|
335
342
|
|
|
336
|
-
|
|
343
|
+
/******************************************************************************
|
|
337
344
|
Copyright (c) Microsoft Corporation.
|
|
338
345
|
|
|
339
346
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -388,47 +395,49 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
388
395
|
|
|
389
396
|
var Circle = function (_a) {
|
|
390
397
|
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;
|
|
391
|
-
return
|
|
398
|
+
return h$1("circle", { r: radius, fill: fill, stroke: stroke, "stroke-width": strokeWidth, "shape-rendering": shapeRendering });
|
|
392
399
|
};
|
|
393
400
|
var Square = function (_a) {
|
|
394
401
|
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;
|
|
395
|
-
return
|
|
402
|
+
return h$1("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 });
|
|
396
403
|
};
|
|
397
404
|
var Rectangle = function (_a) {
|
|
398
405
|
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;
|
|
399
|
-
return
|
|
406
|
+
return h$1("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 });
|
|
400
407
|
};
|
|
401
408
|
var Shape = function (_a) {
|
|
402
|
-
var _b = _a.shape, shape = _b === void 0 ? "circle" : _b, _c = _a.height, height = _c === void 0 ? 128 : _c, fill = _a.fill, stroke = _a.stroke, _d = _a.strokeWidth, strokeWidth = _d === void 0 ? 1 : _d, shapeRendering = _a.shapeRendering, cornerRadius = _a.cornerRadius;
|
|
409
|
+
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;
|
|
403
410
|
switch (shape) {
|
|
404
411
|
case "square":
|
|
405
|
-
return
|
|
412
|
+
return h$1(Square, { radius: height / 2, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius });
|
|
413
|
+
case "rectangle":
|
|
414
|
+
return h$1(Rectangle, { width: width !== null && width !== void 0 ? width : height, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius });
|
|
406
415
|
case "circle":
|
|
407
416
|
default:
|
|
408
|
-
return
|
|
417
|
+
return h$1(Circle, { radius: height / 2, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering });
|
|
409
418
|
}
|
|
410
419
|
};
|
|
411
420
|
|
|
412
421
|
var Icon = function (_a) {
|
|
413
|
-
var _b = _a.shape, shape = _b === void 0 ? "circle" : _b, _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.imageFontFamily, imageFontFamily = _e === void 0 ? "FontAwesome" : _e, _f = _a.imageChar, imageChar = _f === void 0 ? "" : _f, _g = _a.imageCharFill, imageCharFill = _g === void 0 ? Palette.textColor(fill) : _g, _h = _a.padding, padding = _h === void 0 ? height / 5 : _h, _j = _a.
|
|
414
|
-
return
|
|
415
|
-
|
|
416
|
-
|
|
422
|
+
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.imageFontFamily, imageFontFamily = _e === void 0 ? "FontAwesome" : _e, _f = _a.imageChar, imageChar = _f === void 0 ? "" : _f, _g = _a.imageCharFill, imageCharFill = _g === void 0 ? Palette.textColor(fill) : _g, _h = _a.padding, padding = _h === void 0 ? height / 5 : _h, _j = _a.xOffset, xOffset = _j === void 0 ? 0 : _j, _k = _a.yOffset, yOffset = _k === void 0 ? 0 : _k, cornerRadius = _a.cornerRadius, shapeRendering = _a.shapeRendering;
|
|
423
|
+
return h$1(p$1, null,
|
|
424
|
+
h$1(Shape, { shape: shape, width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius }),
|
|
425
|
+
h$1(ImageChar, { x: xOffset, y: yOffset, height: height - padding, fontFamily: imageFontFamily, char: imageChar, fill: imageCharFill, "font-weight": 400 }));
|
|
417
426
|
};
|
|
418
427
|
var Icons = function (_a) {
|
|
419
428
|
var _b = _a.icons, icons = _b === void 0 ? [] : _b;
|
|
420
429
|
var IconComponents = icons.map(function (cat) {
|
|
421
|
-
return
|
|
422
|
-
|
|
430
|
+
return h$1("g", { key: cat.id, id: cat.id },
|
|
431
|
+
h$1(Icon, __assign({}, cat)));
|
|
423
432
|
});
|
|
424
|
-
return
|
|
433
|
+
return h$1(p$1, null, IconComponents);
|
|
425
434
|
};
|
|
426
435
|
|
|
427
436
|
function render(C, props, parent, replaceNode) {
|
|
428
|
-
|
|
437
|
+
P(h$1(C, props), parent, replaceNode);
|
|
429
438
|
}
|
|
430
439
|
function svgRender(C, props, parent, replaceNode) {
|
|
431
|
-
|
|
440
|
+
P(h$1("svg", null, h$1(C, props)), parent, replaceNode);
|
|
432
441
|
}
|
|
433
442
|
var HTMLAdapter = /** @class */ (function (_super) {
|
|
434
443
|
__extends(HTMLAdapter, _super);
|
|
@@ -493,73 +502,79 @@ var SVGAdapter = /** @class */ (function (_super) {
|
|
|
493
502
|
|
|
494
503
|
var TextLine = function (_a) {
|
|
495
504
|
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;
|
|
496
|
-
return
|
|
505
|
+
return h$1("text", { "font-family": fontFamily, "font-size": "".concat(height, "px"), "text-anchor": anchor, "dominant-baseline": baseline, fill: fill }, text);
|
|
497
506
|
};
|
|
498
507
|
var Text = function (_a) {
|
|
499
508
|
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;
|
|
500
|
-
var _e =
|
|
501
|
-
var _f =
|
|
502
|
-
|
|
509
|
+
var _e = p(0), totalWidth = _e[0], setTotalWidthUpdate = _e[1];
|
|
510
|
+
var _f = p(0), totalHeight = _f[0], setTotalHeightUpdate = _f[1];
|
|
511
|
+
h(function () {
|
|
503
512
|
onSizeUpdate && onSizeUpdate({ width: totalWidth, height: totalHeight });
|
|
504
513
|
}, [totalWidth, totalHeight, onSizeUpdate]);
|
|
505
|
-
var parts =
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
514
|
+
var parts = F(function () {
|
|
515
|
+
return text.split("\n");
|
|
516
|
+
}, [text]);
|
|
517
|
+
var ts = F(function () {
|
|
518
|
+
return Utility.textSize(parts, fontFamily, height);
|
|
519
|
+
}, [fontFamily, height, parts]);
|
|
520
|
+
setTotalWidthUpdate(ts.width);
|
|
521
|
+
setTotalHeightUpdate(parts.length * (height + 2) - 2);
|
|
509
522
|
var yOffset = -(totalHeight / 2) + (height / 2);
|
|
510
|
-
var TextLines =
|
|
511
|
-
return
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
523
|
+
var TextLines = F(function () {
|
|
524
|
+
return parts.map(function (p, i) {
|
|
525
|
+
return h$1("g", { key: i, transform: "translate(0 ".concat(yOffset + i * (height + 2), ")") },
|
|
526
|
+
h$1(TextLine, { text: p, height: height, fontFamily: fontFamily, fill: fill }));
|
|
527
|
+
});
|
|
528
|
+
}, [fill, fontFamily, height, parts, yOffset]);
|
|
529
|
+
return h$1(p$1, null, TextLines);
|
|
515
530
|
};
|
|
516
531
|
var TextBox = function (_a) {
|
|
517
532
|
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;
|
|
518
|
-
var _k =
|
|
519
|
-
var _l =
|
|
520
|
-
|
|
533
|
+
var _k = p(0), textWidth = _k[0], setTextWidthUpdate = _k[1];
|
|
534
|
+
var _l = p(0), textHeight = _l[0], setTextHeightUpdate = _l[1];
|
|
535
|
+
h(function () {
|
|
521
536
|
onSizeUpdate && onSizeUpdate({ width: textWidth, height: textHeight });
|
|
522
537
|
}, [textWidth, textHeight, onSizeUpdate]);
|
|
538
|
+
var onTextSizeUpdate = T(function (size) {
|
|
539
|
+
setTextWidthUpdate(size.width);
|
|
540
|
+
setTextHeightUpdate(size.height);
|
|
541
|
+
}, []);
|
|
523
542
|
var w = textWidth + padding * 2 + strokeWidth;
|
|
524
|
-
var h = textHeight + padding * 2 + strokeWidth;
|
|
543
|
+
var h$2 = textHeight + padding * 2 + strokeWidth;
|
|
525
544
|
var textOffsetY = Math.floor(height / 10);
|
|
526
|
-
return
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
function onTextSizeUpdate(size) {
|
|
531
|
-
onTextWidthUpdate(size.width);
|
|
532
|
-
onTextHeightUpdate(size.height);
|
|
533
|
-
}
|
|
545
|
+
return h$1(p$1, null,
|
|
546
|
+
h$1(Rectangle, { width: w, height: h$2, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
547
|
+
h$1("g", { transform: "translate(0 ".concat(textOffsetY, ")") },
|
|
548
|
+
h$1(Text, { text: text, fontFamily: fontFamily, height: height, fill: textFill, onSizeUpdate: onTextSizeUpdate })));
|
|
534
549
|
};
|
|
535
550
|
var LabelledRect = function (_a) {
|
|
536
551
|
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;
|
|
537
|
-
return
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
552
|
+
return h$1(p$1, null,
|
|
553
|
+
h$1(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
554
|
+
h$1("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
555
|
+
h$1(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
541
556
|
};
|
|
542
557
|
var IconLabelledRect = function (_a) {
|
|
543
558
|
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;
|
|
544
|
-
return
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
559
|
+
return h$1(p$1, null,
|
|
560
|
+
h$1(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
561
|
+
h$1("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
562
|
+
h$1(Icon, { shape: "square", imageFontFamily: iconFontFamily, imageChar: icon, height: height, fill: fill, imageCharFill: textFill })),
|
|
563
|
+
h$1("g", { transform: "translate(".concat(-(width / 2) + (padding * 2) + height, " ").concat(-(height / 2) + padding, ")") },
|
|
564
|
+
h$1(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
550
565
|
};
|
|
551
566
|
|
|
552
567
|
var Annotations = function (_a) {
|
|
553
568
|
var x = _a.x, y = _a.y, _b = _a.annotationIDs, annotationIDs = _b === void 0 ? [] : _b, _c = _a.stepSize, stepSize = _c === void 0 ? -16 : _c;
|
|
554
|
-
var IconComponents = annotationIDs.map(function (id, i) { return
|
|
555
|
-
|
|
556
|
-
return
|
|
569
|
+
var IconComponents = annotationIDs.map(function (id, i) { return h$1("g", { key: id, transform: "translate(".concat(x + i * stepSize, " ").concat(y, ")") },
|
|
570
|
+
h$1("use", { href: "#" + id })); });
|
|
571
|
+
return h$1(p$1, null, IconComponents);
|
|
557
572
|
};
|
|
558
573
|
var Vertex = function (_a) {
|
|
559
574
|
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;
|
|
560
|
-
var _k =
|
|
561
|
-
var _l =
|
|
562
|
-
|
|
575
|
+
var _k = p(0), textBoxWidth = _k[0], setTextBoxWidthUpdate = _k[1];
|
|
576
|
+
var _l = p(0), textBoxHeight = _l[0], setTextBoxHeightUpdate = _l[1];
|
|
577
|
+
h(function () {
|
|
563
578
|
onSizeUpdate && onSizeUpdate({ width: 0, height: 0 });
|
|
564
579
|
}, [textBoxWidth, textBoxHeight, onSizeUpdate]);
|
|
565
580
|
icon = __assign({ imageChar: "fa-question", height: 32, fill: "transparent" }, icon);
|
|
@@ -572,27 +587,29 @@ var Vertex = function (_a) {
|
|
|
572
587
|
offsetY += (textHeight + 8) / 2;
|
|
573
588
|
annotationOffsetY -= textBoxHeight + textPadding;
|
|
574
589
|
}
|
|
575
|
-
var
|
|
576
|
-
|
|
590
|
+
var onTextBoxSizeUpdate = T(function (size) {
|
|
591
|
+
setTextBoxWidthUpdate(size.width);
|
|
592
|
+
setTextBoxHeightUpdate(size.height);
|
|
593
|
+
}, []);
|
|
594
|
+
var label = showLabel ? h$1("g", { transform: "translate(0 ".concat(textboxOffsetY, ")") },
|
|
595
|
+
h$1(TextBox, { text: text, height: textHeight, padding: textPadding, onSizeUpdate: onTextBoxSizeUpdate, textFill: textFill, fill: textboxFill, stroke: textboxStroke, fontFamily: textFontFamily })) : undefined;
|
|
577
596
|
return categoryID ?
|
|
578
|
-
|
|
579
|
-
|
|
597
|
+
h$1("g", { transform: "translate(0 ".concat(offsetY, ")") },
|
|
598
|
+
h$1("use", { href: "#" + categoryID }),
|
|
580
599
|
label,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
600
|
+
h$1(Annotations, { x: width / 2, y: annotationOffsetY, annotationIDs: annotationIDs })) :
|
|
601
|
+
h$1("g", { transform: "translate(0 ".concat(offsetY, ")") },
|
|
602
|
+
h$1(Icon, __assign({}, icon)),
|
|
584
603
|
label);
|
|
585
|
-
function onTextBoxSizeUpdate(size) {
|
|
586
|
-
onTextBoxWidthUpdate(size.width);
|
|
587
|
-
onTextBoxHeightUpdate(size.height);
|
|
588
|
-
}
|
|
589
604
|
};
|
|
590
605
|
|
|
591
606
|
var Vertex2 = function (_a) {
|
|
592
607
|
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;
|
|
593
608
|
icon = __assign({ imageChar: "fa-question", imageCharFill: "white", height: 32, fill: "black", shape: "square" }, icon);
|
|
594
609
|
var textBoxHeight = textHeight + textPadding * 2;
|
|
595
|
-
var width =
|
|
610
|
+
var width = F(function () {
|
|
611
|
+
return Utility.textSize(text, textFontFamily, textHeight, false);
|
|
612
|
+
}, [text, textFontFamily, textHeight]).width;
|
|
596
613
|
var stepSize = annotationsHeight;
|
|
597
614
|
var textboxStrokeWidth = 1;
|
|
598
615
|
var halfTextboxHeight = textBoxHeight / 2;
|
|
@@ -605,27 +622,30 @@ var Vertex2 = function (_a) {
|
|
|
605
622
|
var annotationOffsetX = stepSize / 2;
|
|
606
623
|
var annotationOffsetY = halfTextboxHeight;
|
|
607
624
|
return categoryID ?
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
625
|
+
h$1("g", { transform: "translate(".concat(offsetX, " ").concat(offsetY, ")") },
|
|
626
|
+
h$1("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
627
|
+
h$1("use", { href: "#" + categoryID })),
|
|
628
|
+
h$1("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")") },
|
|
629
|
+
h$1(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily })),
|
|
630
|
+
h$1(Annotations, { x: annotationOffsetX, y: annotationOffsetY, annotationIDs: annotationIDs, stepSize: stepSize }))
|
|
614
631
|
:
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
632
|
+
h$1(p$1, null,
|
|
633
|
+
h$1("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")scale(1.0002)") },
|
|
634
|
+
h$1(Icon, __assign({}, icon, { shape: "square" }))),
|
|
635
|
+
h$1("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")scale(1.0002)") },
|
|
636
|
+
h$1(TextBox, { text: text, height: textHeight, padding: textPadding, stroke: textboxStroke, fill: textboxFill })));
|
|
620
637
|
};
|
|
621
638
|
|
|
622
639
|
var Vertex3 = function (_a) {
|
|
623
|
-
_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.cornerRadius, cornerRadius = _o === void 0 ? 3 : _o, _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;
|
|
640
|
+
_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.cornerRadius, cornerRadius = _o === void 0 ? 3 : _o, _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, expansionIcon = _a.expansionIcon;
|
|
624
641
|
icon = __assign({ height: 50, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "#555555", fill: "transparent", strokeWidth: 0 }, icon);
|
|
625
642
|
subText = __assign({ text: "", fill: "white", textFill: "#555555" }, subText);
|
|
643
|
+
expansionIcon = expansionIcon ? __assign({ height: 16, shape: "circle", padding: 6, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "black", fill: "whitesmoke", stroke: "whitesmoke", strokeWidth: 0 }, expansionIcon) : undefined;
|
|
626
644
|
var fullAnnotationWidth = 0;
|
|
627
645
|
var annoOffsetY = 0;
|
|
628
|
-
var labelWidth =
|
|
646
|
+
var labelWidth = F(function () {
|
|
647
|
+
return Utility.textSize(text, textFontFamily, textHeight, false).width;
|
|
648
|
+
}, [text, textFontFamily, textHeight]);
|
|
629
649
|
var labelShapeWidth = 0;
|
|
630
650
|
if (text !== "") {
|
|
631
651
|
labelShapeWidth = labelWidth + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
@@ -634,18 +654,18 @@ var Vertex3 = function (_a) {
|
|
|
634
654
|
var textOffsetX = fullAnnotationWidth - (labelShapeWidth / 2);
|
|
635
655
|
var textShapeHeight = textHeight + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
636
656
|
var annotationArr = [];
|
|
637
|
-
annotations.forEach(function (anno) {
|
|
657
|
+
annotations.forEach(function (anno, idx) {
|
|
638
658
|
var annoText = anno.imageChar;
|
|
639
659
|
var annoShapeWidth = textShapeHeight;
|
|
640
660
|
fullAnnotationWidth += annoShapeWidth + annotationGutter;
|
|
641
661
|
var annoOffsetX = fullAnnotationWidth - (annoShapeWidth / 2);
|
|
642
|
-
annotationArr.push(
|
|
643
|
-
|
|
662
|
+
annotationArr.push(h$1("g", { key: idx, class: "vertex3-anno", "data-click": "annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(annoOffsetX, " ").concat(annoOffsetY, ")") },
|
|
663
|
+
h$1(Icon, __assign({}, anno, { shape: "square", height: textShapeHeight, imageChar: annoText, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, strokeWidth: 0 }))));
|
|
644
664
|
});
|
|
645
665
|
if (annotations.length > 0) {
|
|
646
666
|
fullAnnotationWidth += annotationGutter * (annotations.length - 1);
|
|
647
667
|
}
|
|
648
|
-
var textElement =
|
|
668
|
+
var textElement = h$1("g", { "data-click": "text", transform: "translate(".concat(textOffsetX, " ").concat(annoOffsetY, ")") }, !showLabel || text === "" ? h$1("circle", { r: noLabelRadius, stroke: textboxStroke, fill: textFill }) : h$1(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily, cornerRadius: cornerRadius }));
|
|
649
669
|
var iconHeight = icon.height || 20;
|
|
650
670
|
var iconStrokeWidth = icon.strokeWidth || 0;
|
|
651
671
|
var iconOffsetX = 0;
|
|
@@ -658,18 +678,99 @@ var Vertex3 = function (_a) {
|
|
|
658
678
|
else if (subText.text !== "") {
|
|
659
679
|
subTextOffsetY = (iconHeight / 2) + iconStrokeWidth + (annotationGutter * 2);
|
|
660
680
|
}
|
|
661
|
-
var subtextElement = subText.text === "" ? null :
|
|
662
|
-
|
|
663
|
-
return
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
681
|
+
var subtextElement = subText.text === "" ? null : h$1("g", { "data-click": "subtext", transform: "translate(".concat(subTextOffsetX, " ").concat(subTextOffsetY, ")") },
|
|
682
|
+
h$1(TextBox, __assign({ fill: subText.fill || "#FFFFFF", textFill: subText.textFill || textFill }, subText, { height: textHeight, padding: textPadding, strokeWidth: 0, stroke: textboxStroke, fontFamily: textFontFamily, cornerRadius: cornerRadius })));
|
|
683
|
+
return h$1("g", null,
|
|
684
|
+
h$1("g", { "data-click": "icon", transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
685
|
+
h$1(Icon, __assign({}, icon)),
|
|
686
|
+
expansionIcon &&
|
|
687
|
+
h$1("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, ")") },
|
|
688
|
+
h$1(Icon, __assign({}, expansionIcon)))),
|
|
689
|
+
h$1("g", { transform: "translate(".concat(-fullAnnotationWidth / 2, " ").concat(annoOffsetY, ")") },
|
|
667
690
|
textElement,
|
|
668
691
|
annotationArr),
|
|
669
692
|
subtextElement);
|
|
670
693
|
};
|
|
671
694
|
var CentroidVertex3 = function (_a) {
|
|
672
|
-
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 ? 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;
|
|
695
|
+
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 ? 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;
|
|
696
|
+
icon = __assign({ height: 91, padding: 40, imageCharFill: "#555555", imageFontFamily: "FontAwesome", fill: "#FFCC33", stroke: "#DFDFDF", imageChar: "?", strokeWidth: 4, yOffset: -15 }, icon);
|
|
697
|
+
subText = __assign({ text: "", fill: "transparent", textFill: "#555555" }, subText);
|
|
698
|
+
var props = {
|
|
699
|
+
categoryID: categoryID,
|
|
700
|
+
text: text,
|
|
701
|
+
textHeight: textHeight,
|
|
702
|
+
textPadding: textPadding,
|
|
703
|
+
textFill: textFill,
|
|
704
|
+
textboxFill: textboxFill,
|
|
705
|
+
textboxStroke: textboxStroke,
|
|
706
|
+
textboxStrokeWidth: textboxStrokeWidth,
|
|
707
|
+
textFontFamily: textFontFamily,
|
|
708
|
+
annotationGutter: annotationGutter,
|
|
709
|
+
annotations: annotations,
|
|
710
|
+
cornerRadius: cornerRadius,
|
|
711
|
+
icon: icon,
|
|
712
|
+
subText: subText,
|
|
713
|
+
expansionIcon: expansionIcon
|
|
714
|
+
};
|
|
715
|
+
return h$1(Vertex3, __assign({}, props, { icon: icon, subText: subText }));
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
var Vertex4 = function (_a) {
|
|
719
|
+
_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;
|
|
720
|
+
icon = __assign({ height: 50, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "#555555", fill: "transparent", strokeWidth: 0 }, icon);
|
|
721
|
+
subText = __assign({ text: "", fill: "white", textFill: "#555555" }, subText);
|
|
722
|
+
var annoOffsetY = 0;
|
|
723
|
+
var labelWidth = F(function () {
|
|
724
|
+
return Utility.textSize(text, textFontFamily, textHeight, false).width;
|
|
725
|
+
}, [text, textFontFamily, textHeight]);
|
|
726
|
+
var labelShapeWidth = 0;
|
|
727
|
+
if (text !== "") {
|
|
728
|
+
labelShapeWidth = labelWidth + (textPadding * 2) + (textboxStrokeWidth * 2);
|
|
729
|
+
}
|
|
730
|
+
var fullAnnotationWidth = labelShapeWidth + annotationGutter;
|
|
731
|
+
var textOffsetX = fullAnnotationWidth - (labelShapeWidth / 2);
|
|
732
|
+
var textShapeHeight = textHeight + (annotationGutter * 2) + (textboxStrokeWidth * 2);
|
|
733
|
+
var annoWidthArr = annotations.map(function (anno, i) {
|
|
734
|
+
return Utility.textSize(anno.imageChar, anno.imageFontFamily, anno.height, false).width;
|
|
735
|
+
});
|
|
736
|
+
var annotationArr = [];
|
|
737
|
+
var _labelAnnoOffsetX = fullAnnotationWidth;
|
|
738
|
+
annotations.forEach(function (anno, i) {
|
|
739
|
+
var _a;
|
|
740
|
+
var annoText = anno.imageChar;
|
|
741
|
+
var annoTextHeight = (_a = anno.height) !== null && _a !== void 0 ? _a : textShapeHeight;
|
|
742
|
+
_labelAnnoOffsetX += annoWidthArr[i] + annotationGutter;
|
|
743
|
+
var annoOffsetX = _labelAnnoOffsetX - (annoWidthArr[i] / 2);
|
|
744
|
+
annotationArr.push(h$1("g", { key: i, class: "vertex3-anno", "data-click": "annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(annoOffsetX, " ").concat(annoOffsetY, ")") },
|
|
745
|
+
h$1(Icon, __assign({}, anno, { shape: "rectangle", width: annoWidthArr[i], height: annoTextHeight, imageChar: annoText, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, strokeWidth: 0 }))));
|
|
746
|
+
});
|
|
747
|
+
if (annotations.length > 0) {
|
|
748
|
+
fullAnnotationWidth += annotationGutter * (annotations.length - 1);
|
|
749
|
+
}
|
|
750
|
+
var iconAnnotationArr = [];
|
|
751
|
+
iconAnnotations.forEach(function (anno, i) {
|
|
752
|
+
var _a;
|
|
753
|
+
var x = anno.shapeOffsetX;
|
|
754
|
+
var y = anno.shapeOffsetY;
|
|
755
|
+
iconAnnotationArr.push(h$1("g", { key: i, class: "vertex3-iconAnno", "data-click": "icon-annotation", "data-click-data": JSON.stringify(anno), transform: "translate(".concat(x, " ").concat(y, ")") },
|
|
756
|
+
h$1(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 }))));
|
|
757
|
+
});
|
|
758
|
+
var textElement = h$1("g", { "data-click": "text", transform: "translate(".concat(textOffsetX, " ").concat(annoOffsetY, ")") }, !showLabel || text === "" ? h$1("circle", { r: noLabelRadius, stroke: textboxStroke, fill: textFill }) : h$1(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily, cornerRadius: cornerRadius }));
|
|
759
|
+
var subTextOffsetX = 0;
|
|
760
|
+
var subTextOffsetY = textShapeHeight + (annotationGutter * 2);
|
|
761
|
+
var subtextElement = subText.text === "" ? null : h$1("g", { "data-click": "subtext", transform: "translate(".concat(subTextOffsetX, " ").concat(subTextOffsetY, ")") },
|
|
762
|
+
h$1(TextBox, __assign({ fill: subText.fill || "#FFFFFF", textFill: subText.textFill || textFill }, subText, { height: textHeight, padding: textPadding, strokeWidth: 0, stroke: textboxStroke, fontFamily: textFontFamily, cornerRadius: cornerRadius })));
|
|
763
|
+
return h$1("g", null,
|
|
764
|
+
h$1("g", { "data-click": "icon", transform: "translate(".concat(shapeOffsetX, " ").concat(shapeOffsetY, ")") },
|
|
765
|
+
h$1(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 })),
|
|
766
|
+
iconAnnotationArr),
|
|
767
|
+
h$1("g", { transform: "translate(".concat(-fullAnnotationWidth / 2, " ").concat(annoOffsetY, ")") },
|
|
768
|
+
textElement,
|
|
769
|
+
annotationArr),
|
|
770
|
+
subtextElement);
|
|
771
|
+
};
|
|
772
|
+
var CentroidVertex4 = function (_a) {
|
|
773
|
+
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 ? 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;
|
|
673
774
|
icon = __assign({ height: 91, padding: 40, imageCharFill: "#555555", imageFontFamily: "FontAwesome", fill: "#FFCC33", stroke: "#DFDFDF", imageChar: "?", strokeWidth: 4, yOffset: -15 }, icon);
|
|
674
775
|
subText = __assign({ text: "", fill: "transparent", textFill: "#555555" }, subText);
|
|
675
776
|
var props = {
|
|
@@ -684,21 +785,37 @@ var CentroidVertex3 = function (_a) {
|
|
|
684
785
|
textFontFamily: textFontFamily,
|
|
685
786
|
annotationGutter: annotationGutter,
|
|
686
787
|
annotations: annotations,
|
|
788
|
+
iconAnnotations: iconAnnotations,
|
|
687
789
|
cornerRadius: cornerRadius,
|
|
688
790
|
icon: icon,
|
|
689
|
-
subText: subText
|
|
791
|
+
subText: subText,
|
|
792
|
+
showLabel: showLabel,
|
|
793
|
+
noLabelRadius: noLabelRadius,
|
|
794
|
+
iconBorderWidth: iconBorderWidth,
|
|
795
|
+
iconBorderColor: iconBorderColor,
|
|
796
|
+
iconBackgroundColor: iconBackgroundColor,
|
|
797
|
+
iconFontColor: iconFontColor,
|
|
798
|
+
iconFontSize: iconFontSize,
|
|
799
|
+
iconFontFamily: iconFontFamily,
|
|
800
|
+
shapeOffsetX: shapeOffsetX,
|
|
801
|
+
shapeOffsetY: shapeOffsetY,
|
|
802
|
+
iconOffsetX: iconOffsetX,
|
|
803
|
+
iconOffsetY: iconOffsetY,
|
|
804
|
+
iconPadding: iconPadding,
|
|
805
|
+
iconText: iconText,
|
|
806
|
+
shapeRendering: shapeRendering
|
|
690
807
|
};
|
|
691
|
-
return
|
|
808
|
+
return h$1(Vertex4, __assign({}, props, { icon: icon, subText: subText }));
|
|
692
809
|
};
|
|
693
810
|
|
|
694
811
|
var Subgraph = function (_a) {
|
|
695
812
|
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;
|
|
696
813
|
var tSize = Utility.textSize(text, fontFamily, fontHeight, false);
|
|
697
|
-
return
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
814
|
+
return h$1(p$1, null,
|
|
815
|
+
h$1(Rectangle, { width: width, height: height, fill: fill, stroke: stroke }),
|
|
816
|
+
h$1("g", { transform: "translate(".concat((-width + tSize.width) / 2 + 4, " ").concat((-height + tSize.height) / 2 + 4, ")") },
|
|
817
|
+
h$1(Text, { height: fontHeight, text: text, fontFamily: fontFamily })));
|
|
701
818
|
};
|
|
702
819
|
|
|
703
|
-
export { Annotations, BUILD_VERSION$1 as BUILD_VERSION, CentroidVertex3, Circle, Edge, HTMLAdapter, Icon, IconLabelledRect, Icons, ImageChar, LabelledRect, PKG_NAME$1 as PKG_NAME, PKG_VERSION$1 as PKG_VERSION, index_es6 as React, Rectangle, SVGAdapter, Shape, Square, Subgraph, Text, TextBox, TextLine, Vertex, Vertex2, Vertex3, render, svgRender };
|
|
820
|
+
export { Annotations, BUILD_VERSION$1 as BUILD_VERSION, CentroidVertex3, CentroidVertex4, Circle, Edge, HTMLAdapter, Icon, IconLabelledRect, Icons, ImageChar, LabelledRect, PKG_NAME$1 as PKG_NAME, PKG_VERSION$1 as PKG_VERSION, index_es6 as React, Rectangle, SVGAdapter, Shape, Square, Subgraph, Text, TextBox, TextLine, Vertex, Vertex2, Vertex3, Vertex4, render, svgRender };
|
|
704
821
|
//# sourceMappingURL=index.es6.js.map
|