@hpcc-js/api 3.4.5 → 3.4.7
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.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var t=Object.defineProperty,o=(o,e)=>t(o,"name",{value:e,configurable:!0});import{Palette as e,hsl as l,Widget as i,map as n,selection as r,select as p,format as s}from"@hpcc-js/common";const a="@hpcc-js/api",u="3.4.5",c="3.18.0";function f(){}function h(){}function y(){}function d(){}function b(t){return"function"==typeof t.highlightColumn}function m(){}function g(){}function v(){let t=h,e=y,l=d,i=I(document.body),s=E(),a=null,u=null,c=null;const f=/* @__PURE__ */o(function(t){if(a=T(t),!a)return;u=a.createSVGPoint();const o=i();o&&s&&o.appendChild(s)},"tip2");function h(){return"n"}function y(){return[0,0]}function d(){return" "}f.show=function(t,o,n){c=n[o];const r=Array.prototype.slice.call(arguments),p=l.apply(this,r);if(null===p)return f;const s=e.apply(this,r),a=V();let u,h=m.length;const y=i().getBoundingClientRect();for(a.html(p).style("opacity",1).style("pointer-events","all");h--;)a.classed(m[h],!1);let d=!1;const g={};let v=m[0];for(let e=0;e<m.length&&(d=C(m[e]),!d);e++);if(d)a.classed("notick",!1);else{a.classed("notick",!0);const t=w(g[v]),o=x(g[v]);C(v,t,o)}return f;function x(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function w(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function C(t,o,e){o=o||0,e=e||0,a.style("white-space","nowrap"),u=b.get(t).apply(this),a.classed(t,!0).style("top",u.top+s[0]-o+"px").style("left",u.left+s[1]-e+"px");const l=a.node().getBoundingClientRect(),i=l.top>y.top&&l.left>y.left&&l.bottom<y.bottom&&l.right<y.right;return g[t]={top:y.top-l.top,right:l.right-y.right,bottom:l.bottom-y.bottom,left:y.left-l.left},a.style("white-space","normal"),g[t].total_overflow=Object.keys(g[t]).filter(o=>g[t][o]>0).reduce((o,e)=>o+g[t][e],0),g[v].total_overflow>g[t].total_overflow&&(v=t),i||a.classed(t,!1),i}},f.hide=function(){return V().style("opacity",0).style("pointer-events","none"),f},f.attr=function(t,o){if(arguments.length<2&&"string"==typeof t)return V().attr(t);const e=Array.prototype.slice.call(arguments);return r.prototype.attr.apply(V(),e),f},f.style=function(t,o){if(arguments.length<2&&"string"==typeof t)return V().style(t);const e=Array.prototype.slice.call(arguments);return r.prototype.style.apply(V(),e),f},f.direction=function(o){return arguments.length?(t=null==o?o:I(o),f):t},f.offset=function(t){return arguments.length?(e=null==t?t:I(t),f):e},f.html=function(t){return arguments.length?(l=null==t?t:I(t),f):l},f.rootElement=function(t){return arguments.length?(i=I(t),f):i},f.destroy=function(){return s&&(V().remove(),s=null),f},o(h,"d3TipDirection"),o(y,"d3TipOffset"),o(d,"d3TipHTML");const b=n({n:g,s:v,e:x,w:w,nw:C,ne:_,sw:k,se:F}),m=b.keys();function g(){const t=S(window);return{top:t.n.y-s.offsetHeight,left:t.n.x-s.offsetWidth/2}}function v(){const t=S(window);return{top:t.s.y+8,left:t.s.x-s.offsetWidth/2}}function x(){const t=S(window);return{top:t.e.y-s.offsetHeight/2,left:t.e.x+8}}function w(){const t=S(window);return{top:t.w.y-s.offsetHeight/2,left:t.w.x-s.offsetWidth-8}}function C(){const t=S(window);return{top:t.nw.y-s.offsetHeight,left:t.nw.x-s.offsetWidth}}function _(){const t=S(window);return{top:t.ne.y-s.offsetHeight,left:t.ne.x}}function k(){const t=S(window);return{top:t.sw.y,left:t.sw.x-s.offsetWidth}}function F(){const t=S(window);return{top:t.se.y,left:t.se.x}}function E(){const t=p(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function T(t){const o=t.node();return o?"svg"===o.tagName.toLowerCase()?o:o.ownerSVGElement:null}function V(){return null==s&&(s=E(),i().appendChild(s)),p(s)}function S(t){let o=c||t;for(;null==o.getCTM&&null!=o.parentNode;)o=o.parentNode;const e={},l=o.getCTM(),i=o.getBBox(),n=i.width,r=i.height,p=i.x,s=i.y;return u.x=p,u.y=s,e.nw=u.matrixTransform(l),u.x+=n,e.ne=u.matrixTransform(l),u.y+=r,e.se=u.matrixTransform(l),u.x-=n,e.sw=u.matrixTransform(l),u.y-=r/2,e.w=u.matrixTransform(l),u.x+=n,e.e=u.matrixTransform(l),u.x-=n/2,u.y-=r/2,e.n=u.matrixTransform(l),u.y+=r,e.s=u.matrixTransform(l),e}function I(t){return"function"==typeof t?t:function(){return t}}return o(g,"directionNorth"),o(v,"directionSouth"),o(x,"directionEast"),o(w,"directionWest"),o(C,"directionNorthWest"),o(_,"directionNorthEast"),o(k,"directionSouthWest"),o(F,"directionSouthEast"),o(E,"initNode"),o(T,"getSVGNode"),o(V,"getNodeEl"),o(S,"getScreenBBox"),o(I,"functor"),f}function x(){if(this.tooltip=v(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=s(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=s(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(o,e,l){this._parentOverlay||(this._parentOverlay=o._parentOverlay),this.tooltipEnter(e),t.apply(this,arguments)};const o=this.layerUpdate;this.layerUpdate=function(t){o.apply(this,arguments),this.tooltipUpdate()};const e=this.layerExit;this.layerExit=function(t){this.tooltipExit(),e.apply(this,arguments)}}else{const t=this.enter;this.enter=function(o,e){this.tooltipEnter(e),t.apply(this,arguments)};const o=this.update;this.update=function(t,e){o.apply(this,arguments),this.tooltipUpdate()};const e=this.exit;this.exit=function(t,o){this.tooltipExit(),e.apply(this,arguments)}}}o(f,"I1DChart"),f.prototype._dataFamily="1D",f.prototype._palette=e.rainbow("default"),f.prototype.click=function(t,o,e){},f.prototype.dblclick=function(t,o,e){},o(h,"I2DChart"),h.prototype._dataFamily="2D",h.prototype._palette=e.ordinal("default"),h.prototype.fillColor=function(t,o,e,l){return this._palette(t[0])},h.prototype.strokeColor=function(t,o,e,i){return l(this.fillColor(t,o,e,i)).darker().toString()},h.prototype.textColor=function(t,o,l,i){return e.textColor(this.fillColor(t,o,l,i))},h.prototype.click=function(t,o,e){},h.prototype.dblclick=function(t,o,e){},o(y,"I2DAggrChart"),y.prototype._palette=e.rainbow("default"),y.prototype.fillColor=function(t,o,e){return this._palette(t.length)},y.prototype.strokeColor=function(t,o,e){return l(this.fillColor(t,o,e)).darker().toString()},y.prototype.textColor=function(t,o,l){return e.textColor(this.fillColor(t,o,l))},y.prototype.click=function(t,o,e){},y.prototype.dblclick=function(t,o,e){},o(d,"IGraph"),d.prototype._dataFamily="graph",d.prototype.vertex_click=function(t,o,e,l){l&&l.vertex},d.prototype.vertex_dblclick=function(t,o,e,l){l&&l.vertex},d.prototype.edge_click=function(t,o,e,l){l&&l.edge},d.prototype.edge_dblclick=function(t,o,e,l){l&&l.edge},o(b,"instanceOfIHighlight"),o(m,"IInput"),m.prototype=Object.create(i.prototype),m.prototype.constructor=m,m.prototype.isValid=function(){if(this.validate()){if(!new RegExp(this.validate()).test(this.value()))return!1}return!0},m.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},m.prototype.blur=function(t){},m.prototype.keyup=function(t){},m.prototype.focus=function(t){},m.prototype.click=function(t){},m.prototype.dblclick=function(t){},m.prototype.change=function(t,o){},m.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},m.prototype.disable=function(t){this._inputElement.forEach(function(o,e){o.attr("disabled",t?"disabled":null)})},m.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},m.prototype.publish("name","","string","HTML name for the input"),m.prototype.publish("label","","string","Descriptive label"),m.prototype.publish("value","","string","Input Current Value"),m.prototype.publish("validate",null,"string","Input Validation"),o(g,"INDChart"),g.prototype._dataFamily="ND",g.prototype._palette=e.ordinal("default"),g.prototype.fillColor=function(t,o,e,l){return this._palette(o)},g.prototype.strokeColor=function(t,o,e,i){return l(this.fillColor(t,o,e,i)).darker().toString()},g.prototype.textColor=function(t,o,l,i){return e.textColor(this.fillColor(t,o,l,i))},g.prototype.click=function(t,o,e){},g.prototype.dblclick=function(t,o,e){},o(v,"tip"),o(x,"ITooltip"),x.prototype=Object.create(i.prototype),x.prototype.constructor=x,x.prototype.tooltipEnter=function(t){const o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)},x.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},x.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},x.prototype._tooltipHTML=function(t){return t},x.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},x.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let o='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){o+="<tr>",o+="<td>",o+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',o+='<div class="series-table-row-label">'+t.label+"</div>",o+="</td>",o+='<td><div class="series-table-row-value">'+t.value+"</div></td>",o+="</tr>"}),o+="</tbody>",o+="</table>",o;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},x.prototype.tooltipKeyValueFormat=function(t,o){let e="";for(const l in o)if(l!==t){const t=o&&o[l]?o[l]:"";e+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${l}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${o[t]}</th></tr>\n </thead>\n <tbody>\n ${e}\n </tbody>\n </table>`},x.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),x.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),x.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),x.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),x.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),x.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),x.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),x.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),x.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const w=x.prototype.tooltipLabelFormat;x.prototype.tooltipLabelFormat=function(t){const o=w.apply(this,arguments);return arguments.length&&(this._labelFormatter=s(t)),o};const C=x.prototype.tooltipValueFormat;function _(){}x.prototype.tooltipValueFormat=function(t){const o=C.apply(this,arguments);return arguments.length&&(this._valueFormatter=s(t)),o},o(_,"ITree"),_.prototype.constructor=_,_.prototype.click=function(t,o,e){},_.prototype.dblclick=function(t,o,e){},_.prototype._palette=e.ordinal("default");export{c as BUILD_VERSION,f as I1DChart,y as I2DAggrChart,h as I2DChart,d as IGraph,m as IInput,g as INDChart,x as ITooltip,_ as ITree,a as PKG_NAME,u as PKG_VERSION,b as instanceOfIHighlight};
|
|
1
|
+
var t=Object.defineProperty,o=(o,e)=>t(o,"name",{value:e,configurable:!0});import{Palette as e,hsl as l,Widget as i,map as n,selection as r,select as p,format as s}from"@hpcc-js/common";const a="@hpcc-js/api",u="3.4.7",c="3.19.2";function f(){}function h(){}function y(){}function d(){}function b(t){return"function"==typeof t.highlightColumn}function m(){}function g(){}function v(){let t=h,e=y,l=d,i=I(document.body),s=E(),a=null,u=null,c=null;const f=/* @__PURE__ */o(function(t){if(a=T(t),!a)return;u=a.createSVGPoint();const o=i();o&&s&&o.appendChild(s)},"tip2");function h(){return"n"}function y(){return[0,0]}function d(){return" "}f.show=function(t,o,n){c=n[o];const r=Array.prototype.slice.call(arguments),p=l.apply(this,r);if(null===p)return f;const s=e.apply(this,r),a=V();let u,h=m.length;const y=i().getBoundingClientRect();for(a.html(p).style("opacity",1).style("pointer-events","all");h--;)a.classed(m[h],!1);let d=!1;const g={};let v=m[0];for(let e=0;e<m.length&&(d=C(m[e]),!d);e++);if(d)a.classed("notick",!1);else{a.classed("notick",!0);const t=w(g[v]),o=x(g[v]);C(v,t,o)}return f;function x(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function w(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function C(t,o,e){o=o||0,e=e||0,a.style("white-space","nowrap"),u=b.get(t).apply(this),a.classed(t,!0).style("top",u.top+s[0]-o+"px").style("left",u.left+s[1]-e+"px");const l=a.node().getBoundingClientRect(),i=l.top>y.top&&l.left>y.left&&l.bottom<y.bottom&&l.right<y.right;return g[t]={top:y.top-l.top,right:l.right-y.right,bottom:l.bottom-y.bottom,left:y.left-l.left},a.style("white-space","normal"),g[t].total_overflow=Object.keys(g[t]).filter(o=>g[t][o]>0).reduce((o,e)=>o+g[t][e],0),g[v].total_overflow>g[t].total_overflow&&(v=t),i||a.classed(t,!1),i}},f.hide=function(){return V().style("opacity",0).style("pointer-events","none"),f},f.attr=function(t,o){if(arguments.length<2&&"string"==typeof t)return V().attr(t);const e=Array.prototype.slice.call(arguments);return r.prototype.attr.apply(V(),e),f},f.style=function(t,o){if(arguments.length<2&&"string"==typeof t)return V().style(t);const e=Array.prototype.slice.call(arguments);return r.prototype.style.apply(V(),e),f},f.direction=function(o){return arguments.length?(t=null==o?o:I(o),f):t},f.offset=function(t){return arguments.length?(e=null==t?t:I(t),f):e},f.html=function(t){return arguments.length?(l=null==t?t:I(t),f):l},f.rootElement=function(t){return arguments.length?(i=I(t),f):i},f.destroy=function(){return s&&(V().remove(),s=null),f},o(h,"d3TipDirection"),o(y,"d3TipOffset"),o(d,"d3TipHTML");const b=n({n:g,s:v,e:x,w:w,nw:C,ne:_,sw:k,se:F}),m=b.keys();function g(){const t=S(window);return{top:t.n.y-s.offsetHeight,left:t.n.x-s.offsetWidth/2}}function v(){const t=S(window);return{top:t.s.y+8,left:t.s.x-s.offsetWidth/2}}function x(){const t=S(window);return{top:t.e.y-s.offsetHeight/2,left:t.e.x+8}}function w(){const t=S(window);return{top:t.w.y-s.offsetHeight/2,left:t.w.x-s.offsetWidth-8}}function C(){const t=S(window);return{top:t.nw.y-s.offsetHeight,left:t.nw.x-s.offsetWidth}}function _(){const t=S(window);return{top:t.ne.y-s.offsetHeight,left:t.ne.x}}function k(){const t=S(window);return{top:t.sw.y,left:t.sw.x-s.offsetWidth}}function F(){const t=S(window);return{top:t.se.y,left:t.se.x}}function E(){const t=p(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function T(t){const o=t.node();return o?"svg"===o.tagName.toLowerCase()?o:o.ownerSVGElement:null}function V(){return null==s&&(s=E(),i().appendChild(s)),p(s)}function S(t){let o=c||t;for(;null==o.getCTM&&null!=o.parentNode;)o=o.parentNode;const e={},l=o.getCTM(),i=o.getBBox(),n=i.width,r=i.height,p=i.x,s=i.y;return u.x=p,u.y=s,e.nw=u.matrixTransform(l),u.x+=n,e.ne=u.matrixTransform(l),u.y+=r,e.se=u.matrixTransform(l),u.x-=n,e.sw=u.matrixTransform(l),u.y-=r/2,e.w=u.matrixTransform(l),u.x+=n,e.e=u.matrixTransform(l),u.x-=n/2,u.y-=r/2,e.n=u.matrixTransform(l),u.y+=r,e.s=u.matrixTransform(l),e}function I(t){return"function"==typeof t?t:function(){return t}}return o(g,"directionNorth"),o(v,"directionSouth"),o(x,"directionEast"),o(w,"directionWest"),o(C,"directionNorthWest"),o(_,"directionNorthEast"),o(k,"directionSouthWest"),o(F,"directionSouthEast"),o(E,"initNode"),o(T,"getSVGNode"),o(V,"getNodeEl"),o(S,"getScreenBBox"),o(I,"functor"),f}function x(){if(this.tooltip=v(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=s(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=s(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(o,e,l){this._parentOverlay||(this._parentOverlay=o._parentOverlay),this.tooltipEnter(e),t.apply(this,arguments)};const o=this.layerUpdate;this.layerUpdate=function(t){o.apply(this,arguments),this.tooltipUpdate()};const e=this.layerExit;this.layerExit=function(t){this.tooltipExit(),e.apply(this,arguments)}}else{const t=this.enter;this.enter=function(o,e){this.tooltipEnter(e),t.apply(this,arguments)};const o=this.update;this.update=function(t,e){o.apply(this,arguments),this.tooltipUpdate()};const e=this.exit;this.exit=function(t,o){this.tooltipExit(),e.apply(this,arguments)}}}o(f,"I1DChart"),f.prototype._dataFamily="1D",f.prototype._palette=e.rainbow("default"),f.prototype.click=function(t,o,e){},f.prototype.dblclick=function(t,o,e){},o(h,"I2DChart"),h.prototype._dataFamily="2D",h.prototype._palette=e.ordinal("default"),h.prototype.fillColor=function(t,o,e,l){return this._palette(t[0])},h.prototype.strokeColor=function(t,o,e,i){return l(this.fillColor(t,o,e,i)).darker().toString()},h.prototype.textColor=function(t,o,l,i){return e.textColor(this.fillColor(t,o,l,i))},h.prototype.click=function(t,o,e){},h.prototype.dblclick=function(t,o,e){},o(y,"I2DAggrChart"),y.prototype._palette=e.rainbow("default"),y.prototype.fillColor=function(t,o,e){return this._palette(t.length)},y.prototype.strokeColor=function(t,o,e){return l(this.fillColor(t,o,e)).darker().toString()},y.prototype.textColor=function(t,o,l){return e.textColor(this.fillColor(t,o,l))},y.prototype.click=function(t,o,e){},y.prototype.dblclick=function(t,o,e){},o(d,"IGraph"),d.prototype._dataFamily="graph",d.prototype.vertex_click=function(t,o,e,l){l&&l.vertex},d.prototype.vertex_dblclick=function(t,o,e,l){l&&l.vertex},d.prototype.edge_click=function(t,o,e,l){l&&l.edge},d.prototype.edge_dblclick=function(t,o,e,l){l&&l.edge},o(b,"instanceOfIHighlight"),o(m,"IInput"),m.prototype=Object.create(i.prototype),m.prototype.constructor=m,m.prototype.isValid=function(){if(this.validate()){if(!new RegExp(this.validate()).test(this.value()))return!1}return!0},m.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},m.prototype.blur=function(t){},m.prototype.keyup=function(t){},m.prototype.focus=function(t){},m.prototype.click=function(t){},m.prototype.dblclick=function(t){},m.prototype.change=function(t,o){},m.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},m.prototype.disable=function(t){this._inputElement.forEach(function(o,e){o.attr("disabled",t?"disabled":null)})},m.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},m.prototype.publish("name","","string","HTML name for the input"),m.prototype.publish("label","","string","Descriptive label"),m.prototype.publish("value","","string","Input Current Value"),m.prototype.publish("validate",null,"string","Input Validation"),o(g,"INDChart"),g.prototype._dataFamily="ND",g.prototype._palette=e.ordinal("default"),g.prototype.fillColor=function(t,o,e,l){return this._palette(o)},g.prototype.strokeColor=function(t,o,e,i){return l(this.fillColor(t,o,e,i)).darker().toString()},g.prototype.textColor=function(t,o,l,i){return e.textColor(this.fillColor(t,o,l,i))},g.prototype.click=function(t,o,e){},g.prototype.dblclick=function(t,o,e){},o(v,"tip"),o(x,"ITooltip"),x.prototype=Object.create(i.prototype),x.prototype.constructor=x,x.prototype.tooltipEnter=function(t){const o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)},x.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},x.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},x.prototype._tooltipHTML=function(t){return t},x.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},x.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let o='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){o+="<tr>",o+="<td>",o+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',o+='<div class="series-table-row-label">'+t.label+"</div>",o+="</td>",o+='<td><div class="series-table-row-value">'+t.value+"</div></td>",o+="</tr>"}),o+="</tbody>",o+="</table>",o;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},x.prototype.tooltipKeyValueFormat=function(t,o){let e="";for(const l in o)if(l!==t){const t=o&&o[l]?o[l]:"";e+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${l}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${o[t]}</th></tr>\n </thead>\n <tbody>\n ${e}\n </tbody>\n </table>`},x.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),x.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),x.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),x.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),x.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),x.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),x.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),x.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),x.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const w=x.prototype.tooltipLabelFormat;x.prototype.tooltipLabelFormat=function(t){const o=w.apply(this,arguments);return arguments.length&&(this._labelFormatter=s(t)),o};const C=x.prototype.tooltipValueFormat;function _(){}x.prototype.tooltipValueFormat=function(t){const o=C.apply(this,arguments);return arguments.length&&(this._valueFormatter=s(t)),o},o(_,"ITree"),_.prototype.constructor=_,_.prototype.click=function(t,o,e){},_.prototype.dblclick=function(t,o,e){},_.prototype._palette=e.ordinal("default");export{c as BUILD_VERSION,f as I1DChart,y as I2DAggrChart,h as I2DChart,d as IGraph,m as IInput,g as INDChart,x as ITooltip,_ as ITree,a as PKG_NAME,u as PKG_VERSION,b as instanceOfIHighlight};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.d3-tip{line-height:1;font-weight:700;padding:12px;background:#000000a8;color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-top-color:transparent;border-right-color:transparent;border-bottom-width:8px;border-left-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{padding:6px;text-align:left;border:1px solid #D1D1D1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #A3A3A3}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],o):o((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/api"]={},t["@hpcc-js/common"])}(this,function(t,o){"use strict";var e=Object.defineProperty,l=(t,o)=>e(t,"name",{value:o,configurable:!0});function i(){}function n(){}function r(){}function p(){}function s(t){return"function"==typeof t.highlightColumn}function a(){}function u(){}function c(){let t=c,e=f,i=h,n=T(document.body),r=k(),p=null,s=null,a=null;const u=l(function(t){if(p=F(t),!p)return;s=p.createSVGPoint();const o=n();o&&r&&o.appendChild(r)},"tip2");function c(){return"n"}function f(){return[0,0]}function h(){return" "}u.show=function(t,o,l){a=l[o];const r=Array.prototype.slice.call(arguments),p=i.apply(this,r);if(null===p)return u;const s=e.apply(this,r),c=E();let f,h=d.length;const b=n().getBoundingClientRect();for(c.html(p).style("opacity",1).style("pointer-events","all");h--;)c.classed(d[h],!1);let m=!1;const g={};let v=d[0];for(let e=0;e<d.length&&(m=C(d[e]),!m);e++);if(m)c.classed("notick",!1);else{c.classed("notick",!0);const t=w(g[v]),o=x(g[v]);C(v,t,o)}return u;function x(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function w(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function C(t,o,e){o=o||0,e=e||0,c.style("white-space","nowrap"),f=y.get(t).apply(this),c.classed(t,!0).style("top",f.top+s[0]-o+"px").style("left",f.left+s[1]-e+"px");const l=c.node().getBoundingClientRect(),i=l.top>b.top&&l.left>b.left&&l.bottom<b.bottom&&l.right<b.right;return g[t]={top:b.top-l.top,right:l.right-b.right,bottom:l.bottom-b.bottom,left:b.left-l.left},c.style("white-space","normal"),g[t].total_overflow=Object.keys(g[t]).filter(o=>g[t][o]>0).reduce((o,e)=>o+g[t][e],0),g[v].total_overflow>g[t].total_overflow&&(v=t),i||c.classed(t,!1),i}},u.hide=function(){return E().style("opacity",0).style("pointer-events","none"),u},u.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return E().attr(t);const l=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(E(),l),u},u.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return E().style(t);const l=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(E(),l),u},u.direction=function(o){return arguments.length?(t=null==o?o:T(o),u):t},u.offset=function(t){return arguments.length?(e=null==t?t:T(t),u):e},u.html=function(t){return arguments.length?(i=null==t?t:T(t),u):i},u.rootElement=function(t){return arguments.length?(n=T(t),u):n},u.destroy=function(){return r&&(E().remove(),r=null),u},l(c,"d3TipDirection"),l(f,"d3TipOffset"),l(h,"d3TipHTML");const y=o.map({n:b,s:m,e:g,w:v,nw:x,ne:w,sw:C,se:_}),d=y.keys();function b(){const t=I(window);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}}function m(){const t=I(window);return{top:t.s.y+8,left:t.s.x-r.offsetWidth/2}}function g(){const t=I(window);return{top:t.e.y-r.offsetHeight/2,left:t.e.x+8}}function v(){const t=I(window);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth-8}}function x(){const t=I(window);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}}function w(){const t=I(window);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}}function C(){const t=I(window);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}}function _(){const t=I(window);return{top:t.se.y,left:t.se.x}}function k(){const t=o.select(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function F(t){const o=t.node();return o?"svg"===o.tagName.toLowerCase()?o:o.ownerSVGElement:null}function E(){return null==r&&(r=k(),n().appendChild(r)),o.select(r)}function I(t){let o=a||t;for(;null==o.getCTM&&null!=o.parentNode;)o=o.parentNode;const e={},l=o.getCTM(),i=o.getBBox(),n=i.width,r=i.height,p=i.x,u=i.y;return s.x=p,s.y=u,e.nw=s.matrixTransform(l),s.x+=n,e.ne=s.matrixTransform(l),s.y+=r,e.se=s.matrixTransform(l),s.x-=n,e.sw=s.matrixTransform(l),s.y-=r/2,e.w=s.matrixTransform(l),s.x+=n,e.e=s.matrixTransform(l),s.x-=n/2,s.y-=r/2,e.n=s.matrixTransform(l),s.y+=r,e.s=s.matrixTransform(l),e}function T(t){return"function"==typeof t?t:function(){return t}}return l(b,"directionNorth"),l(m,"directionSouth"),l(g,"directionEast"),l(v,"directionWest"),l(x,"directionNorthWest"),l(w,"directionNorthEast"),l(C,"directionSouthWest"),l(_,"directionSouthEast"),l(k,"initNode"),l(F,"getSVGNode"),l(E,"getNodeEl"),l(I,"getScreenBBox"),l(T,"functor"),u}function f(){if(this.tooltip=c(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=o.format(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=o.format(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(o,e,l){this._parentOverlay||(this._parentOverlay=o._parentOverlay),this.tooltipEnter(e),t.apply(this,arguments)};const o=this.layerUpdate;this.layerUpdate=function(t){o.apply(this,arguments),this.tooltipUpdate()};const e=this.layerExit;this.layerExit=function(t){this.tooltipExit(),e.apply(this,arguments)}}else{const t=this.enter;this.enter=function(o,e){this.tooltipEnter(e),t.apply(this,arguments)};const o=this.update;this.update=function(t,e){o.apply(this,arguments),this.tooltipUpdate()};const e=this.exit;this.exit=function(t,o){this.tooltipExit(),e.apply(this,arguments)}}}l(i,"I1DChart"),i.prototype._dataFamily="1D",i.prototype._palette=o.Palette.rainbow("default"),i.prototype.click=function(t,o,e){},i.prototype.dblclick=function(t,o,e){},l(n,"I2DChart"),n.prototype._dataFamily="2D",n.prototype._palette=o.Palette.ordinal("default"),n.prototype.fillColor=function(t,o,e,l){return this._palette(t[0])},n.prototype.strokeColor=function(t,e,l,i){return o.hsl(this.fillColor(t,e,l,i)).darker().toString()},n.prototype.textColor=function(t,e,l,i){return o.Palette.textColor(this.fillColor(t,e,l,i))},n.prototype.click=function(t,o,e){},n.prototype.dblclick=function(t,o,e){},l(r,"I2DAggrChart"),r.prototype._palette=o.Palette.rainbow("default"),r.prototype.fillColor=function(t,o,e){return this._palette(t.length)},r.prototype.strokeColor=function(t,e,l){return o.hsl(this.fillColor(t,e,l)).darker().toString()},r.prototype.textColor=function(t,e,l){return o.Palette.textColor(this.fillColor(t,e,l))},r.prototype.click=function(t,o,e){},r.prototype.dblclick=function(t,o,e){},l(p,"IGraph"),p.prototype._dataFamily="graph",p.prototype.vertex_click=function(t,o,e,l){l&&l.vertex},p.prototype.vertex_dblclick=function(t,o,e,l){l&&l.vertex},p.prototype.edge_click=function(t,o,e,l){l&&l.edge},p.prototype.edge_dblclick=function(t,o,e,l){l&&l.edge},l(s,"instanceOfIHighlight"),l(a,"IInput"),a.prototype=Object.create(o.Widget.prototype),a.prototype.constructor=a,a.prototype.isValid=function(){if(this.validate()){if(!new RegExp(this.validate()).test(this.value()))return!1}return!0},a.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},a.prototype.blur=function(t){},a.prototype.keyup=function(t){},a.prototype.focus=function(t){},a.prototype.click=function(t){},a.prototype.dblclick=function(t){},a.prototype.change=function(t,o){},a.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},a.prototype.disable=function(t){this._inputElement.forEach(function(o,e){o.attr("disabled",t?"disabled":null)})},a.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},a.prototype.publish("name","","string","HTML name for the input"),a.prototype.publish("label","","string","Descriptive label"),a.prototype.publish("value","","string","Input Current Value"),a.prototype.publish("validate",null,"string","Input Validation"),l(u,"INDChart"),u.prototype._dataFamily="ND",u.prototype._palette=o.Palette.ordinal("default"),u.prototype.fillColor=function(t,o,e,l){return this._palette(o)},u.prototype.strokeColor=function(t,e,l,i){return o.hsl(this.fillColor(t,e,l,i)).darker().toString()},u.prototype.textColor=function(t,e,l,i){return o.Palette.textColor(this.fillColor(t,e,l,i))},u.prototype.click=function(t,o,e){},u.prototype.dblclick=function(t,o,e){},l(c,"tip"),l(f,"ITooltip"),f.prototype=Object.create(o.Widget.prototype),f.prototype.constructor=f,f.prototype.tooltipEnter=function(t){const o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)},f.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},f.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},f.prototype._tooltipHTML=function(t){return t},f.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},f.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let o='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){o+="<tr>",o+="<td>",o+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',o+='<div class="series-table-row-label">'+t.label+"</div>",o+="</td>",o+='<td><div class="series-table-row-value">'+t.value+"</div></td>",o+="</tr>"}),o+="</tbody>",o+="</table>",o;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},f.prototype.tooltipKeyValueFormat=function(t,o){let e="";for(const l in o)if(l!==t){const t=o&&o[l]?o[l]:"";e+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${l}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${o[t]}</th></tr>\n </thead>\n <tbody>\n ${e}\n </tbody>\n </table>`},f.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),f.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),f.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),f.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),f.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),f.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),f.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),f.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),f.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const h=f.prototype.tooltipLabelFormat;f.prototype.tooltipLabelFormat=function(t){const e=h.apply(this,arguments);return arguments.length&&(this._labelFormatter=o.format(t)),e};const y=f.prototype.tooltipValueFormat;function d(){}f.prototype.tooltipValueFormat=function(t){const e=y.apply(this,arguments);return arguments.length&&(this._valueFormatter=o.format(t)),e},l(d,"ITree"),d.prototype.constructor=d,d.prototype.click=function(t,o,e){},d.prototype.dblclick=function(t,o,e){},d.prototype._palette=o.Palette.ordinal("default"),t.BUILD_VERSION="3.18.0",t.I1DChart=i,t.I2DAggrChart=r,t.I2DChart=n,t.IGraph=p,t.IInput=a,t.INDChart=u,t.ITooltip=f,t.ITree=d,t.PKG_NAME="@hpcc-js/api",t.PKG_VERSION="3.4.5",t.instanceOfIHighlight=s,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],o):o((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/api"]={},t["@hpcc-js/common"])}(this,function(t,o){"use strict";var e=Object.defineProperty,l=(t,o)=>e(t,"name",{value:o,configurable:!0});function i(){}function n(){}function r(){}function p(){}function s(t){return"function"==typeof t.highlightColumn}function a(){}function u(){}function c(){let t=c,e=f,i=h,n=T(document.body),r=k(),p=null,s=null,a=null;const u=l(function(t){if(p=F(t),!p)return;s=p.createSVGPoint();const o=n();o&&r&&o.appendChild(r)},"tip2");function c(){return"n"}function f(){return[0,0]}function h(){return" "}u.show=function(t,o,l){a=l[o];const r=Array.prototype.slice.call(arguments),p=i.apply(this,r);if(null===p)return u;const s=e.apply(this,r),c=E();let f,h=d.length;const b=n().getBoundingClientRect();for(c.html(p).style("opacity",1).style("pointer-events","all");h--;)c.classed(d[h],!1);let m=!1;const g={};let v=d[0];for(let e=0;e<d.length&&(m=C(d[e]),!m);e++);if(m)c.classed("notick",!1);else{c.classed("notick",!0);const t=w(g[v]),o=x(g[v]);C(v,t,o)}return u;function x(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function w(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function C(t,o,e){o=o||0,e=e||0,c.style("white-space","nowrap"),f=y.get(t).apply(this),c.classed(t,!0).style("top",f.top+s[0]-o+"px").style("left",f.left+s[1]-e+"px");const l=c.node().getBoundingClientRect(),i=l.top>b.top&&l.left>b.left&&l.bottom<b.bottom&&l.right<b.right;return g[t]={top:b.top-l.top,right:l.right-b.right,bottom:l.bottom-b.bottom,left:b.left-l.left},c.style("white-space","normal"),g[t].total_overflow=Object.keys(g[t]).filter(o=>g[t][o]>0).reduce((o,e)=>o+g[t][e],0),g[v].total_overflow>g[t].total_overflow&&(v=t),i||c.classed(t,!1),i}},u.hide=function(){return E().style("opacity",0).style("pointer-events","none"),u},u.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return E().attr(t);const l=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(E(),l),u},u.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return E().style(t);const l=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(E(),l),u},u.direction=function(o){return arguments.length?(t=null==o?o:T(o),u):t},u.offset=function(t){return arguments.length?(e=null==t?t:T(t),u):e},u.html=function(t){return arguments.length?(i=null==t?t:T(t),u):i},u.rootElement=function(t){return arguments.length?(n=T(t),u):n},u.destroy=function(){return r&&(E().remove(),r=null),u},l(c,"d3TipDirection"),l(f,"d3TipOffset"),l(h,"d3TipHTML");const y=o.map({n:b,s:m,e:g,w:v,nw:x,ne:w,sw:C,se:_}),d=y.keys();function b(){const t=I(window);return{top:t.n.y-r.offsetHeight,left:t.n.x-r.offsetWidth/2}}function m(){const t=I(window);return{top:t.s.y+8,left:t.s.x-r.offsetWidth/2}}function g(){const t=I(window);return{top:t.e.y-r.offsetHeight/2,left:t.e.x+8}}function v(){const t=I(window);return{top:t.w.y-r.offsetHeight/2,left:t.w.x-r.offsetWidth-8}}function x(){const t=I(window);return{top:t.nw.y-r.offsetHeight,left:t.nw.x-r.offsetWidth}}function w(){const t=I(window);return{top:t.ne.y-r.offsetHeight,left:t.ne.x}}function C(){const t=I(window);return{top:t.sw.y,left:t.sw.x-r.offsetWidth}}function _(){const t=I(window);return{top:t.se.y,left:t.se.x}}function k(){const t=o.select(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function F(t){const o=t.node();return o?"svg"===o.tagName.toLowerCase()?o:o.ownerSVGElement:null}function E(){return null==r&&(r=k(),n().appendChild(r)),o.select(r)}function I(t){let o=a||t;for(;null==o.getCTM&&null!=o.parentNode;)o=o.parentNode;const e={},l=o.getCTM(),i=o.getBBox(),n=i.width,r=i.height,p=i.x,u=i.y;return s.x=p,s.y=u,e.nw=s.matrixTransform(l),s.x+=n,e.ne=s.matrixTransform(l),s.y+=r,e.se=s.matrixTransform(l),s.x-=n,e.sw=s.matrixTransform(l),s.y-=r/2,e.w=s.matrixTransform(l),s.x+=n,e.e=s.matrixTransform(l),s.x-=n/2,s.y-=r/2,e.n=s.matrixTransform(l),s.y+=r,e.s=s.matrixTransform(l),e}function T(t){return"function"==typeof t?t:function(){return t}}return l(b,"directionNorth"),l(m,"directionSouth"),l(g,"directionEast"),l(v,"directionWest"),l(x,"directionNorthWest"),l(w,"directionNorthEast"),l(C,"directionSouthWest"),l(_,"directionSouthEast"),l(k,"initNode"),l(F,"getSVGNode"),l(E,"getNodeEl"),l(I,"getScreenBBox"),l(T,"functor"),u}function f(){if(this.tooltip=c(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=o.format(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=o.format(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(o,e,l){this._parentOverlay||(this._parentOverlay=o._parentOverlay),this.tooltipEnter(e),t.apply(this,arguments)};const o=this.layerUpdate;this.layerUpdate=function(t){o.apply(this,arguments),this.tooltipUpdate()};const e=this.layerExit;this.layerExit=function(t){this.tooltipExit(),e.apply(this,arguments)}}else{const t=this.enter;this.enter=function(o,e){this.tooltipEnter(e),t.apply(this,arguments)};const o=this.update;this.update=function(t,e){o.apply(this,arguments),this.tooltipUpdate()};const e=this.exit;this.exit=function(t,o){this.tooltipExit(),e.apply(this,arguments)}}}l(i,"I1DChart"),i.prototype._dataFamily="1D",i.prototype._palette=o.Palette.rainbow("default"),i.prototype.click=function(t,o,e){},i.prototype.dblclick=function(t,o,e){},l(n,"I2DChart"),n.prototype._dataFamily="2D",n.prototype._palette=o.Palette.ordinal("default"),n.prototype.fillColor=function(t,o,e,l){return this._palette(t[0])},n.prototype.strokeColor=function(t,e,l,i){return o.hsl(this.fillColor(t,e,l,i)).darker().toString()},n.prototype.textColor=function(t,e,l,i){return o.Palette.textColor(this.fillColor(t,e,l,i))},n.prototype.click=function(t,o,e){},n.prototype.dblclick=function(t,o,e){},l(r,"I2DAggrChart"),r.prototype._palette=o.Palette.rainbow("default"),r.prototype.fillColor=function(t,o,e){return this._palette(t.length)},r.prototype.strokeColor=function(t,e,l){return o.hsl(this.fillColor(t,e,l)).darker().toString()},r.prototype.textColor=function(t,e,l){return o.Palette.textColor(this.fillColor(t,e,l))},r.prototype.click=function(t,o,e){},r.prototype.dblclick=function(t,o,e){},l(p,"IGraph"),p.prototype._dataFamily="graph",p.prototype.vertex_click=function(t,o,e,l){l&&l.vertex},p.prototype.vertex_dblclick=function(t,o,e,l){l&&l.vertex},p.prototype.edge_click=function(t,o,e,l){l&&l.edge},p.prototype.edge_dblclick=function(t,o,e,l){l&&l.edge},l(s,"instanceOfIHighlight"),l(a,"IInput"),a.prototype=Object.create(o.Widget.prototype),a.prototype.constructor=a,a.prototype.isValid=function(){if(this.validate()){if(!new RegExp(this.validate()).test(this.value()))return!1}return!0},a.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},a.prototype.blur=function(t){},a.prototype.keyup=function(t){},a.prototype.focus=function(t){},a.prototype.click=function(t){},a.prototype.dblclick=function(t){},a.prototype.change=function(t,o){},a.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},a.prototype.disable=function(t){this._inputElement.forEach(function(o,e){o.attr("disabled",t?"disabled":null)})},a.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},a.prototype.publish("name","","string","HTML name for the input"),a.prototype.publish("label","","string","Descriptive label"),a.prototype.publish("value","","string","Input Current Value"),a.prototype.publish("validate",null,"string","Input Validation"),l(u,"INDChart"),u.prototype._dataFamily="ND",u.prototype._palette=o.Palette.ordinal("default"),u.prototype.fillColor=function(t,o,e,l){return this._palette(o)},u.prototype.strokeColor=function(t,e,l,i){return o.hsl(this.fillColor(t,e,l,i)).darker().toString()},u.prototype.textColor=function(t,e,l,i){return o.Palette.textColor(this.fillColor(t,e,l,i))},u.prototype.click=function(t,o,e){},u.prototype.dblclick=function(t,o,e){},l(c,"tip"),l(f,"ITooltip"),f.prototype=Object.create(o.Widget.prototype),f.prototype.constructor=f,f.prototype.tooltipEnter=function(t){const o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)},f.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},f.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},f.prototype._tooltipHTML=function(t){return t},f.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},f.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let o='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){o+="<tr>",o+="<td>",o+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',o+='<div class="series-table-row-label">'+t.label+"</div>",o+="</td>",o+='<td><div class="series-table-row-value">'+t.value+"</div></td>",o+="</tr>"}),o+="</tbody>",o+="</table>",o;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},f.prototype.tooltipKeyValueFormat=function(t,o){let e="";for(const l in o)if(l!==t){const t=o&&o[l]?o[l]:"";e+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${l}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${o[t]}</th></tr>\n </thead>\n <tbody>\n ${e}\n </tbody>\n </table>`},f.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),f.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),f.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),f.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),f.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),f.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),f.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),f.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),f.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const h=f.prototype.tooltipLabelFormat;f.prototype.tooltipLabelFormat=function(t){const e=h.apply(this,arguments);return arguments.length&&(this._labelFormatter=o.format(t)),e};const y=f.prototype.tooltipValueFormat;function d(){}f.prototype.tooltipValueFormat=function(t){const e=y.apply(this,arguments);return arguments.length&&(this._valueFormatter=o.format(t)),e},l(d,"ITree"),d.prototype.constructor=d,d.prototype.click=function(t,o,e){},d.prototype.dblclick=function(t,o,e){},d.prototype._palette=o.Palette.ordinal("default"),t.BUILD_VERSION="3.19.2",t.I1DChart=i,t.I2DAggrChart=r,t.I2DChart=n,t.IGraph=p,t.IInput=a,t.INDChart=u,t.ITooltip=f,t.ITree=d,t.PKG_NAME="@hpcc-js/api",t.PKG_VERSION="3.4.7",t.instanceOfIHighlight=s,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=index.umd.cjs.map
|
|
3
3
|
!function(){"use strict";try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.d3-tip{line-height:1;font-weight:700;padding:12px;background:#000000a8;color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-top-color:transparent;border-right-color:transparent;border-bottom-width:8px;border-left-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{padding:6px;text-align:left;border:1px solid #D1D1D1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #A3A3A3}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/api",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.7",
|
|
4
4
|
"description": "hpcc-js - Viz api",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"update-major": "npx --yes npm-check-updates -u"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hpcc-js/common": "^3.6.
|
|
40
|
+
"@hpcc-js/common": "^3.6.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@hpcc-js/esbuild-plugins": "^1.8.
|
|
43
|
+
"@hpcc-js/esbuild-plugins": "^1.8.2",
|
|
44
44
|
"d3-collection": "^1",
|
|
45
45
|
"d3-color": "3.1.0",
|
|
46
46
|
"d3-format": "^1",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
58
58
|
},
|
|
59
59
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "99595523fbe7b16b75fc22b03666b9f249257a50"
|
|
61
61
|
}
|