@hpcc-js/react 2.44.0 → 2.45.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 +64 -64
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +69 -69
- 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 +19 -19
- package/src/__package__.ts +2 -2
- package/src/vertex3.tsx +1 -1
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common'], factory) :
|
|
4
|
-
(global = global || self, factory(global[
|
|
5
|
-
}(this, (function (exports, common) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/react"] = {}, global["@hpcc-js/common"]));
|
|
5
|
+
})(this, (function (exports, common) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var PKG_NAME = "@hpcc-js/react";
|
|
8
|
-
var PKG_VERSION = "2.
|
|
9
|
-
var BUILD_VERSION = "2.
|
|
7
|
+
var PKG_NAME$1 = "@hpcc-js/react";
|
|
8
|
+
var PKG_VERSION$1 = "2.45.0";
|
|
9
|
+
var BUILD_VERSION$1 = "2.97.0";
|
|
10
10
|
|
|
11
|
-
var PKG_NAME
|
|
12
|
-
var PKG_VERSION
|
|
13
|
-
var BUILD_VERSION
|
|
11
|
+
var PKG_NAME = "@hpcc-js/preact-shim";
|
|
12
|
+
var PKG_VERSION = "2.13.19";
|
|
13
|
+
var BUILD_VERSION = "2.97.0";
|
|
14
14
|
|
|
15
|
-
var n,u,i,t,o,
|
|
15
|
+
var n,u$1,i$1,t$1,o$1,r$1={},e$1=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/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(n,l,u){var i,t=arguments,o={};for(i in l)"key"!==i&&"ref"!==i&&(o[i]=l[i]);if(arguments.length>3)for(u=[u],i=3;i<arguments.length;i++)u.push(t[i]);if(null!=u&&(o.children=u),"function"==typeof n&&null!=n.defaultProps)for(i in n.defaultProps)void 0===o[i]&&(o[i]=n.defaultProps[i]);return v$1(n,o,l&&l.key,l&&l.ref)}function v$1(l,u,i,t){var o={type:l,props:u,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__d:null,__c:null,constructor:void 0};return n.vnode&&n.vnode(o),o}function y$1(n){return n.children}function d(n,l){this.props=n,this.context=l;}function m$1(n,l){if(null==l)return n.__?m$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.__e;return "function"==typeof n.type?m$1(n):null}function w(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 w(n)}}function g$1(l){(!l.__d&&(l.__d=!0)&&1===u$1.push(l)||t$1!==n.debounceRendering)&&((t$1=n.debounceRendering)||i$1)(k);}function k(){var n,l,i,t,o,f,r;for(u$1.sort(function(n,l){return l.__v.__b-n.__v.__b});n=u$1.pop();)n.__d&&(i=void 0,t=void 0,f=(o=(l=n).__v).__e,(r=l.__P)&&(i=[],t=T(r,o,s({},o),l.__n,void 0!==r.ownerSVGElement,null,i,null==f?m$1(o):f),$(i,o),t!=f&&w(o)));}function _$1(n,l,u,i,t,o,f,c,s){var h,v,p,y,d,w,g,k=u&&u.__k||e$1,_=k.length;if(c==r$1&&(c=null!=o?o[0]:_?m$1(u,0):null),h=0,l.__k=b(l.__k,function(u){if(null!=u){if(u.__=l,u.__b=l.__b+1,null===(p=k[h])||p&&u.key==p.key&&u.type===p.type)k[h]=void 0;else for(v=0;v<_;v++){if((p=k[v])&&u.key==p.key&&u.type===p.type){k[v]=void 0;break}p=null;}if(y=T(n,u,p=p||r$1,i,t,o,f,c,s),(v=u.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,u),g.push(v,u.__c||y,u)),null!=y){if(null==w&&(w=y),null!=u.__d)y=u.__d,u.__d=null;else if(o==p||y!=c||null==y.parentNode){n:if(null==c||c.parentNode!==n)n.appendChild(y);else {for(d=c,v=0;(d=d.nextSibling)&&v<_;v+=2)if(d==y)break n;n.insertBefore(y,c);}"option"==l.type&&(n.value="");}c=y.nextSibling,"function"==typeof l.type&&(l.__d=y);}}return h++,u}),l.__e=w,null!=o&&"function"!=typeof l.type)for(h=o.length;h--;)null!=o[h]&&a$1(o[h]);for(h=_;h--;)null!=k[h]&&A(k[h],k[h]);if(g)for(h=0;h<g.length;h++)z(g[h],g[++h],g[++h]);}function b(n,l,u){if(null==u&&(u=[]),null==n||"boolean"==typeof n)l&&u.push(l(null));else if(Array.isArray(n))for(var i=0;i<n.length;i++)b(n[i],l,u);else u.push(l?l("string"==typeof n||"number"==typeof n?v$1(null,n,null,null):null!=n.__e||null!=n.__c?v$1(n.type,n.props,n.key,null):n):n);return u}function x$1(n,l,u,i,t){var o;for(o in u)o in l||P(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"value"===o||"checked"===o||u[o]===l[o]||P(n,o,l[o],u[o],i);}function C(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]="number"==typeof u&&!1===c$1.test(l)?u+"px":null==u?"":u;}function P(n,l,u,i,t){var o,f,r,e,c;if(t?"className"===l&&(l="class"):"class"===l&&(l="className"),"key"===l||"children"===l);else if("style"===l)if(o=n.style,"string"==typeof u)o.cssText=u;else {if("string"==typeof i&&(o.cssText="",i=null),i)for(f in i)u&&f in u||C(o,f,"");if(u)for(r in u)i&&u[r]===i[r]||C(o,r,u[r]);}else "o"===l[0]&&"n"===l[1]?(e=l!==(l=l.replace(/Capture$/,"")),c=l.toLowerCase(),l=(c in n?c:l).slice(2),u?(i||n.addEventListener(l,N,e),(n.l||(n.l={}))[l]=u):n.removeEventListener(l,N,e)):"list"!==l&&"tagName"!==l&&"form"!==l&&"type"!==l&&!t&&l in n?n[l]=null==u?"":u:"function"!=typeof u&&"dangerouslySetInnerHTML"!==l&&(l!==(l=l.replace(/^xlink:?/,""))?null==u||!1===u?n.removeAttributeNS("http://www.w3.org/1999/xlink",l.toLowerCase()):n.setAttributeNS("http://www.w3.org/1999/xlink",l.toLowerCase(),u):null==u||!1===u?n.removeAttribute(l):n.setAttribute(l,u));}function N(l){this.l[l.type](n.event?n.event(l):l);}function T(l,u,i,t,o,f,r,e,c){var a,h,v,p,m,w,g,k,x,C,P=u.type;if(void 0!==u.constructor)return null;(a=n.__b)&&a(u);try{n:if("function"==typeof P){if(k=u.props,x=(a=P.contextType)&&t[a.__c],C=a?x?x.props.value:a.__:t,i.__c?g=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(k,C):(u.__c=h=new d(k,C),h.constructor=P,h.render=D),x&&x.sub(h),h.props=k,h.state||(h.state={}),h.context=C,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,P.getDerivedStateFromProps(k,h.__s))),p=h.props,m=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&k!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(k,C),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(k,h.__s,C)){for(h.props=k,h.state=h.__s,h.__d=!1,h.__v=u,u.__e=i.__e,u.__k=i.__k,h.__h.length&&r.push(h),a=0;a<u.__k.length;a++)u.__k[a]&&(u.__k[a].__=u);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(k,h.__s,C),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(p,m,w);});}h.context=C,h.props=k,h.state=h.__s,(a=n.__r)&&a(u),h.__d=!1,h.__v=u,h.__P=l,a=h.render(h.props,h.state,h.context),u.__k=b(null!=a&&a.type==y$1&&null==a.key?a.props.children:a),null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(w=h.getSnapshotBeforeUpdate(p,m)),_$1(l,u,i,t,o,f,r,e,c),h.base=u.__e,h.__h.length&&r.push(h),g&&(h.__E=h.__=null),h.__e=null;}else u.__e=j(i.__e,u,i,t,o,f,r,c);(a=n.diffed)&&a(u);}catch(l){n.__e(l,u,i);}return u.__e}function $(l,u){n.__c&&n.__c(u,l),l.some(function(u){try{l=u.__h,u.__h=[],l.some(function(n){n.call(u);});}catch(l){n.__e(l,u.__v);}});}function j(n,l,u,i,t,o,f,c){var s,a,h,v,p,y=u.props,d=l.props;if(t="svg"===l.type||t,null==n&&null!=o)for(s=0;s<o.length;s++)if(null!=(a=o[s])&&(null===l.type?3===a.nodeType:a.localName===l.type)){n=a,o[s]=null;break}if(null==n){if(null===l.type)return document.createTextNode(d);n=t?document.createElementNS("http://www.w3.org/2000/svg",l.type):document.createElement(l.type),o=null;}if(null===l.type)null!=o&&(o[o.indexOf(n)]=null),y!==d&&(n.data=d);else if(l!==u){if(null!=o&&(o=e$1.slice.call(n.childNodes)),h=(y=u.props||r$1).dangerouslySetInnerHTML,v=d.dangerouslySetInnerHTML,!c){if(y===r$1)for(y={},p=0;p<n.attributes.length;p++)y[n.attributes[p].name]=n.attributes[p].value;(v||h)&&(v&&h&&v.__html==h.__html||(n.innerHTML=v&&v.__html||""));}x$1(n,d,y,t,c),l.__k=l.props.children,v||_$1(n,l,u,i,"foreignObject"!==l.type&&t,o,f,r$1,c),c||("value"in d&&void 0!==d.value&&d.value!==n.value&&(n.value=null==d.value?"":d.value),"checked"in d&&void 0!==d.checked&&d.checked!==n.checked&&(n.checked=d.checked));}return n}function z(l,u,i){try{"function"==typeof l?l(u):l.current=u;}catch(l){n.__e(l,i);}}function A(l,u,i){var t,o,f;if(n.unmount&&n.unmount(l),(t=l.ref)&&z(t,null,u),i||"function"==typeof l.type||(i=null!=(o=l.__e)),l.__e=l.__d=null,null!=(t=l.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(l){n.__e(l,u);}t.base=t.__P=null;}if(t=l.__k)for(f=0;f<t.length;f++)t[f]&&A(t[f],u,i);null!=o&&a$1(o);}function D(n,l,u){return this.constructor(n,u)}function E(l,u,i){var t,f,c;n.__&&n.__(l,u),f=(t=i===o$1)?null:i&&i.__k||u.__k,l=h(y$1,null,[l]),c=[],T(u,(t?u:i||u).__k=l,f||r$1,r$1,void 0!==u.ownerSVGElement,i&&!t?[i]:f?null:e$1.slice.call(u.childNodes),c,i||r$1,t),$(c,l);}n={__e:function(n,l){for(var u;l=l.__;)if((u=l.__c)&&!u.__)try{if(u.constructor&&null!=u.constructor.getDerivedStateFromError)u.setState(u.constructor.getDerivedStateFromError(n));else {if(null==u.componentDidCatch)continue;u.componentDidCatch(n);}return g$1(u.__E=u)}catch(l){n=l;}throw n}},d.prototype.setState=function(n,l){var u;u=this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof n&&(n=n(u,this.props)),n&&s(u,n),null!=n&&this.__v&&(this.__e=!1,l&&this.__h.push(l),g$1(this));},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),g$1(this));},d.prototype.render=y$1,u$1=[],i$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o$1=r$1;
|
|
16
16
|
|
|
17
|
-
var t
|
|
17
|
+
var t,u,r,i=[],o=n.__r,f=n.diffed,c=n.__c,e=n.unmount;function a(t){n.__h&&n.__h(u);var r=u.__H||(u.__H={t:[],u:[]});return t>=r.t.length&&r.t.push({}),r.t[t]}function v(n){return m(x$2,n)}function m(n,r,i){var o=a(t++);return o.__c||(o.__c=u,o.i=[i?i(r):x$2(void 0,r),function(t){var u=n(o.i[0],t);o.i[0]!==u&&(o.i[0]=u,o.__c.setState({}));}]),o.i}function p(n,r){var i=a(t++);q(i.o,r)&&(i.i=n,i.o=r,u.__H.u.push(i));}function y$2(n,u){var r=a(t++);return q(r.o,u)?(r.o=u,r.v=n,r.i=n()):r.i}function F(){i.some(function(n){n.__P&&(n.__H.u.forEach(_),n.__H.u.forEach(g),n.__H.u=[]);}),i=[];}function _(n){n.m&&n.m();}function g(n){var t=n.i();"function"==typeof t&&(n.m=t);}function q(n,t){return !n||t.some(function(t,u){return t!==n[u]})}function x$2(n,t){return "function"==typeof t?t(n):t}n.__r=function(n){o&&o(n),t=0,(u=n.__c).__H&&(u.__H.u.forEach(_),u.__H.u.forEach(g),u.__H.u=[]);},n.diffed=function(t){f&&f(t);var u=t.__c;if(u){var o=u.__H;o&&o.u.length&&(1!==i.push(u)&&r===n.requestAnimationFrame||((r=n.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);"undefined"!=typeof window&&(t=requestAnimationFrame(u));})(F));}},n.__c=function(n,t){t.some(function(n){n.__h.forEach(_),n.__h=n.__h.filter(function(n){return !n.i||g(n)});}),c&&c(n,t);},n.unmount=function(n){e&&e(n);var t=n.__c;if(t){var u=t.__H;u&&u.t.forEach(function(n){return n.m&&n.m()});}};
|
|
18
18
|
|
|
19
19
|
var index_es6 = /*#__PURE__*/Object.freeze({
|
|
20
20
|
__proto__: null,
|
|
21
|
-
BUILD_VERSION: BUILD_VERSION
|
|
21
|
+
BUILD_VERSION: BUILD_VERSION,
|
|
22
22
|
Component: d,
|
|
23
|
-
Fragment: y,
|
|
24
|
-
PKG_NAME: PKG_NAME
|
|
25
|
-
PKG_VERSION: PKG_VERSION
|
|
23
|
+
Fragment: y$1,
|
|
24
|
+
PKG_NAME: PKG_NAME,
|
|
25
|
+
PKG_VERSION: PKG_VERSION,
|
|
26
26
|
createElement: h,
|
|
27
27
|
h: h,
|
|
28
28
|
render: E,
|
|
29
29
|
useEffect: p,
|
|
30
|
-
useMemo: y$
|
|
31
|
-
useReducer: m
|
|
32
|
-
useState: v
|
|
30
|
+
useMemo: y$2,
|
|
31
|
+
useReducer: m,
|
|
32
|
+
useState: v
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
var pi = Math.PI,
|
|
@@ -199,17 +199,17 @@
|
|
|
199
199
|
return new Linear(context);
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
function x
|
|
202
|
+
function x(p) {
|
|
203
203
|
return p[0];
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
function y
|
|
206
|
+
function y(p) {
|
|
207
207
|
return p[1];
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
function d3Line() {
|
|
211
|
-
var x = x
|
|
212
|
-
y = y
|
|
211
|
+
var x$1 = x,
|
|
212
|
+
y$1 = y,
|
|
213
213
|
defined = constant(true),
|
|
214
214
|
context = null,
|
|
215
215
|
curve = curveLinear,
|
|
@@ -229,18 +229,18 @@
|
|
|
229
229
|
if (defined0 = !defined0) output.lineStart();
|
|
230
230
|
else output.lineEnd();
|
|
231
231
|
}
|
|
232
|
-
if (defined0) output.point(+x(d, i, data), +y(d, i, data));
|
|
232
|
+
if (defined0) output.point(+x$1(d, i, data), +y$1(d, i, data));
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
if (buffer) return output = null, buffer + "" || null;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
line.x = function(_) {
|
|
239
|
-
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), line) : x;
|
|
239
|
+
return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant(+_), line) : x$1;
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
line.y = function(_) {
|
|
243
|
-
return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), line) : y;
|
|
243
|
+
return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant(+_), line) : y$1;
|
|
244
244
|
};
|
|
245
245
|
|
|
246
246
|
line.defined = function(_) {
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
|
|
336
336
|
var ImageChar = function (_a) {
|
|
337
337
|
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;
|
|
338
|
-
return h("text", { x: x, y: y, fill: fill, stroke: stroke, "font-family": fontFamily, "font-size": height
|
|
338
|
+
return h("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;" }, fontFamily === "FontAwesome" ? common.Utility.faChar(char) : char);
|
|
339
339
|
};
|
|
340
340
|
|
|
341
341
|
/*! *****************************************************************************
|
|
@@ -416,7 +416,7 @@
|
|
|
416
416
|
|
|
417
417
|
var Icon = function (_a) {
|
|
418
418
|
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 ? common.Palette.textColor(fill) : _g, _h = _a.padding, padding = _h === void 0 ? height / 5 : _h, _j = _a.yOffset, yOffset = _j === void 0 ? 0 : _j, cornerRadius = _a.cornerRadius, shapeRendering = _a.shapeRendering;
|
|
419
|
-
return h(y, null,
|
|
419
|
+
return h(y$1, null,
|
|
420
420
|
h(Shape, { shape: shape, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shapeRendering: shapeRendering, cornerRadius: cornerRadius }),
|
|
421
421
|
h(ImageChar, { y: yOffset, height: height - padding, fontFamily: imageFontFamily, char: imageChar, fill: imageCharFill, "font-weight": 400 }));
|
|
422
422
|
};
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
return h("g", { key: cat.id, id: cat.id },
|
|
427
427
|
h(Icon, __assign({}, cat)));
|
|
428
428
|
});
|
|
429
|
-
return h(y, null, IconComponents);
|
|
429
|
+
return h(y$1, null, IconComponents);
|
|
430
430
|
};
|
|
431
431
|
|
|
432
432
|
function render(C, props, parent, replaceNode) {
|
|
@@ -498,12 +498,12 @@
|
|
|
498
498
|
|
|
499
499
|
var TextLine = function (_a) {
|
|
500
500
|
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;
|
|
501
|
-
return h("text", { "font-family": fontFamily, "font-size": height
|
|
501
|
+
return h("text", { "font-family": fontFamily, "font-size": "".concat(height, "px"), "text-anchor": anchor, "dominant-baseline": baseline, fill: fill }, text);
|
|
502
502
|
};
|
|
503
503
|
var Text = function (_a) {
|
|
504
504
|
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, _e = _a.onSizeUpdate, onSizeUpdate = _e === void 0 ? function (size) { } : _e;
|
|
505
|
-
var _f = v
|
|
506
|
-
var _g = v
|
|
505
|
+
var _f = v(0), totalWidth = _f[0], onTotalWidthUpdate = _f[1];
|
|
506
|
+
var _g = v(0), totalHeight = _g[0], onTotalHeightUpdate = _g[1];
|
|
507
507
|
p(function () { return onSizeUpdate({ width: totalWidth, height: totalHeight }); }, [totalWidth, totalHeight]);
|
|
508
508
|
var parts = text.split("\n");
|
|
509
509
|
var ts = common.Utility.textSize(parts, fontFamily, height);
|
|
@@ -511,22 +511,22 @@
|
|
|
511
511
|
onTotalHeightUpdate(parts.length * (height + 2) - 2);
|
|
512
512
|
var yOffset = -(totalHeight / 2) + (height / 2);
|
|
513
513
|
var TextLines = parts.map(function (p, i) {
|
|
514
|
-
return h("g", { transform: "translate(0 "
|
|
514
|
+
return h("g", { transform: "translate(0 ".concat(yOffset + i * (height + 2), ")") },
|
|
515
515
|
h(TextLine, { text: p, height: height, fontFamily: fontFamily, fill: fill }));
|
|
516
516
|
});
|
|
517
|
-
return h(y, null, TextLines);
|
|
517
|
+
return h(y$1, null, TextLines);
|
|
518
518
|
};
|
|
519
519
|
var TextBox = function (_a) {
|
|
520
520
|
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, _k = _a.onSizeUpdate, onSizeUpdate = _k === void 0 ? function (size) { } : _k;
|
|
521
|
-
var _l = v
|
|
522
|
-
var _m = v
|
|
521
|
+
var _l = v(0), textWidth = _l[0], onTextWidthUpdate = _l[1];
|
|
522
|
+
var _m = v(0), textHeight = _m[0], onTextHeightUpdate = _m[1];
|
|
523
523
|
p(function () { return onSizeUpdate({ width: textWidth, height: textHeight }); }, [textWidth, textHeight]);
|
|
524
524
|
var w = textWidth + padding * 2 + strokeWidth;
|
|
525
525
|
var h$1 = textHeight + padding * 2 + strokeWidth;
|
|
526
526
|
var textOffsetY = Math.floor(height / 10);
|
|
527
|
-
return h(y, null,
|
|
527
|
+
return h(y$1, null,
|
|
528
528
|
h(Rectangle, { width: w, height: h$1, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
529
|
-
h("g", { transform: "translate(0 "
|
|
529
|
+
h("g", { transform: "translate(0 ".concat(textOffsetY, ")") },
|
|
530
530
|
h(Text, { text: text, fontFamily: fontFamily, height: height, fill: textFill, onSizeUpdate: onTextSizeUpdate })));
|
|
531
531
|
function onTextSizeUpdate(size) {
|
|
532
532
|
onTextWidthUpdate(size.width);
|
|
@@ -534,32 +534,32 @@
|
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
536
|
var LabelledRect = function (_a) {
|
|
537
|
-
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
|
|
538
|
-
return h(y, null,
|
|
537
|
+
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;
|
|
538
|
+
return h(y$1, null,
|
|
539
539
|
h(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
540
|
-
h("g", { transform: "translate("
|
|
540
|
+
h("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
541
541
|
h(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
542
542
|
};
|
|
543
543
|
var IconLabelledRect = function (_a) {
|
|
544
|
-
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
|
|
545
|
-
return h(y, null,
|
|
544
|
+
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;
|
|
545
|
+
return h(y$1, null,
|
|
546
546
|
h(Rectangle, { width: width, height: height, fill: fill, stroke: stroke, strokeWidth: strokeWidth, cornerRadius: cornerRadius }),
|
|
547
|
-
h("g", { transform: "translate("
|
|
547
|
+
h("g", { transform: "translate(".concat(-(width / 2) + padding, " ").concat(-(height / 2) + padding, ")") },
|
|
548
548
|
h(Icon, { shape: "square", imageFontFamily: iconFontFamily, imageChar: icon, height: height, fill: fill, imageCharFill: textFill })),
|
|
549
|
-
h("g", { transform: "translate("
|
|
549
|
+
h("g", { transform: "translate(".concat(-(width / 2) + (padding * 2) + height, " ").concat(-(height / 2) + padding, ")") },
|
|
550
550
|
h(TextLine, { text: text, fontFamily: fontFamily, height: fontSize, fill: textFill, anchor: "start", baseline: "hanging" })));
|
|
551
551
|
};
|
|
552
552
|
|
|
553
553
|
var Annotations = function (_a) {
|
|
554
|
-
var x = _a.x, y
|
|
555
|
-
var IconComponents = annotationIDs.map(function (id, i) { return h("g", { key: id, transform: "translate("
|
|
554
|
+
var x = _a.x, y = _a.y, _b = _a.annotationIDs, annotationIDs = _b === void 0 ? [] : _b, _c = _a.stepSize, stepSize = _c === void 0 ? -16 : _c;
|
|
555
|
+
var IconComponents = annotationIDs.map(function (id, i) { return h("g", { key: id, transform: "translate(".concat(x + i * stepSize, " ").concat(y, ")") },
|
|
556
556
|
h("use", { href: "#" + id })); });
|
|
557
|
-
return h(y, null, IconComponents);
|
|
557
|
+
return h(y$1, null, IconComponents);
|
|
558
558
|
};
|
|
559
559
|
var Vertex = function (_a) {
|
|
560
560
|
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, _j = _a.onSizeUpdate, onSizeUpdate = _j === void 0 ? function (size) { } : _j, _k = _a.showLabel, showLabel = _k === void 0 ? true : _k;
|
|
561
|
-
var _l = v
|
|
562
|
-
var _m = v
|
|
561
|
+
var _l = v(0), textBoxWidth = _l[0], onTextBoxWidthUpdate = _l[1];
|
|
562
|
+
var _m = v(0), textBoxHeight = _m[0], onTextBoxHeightUpdate = _m[1];
|
|
563
563
|
p(function () { return onSizeUpdate({ width: 0, height: 0 }); }, [textBoxWidth, textBoxHeight]);
|
|
564
564
|
icon = __assign({ imageChar: "fa-question", height: 32, fill: "transparent" }, icon);
|
|
565
565
|
var width = textBoxWidth;
|
|
@@ -571,14 +571,14 @@
|
|
|
571
571
|
offsetY += (textHeight + 8) / 2;
|
|
572
572
|
annotationOffsetY -= textBoxHeight + textPadding;
|
|
573
573
|
}
|
|
574
|
-
var label = showLabel ? h("g", { transform: "translate(0 "
|
|
574
|
+
var label = showLabel ? h("g", { transform: "translate(0 ".concat(textboxOffsetY, ")") },
|
|
575
575
|
h(TextBox, { text: text, height: textHeight, padding: textPadding, onSizeUpdate: onTextBoxSizeUpdate, textFill: textFill, fill: textboxFill, stroke: textboxStroke, fontFamily: textFontFamily })) : undefined;
|
|
576
576
|
return categoryID ?
|
|
577
|
-
h("g", { transform: "translate(0 "
|
|
577
|
+
h("g", { transform: "translate(0 ".concat(offsetY, ")") },
|
|
578
578
|
h("use", { href: "#" + categoryID }),
|
|
579
579
|
label,
|
|
580
580
|
h(Annotations, { x: width / 2, y: annotationOffsetY, annotationIDs: annotationIDs })) :
|
|
581
|
-
h("g", { transform: "translate(0 "
|
|
581
|
+
h("g", { transform: "translate(0 ".concat(offsetY, ")") },
|
|
582
582
|
h(Icon, __assign({}, icon)),
|
|
583
583
|
label);
|
|
584
584
|
function onTextBoxSizeUpdate(size) {
|
|
@@ -604,22 +604,22 @@
|
|
|
604
604
|
var annotationOffsetX = stepSize / 2;
|
|
605
605
|
var annotationOffsetY = halfTextboxHeight;
|
|
606
606
|
return categoryID ?
|
|
607
|
-
h("g", { transform: "translate("
|
|
608
|
-
h("g", { transform: "translate("
|
|
607
|
+
h("g", { transform: "translate(".concat(offsetX, " ").concat(offsetY, ")") },
|
|
608
|
+
h("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
609
609
|
h("use", { href: "#" + categoryID })),
|
|
610
|
-
h("g", { transform: "translate("
|
|
610
|
+
h("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")") },
|
|
611
611
|
h(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily })),
|
|
612
612
|
h(Annotations, { x: annotationOffsetX, y: annotationOffsetY, annotationIDs: annotationIDs, stepSize: stepSize }))
|
|
613
613
|
:
|
|
614
|
-
h(y, null,
|
|
615
|
-
h("g", { transform: "translate("
|
|
614
|
+
h(y$1, null,
|
|
615
|
+
h("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")scale(1.0002)") },
|
|
616
616
|
h(Icon, __assign({}, icon, { shape: "square" }))),
|
|
617
|
-
h("g", { transform: "translate("
|
|
617
|
+
h("g", { transform: "translate(".concat(textboxOffsetX, " ").concat(textboxOffsetY, ")scale(1.0002)") },
|
|
618
618
|
h(TextBox, { text: text, height: textHeight, padding: textPadding, stroke: textboxStroke, fill: textboxFill })));
|
|
619
619
|
};
|
|
620
620
|
|
|
621
621
|
var Vertex3 = function (_a) {
|
|
622
|
-
|
|
622
|
+
_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;
|
|
623
623
|
icon = __assign({ height: 50, imageChar: "?", imageFontFamily: "FontAwesome", imageCharFill: "#555555", fill: "transparent", strokeWidth: 0 }, icon);
|
|
624
624
|
subText = __assign({ text: "", fill: "white", textFill: "#555555" }, subText);
|
|
625
625
|
var fullAnnotationWidth = 0;
|
|
@@ -638,13 +638,13 @@
|
|
|
638
638
|
var annoShapeWidth = textShapeHeight;
|
|
639
639
|
fullAnnotationWidth += annoShapeWidth + annotationGutter;
|
|
640
640
|
var annoOffsetX = fullAnnotationWidth - (annoShapeWidth / 2);
|
|
641
|
-
annotationArr.push(h("g", { class: "vertex3-anno", transform: "translate("
|
|
641
|
+
annotationArr.push(h("g", { class: "vertex3-anno", transform: "translate(".concat(annoOffsetX, " ").concat(annoOffsetY, ")") },
|
|
642
642
|
h(Icon, __assign({}, anno, { shape: "square", height: textShapeHeight, imageChar: annoText, imageFontFamily: anno.imageFontFamily, cornerRadius: cornerRadius, strokeWidth: 0 }))));
|
|
643
643
|
});
|
|
644
644
|
if (annotations.length > 0) {
|
|
645
645
|
fullAnnotationWidth += annotationGutter * (annotations.length - 1);
|
|
646
646
|
}
|
|
647
|
-
var textElement = h("g", { transform: "translate("
|
|
647
|
+
var textElement = h("g", { transform: "translate(".concat(textOffsetX, " ").concat(annoOffsetY, ")") }, !showLabel || text === "" ? h("circle", { r: noLabelRadius, stroke: textboxStroke, fill: textFill }) : h(TextBox, { text: text, height: textHeight, padding: textPadding, strokeWidth: textboxStrokeWidth, stroke: textboxStroke, fill: textboxFill, textFill: textFill, fontFamily: textFontFamily, cornerRadius: cornerRadius }));
|
|
648
648
|
var iconHeight = icon.height || 20;
|
|
649
649
|
var iconStrokeWidth = icon.strokeWidth || 0;
|
|
650
650
|
var iconOffsetX = 0;
|
|
@@ -657,12 +657,12 @@
|
|
|
657
657
|
else if (subText.text !== "") {
|
|
658
658
|
subTextOffsetY = (iconHeight / 2) + iconStrokeWidth + (annotationGutter * 2);
|
|
659
659
|
}
|
|
660
|
-
var subtextElement = subText.text === "" ? null : h("g", { transform: "translate("
|
|
660
|
+
var subtextElement = subText.text === "" ? null : h("g", { transform: "translate(".concat(subTextOffsetX, " ").concat(subTextOffsetY, ")") },
|
|
661
661
|
h(TextBox, __assign({ fill: subText.fill || "#FFFFFF", textFill: subText.textFill || textFill }, subText, { height: textHeight, padding: textPadding, strokeWidth: 0, stroke: textboxStroke, fontFamily: textFontFamily, cornerRadius: cornerRadius })));
|
|
662
662
|
return h("g", null,
|
|
663
|
-
h("g", { transform: "translate("
|
|
663
|
+
h("g", { transform: "translate(".concat(iconOffsetX, " ").concat(iconOffsetY, ")") },
|
|
664
664
|
h(Icon, __assign({}, icon))),
|
|
665
|
-
h("g", { transform: "translate("
|
|
665
|
+
h("g", { transform: "translate(".concat(-fullAnnotationWidth / 2, " ").concat(annoOffsetY, ")") },
|
|
666
666
|
textElement,
|
|
667
667
|
annotationArr),
|
|
668
668
|
subtextElement);
|
|
@@ -693,14 +693,14 @@
|
|
|
693
693
|
var Subgraph = function (_a) {
|
|
694
694
|
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;
|
|
695
695
|
var tSize = common.Utility.textSize(text, fontFamily, fontHeight, false);
|
|
696
|
-
return h(y, null,
|
|
696
|
+
return h(y$1, null,
|
|
697
697
|
h(Rectangle, { width: width, height: height, fill: fill, stroke: stroke }),
|
|
698
|
-
h("g", { transform: "translate("
|
|
698
|
+
h("g", { transform: "translate(".concat((-width + tSize.width) / 2 + 4, " ").concat((-height + tSize.height) / 2 + 4, ")") },
|
|
699
699
|
h(Text, { height: fontHeight, text: text, fontFamily: fontFamily })));
|
|
700
700
|
};
|
|
701
701
|
|
|
702
702
|
exports.Annotations = Annotations;
|
|
703
|
-
exports.BUILD_VERSION = BUILD_VERSION;
|
|
703
|
+
exports.BUILD_VERSION = BUILD_VERSION$1;
|
|
704
704
|
exports.CentroidVertex3 = CentroidVertex3;
|
|
705
705
|
exports.Circle = Circle;
|
|
706
706
|
exports.Edge = Edge;
|
|
@@ -710,8 +710,8 @@
|
|
|
710
710
|
exports.Icons = Icons;
|
|
711
711
|
exports.ImageChar = ImageChar;
|
|
712
712
|
exports.LabelledRect = LabelledRect;
|
|
713
|
-
exports.PKG_NAME = PKG_NAME;
|
|
714
|
-
exports.PKG_VERSION = PKG_VERSION;
|
|
713
|
+
exports.PKG_NAME = PKG_NAME$1;
|
|
714
|
+
exports.PKG_VERSION = PKG_VERSION$1;
|
|
715
715
|
exports.React = index_es6;
|
|
716
716
|
exports.Rectangle = Rectangle;
|
|
717
717
|
exports.SVGAdapter = SVGAdapter;
|
|
@@ -729,5 +729,5 @@
|
|
|
729
729
|
|
|
730
730
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
731
731
|
|
|
732
|
-
}))
|
|
732
|
+
}));
|
|
733
733
|
//# sourceMappingURL=index.js.map
|