@hpcc-js/api
Advanced tools
Comparing version 2.10.1 to 2.11.0
import { Palette, hsl, Widget, select, selection, map, format } from '@hpcc-js/common'; | ||
var PKG_NAME = "@hpcc-js/api"; | ||
var PKG_VERSION = "2.10.1"; | ||
var BUILD_VERSION = "2.103.1"; | ||
var PKG_VERSION = "2.11.0"; | ||
var BUILD_VERSION = "2.103.2"; | ||
@@ -551,3 +551,8 @@ function I1DChart() { | ||
this.tooltip = tip(); | ||
this._valueFormatter = format(this.tooltipValueFormat()); | ||
if (this.tooltipLabelFormat_exists()) { | ||
this._labelFormatter = format(this.tooltipLabelFormat()); | ||
} | ||
if (this.tooltipValueFormat_exists()) { | ||
this._valueFormatter = format(this.tooltipValueFormat()); | ||
} | ||
if (this.layerEnter) { | ||
@@ -646,2 +651,8 @@ var layerEnter_1 = this.layerEnter; | ||
opts.label = opts.label === undefined ? "" : opts.label; | ||
if (this._labelFormatter) { | ||
opts.label = this._labelFormatter(opts.label) || ""; | ||
} | ||
else if (this.formatData && this.parseData) { | ||
opts.label = this.formatData(this.parseData(opts.label)); | ||
} | ||
opts.series = opts.series || ""; | ||
@@ -651,5 +662,8 @@ if (opts.value instanceof Date) { | ||
} | ||
else { | ||
else if (this._valueFormatter) { | ||
opts.value = this._valueFormatter(opts.value) || ""; | ||
} | ||
else if (this.formatValue && this.parseValue) { | ||
opts.value = this.formatValue(this.parseValue(opts.value)); | ||
} | ||
switch (this.tooltipStyle()) { | ||
@@ -698,8 +712,17 @@ case "none": | ||
ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {}); | ||
ITooltip.prototype.publish("tooltipValueFormat", ",.2f", "string", "Number format of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelFormat", undefined, "string", "Format of tooltip label(s) (the domain axis)", null, {}); | ||
ITooltip.prototype.publish("tooltipValueFormat", undefined, "string", "Number format of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipSeriesColor", "#EAFFFF", "html-color", "Color of tooltip series text", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text (the domain axis)", null, {}); | ||
ITooltip.prototype.publish("tooltipValueColor", "white", "html-color", "Color of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipTick", true, "boolean", "Show tooltip tick", null, {}); | ||
ITooltip.prototype.publish("tooltipOffset", 8, "number", "Offset from the cursor", null, {}); | ||
var tooltipLabelFormat = ITooltip.prototype.tooltipLabelFormat; | ||
ITooltip.prototype.tooltipLabelFormat = function (_) { | ||
var retVal = tooltipLabelFormat.apply(this, arguments); | ||
if (arguments.length) { | ||
this._labelFormatter = format(_); | ||
} | ||
return retVal; | ||
}; | ||
var tooltipValueFormat = ITooltip.prototype.tooltipValueFormat; | ||
@@ -706,0 +729,0 @@ ITooltip.prototype.tooltipValueFormat = function (_) { |
@@ -8,4 +8,4 @@ (function (global, factory) { | ||
var PKG_NAME = "@hpcc-js/api"; | ||
var PKG_VERSION = "2.10.1"; | ||
var BUILD_VERSION = "2.103.1"; | ||
var PKG_VERSION = "2.11.0"; | ||
var BUILD_VERSION = "2.103.2"; | ||
@@ -556,3 +556,8 @@ function I1DChart() { | ||
this.tooltip = tip(); | ||
this._valueFormatter = common.format(this.tooltipValueFormat()); | ||
if (this.tooltipLabelFormat_exists()) { | ||
this._labelFormatter = common.format(this.tooltipLabelFormat()); | ||
} | ||
if (this.tooltipValueFormat_exists()) { | ||
this._valueFormatter = common.format(this.tooltipValueFormat()); | ||
} | ||
if (this.layerEnter) { | ||
@@ -651,2 +656,8 @@ var layerEnter_1 = this.layerEnter; | ||
opts.label = opts.label === undefined ? "" : opts.label; | ||
if (this._labelFormatter) { | ||
opts.label = this._labelFormatter(opts.label) || ""; | ||
} | ||
else if (this.formatData && this.parseData) { | ||
opts.label = this.formatData(this.parseData(opts.label)); | ||
} | ||
opts.series = opts.series || ""; | ||
@@ -656,5 +667,8 @@ if (opts.value instanceof Date) { | ||
} | ||
else { | ||
else if (this._valueFormatter) { | ||
opts.value = this._valueFormatter(opts.value) || ""; | ||
} | ||
else if (this.formatValue && this.parseValue) { | ||
opts.value = this.formatValue(this.parseValue(opts.value)); | ||
} | ||
switch (this.tooltipStyle()) { | ||
@@ -703,8 +717,17 @@ case "none": | ||
ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {}); | ||
ITooltip.prototype.publish("tooltipValueFormat", ",.2f", "string", "Number format of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelFormat", undefined, "string", "Format of tooltip label(s) (the domain axis)", null, {}); | ||
ITooltip.prototype.publish("tooltipValueFormat", undefined, "string", "Number format of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipSeriesColor", "#EAFFFF", "html-color", "Color of tooltip series text", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text (the domain axis)", null, {}); | ||
ITooltip.prototype.publish("tooltipValueColor", "white", "html-color", "Color of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipTick", true, "boolean", "Show tooltip tick", null, {}); | ||
ITooltip.prototype.publish("tooltipOffset", 8, "number", "Offset from the cursor", null, {}); | ||
var tooltipLabelFormat = ITooltip.prototype.tooltipLabelFormat; | ||
ITooltip.prototype.tooltipLabelFormat = function (_) { | ||
var retVal = tooltipLabelFormat.apply(this, arguments); | ||
if (arguments.length) { | ||
this._labelFormatter = common.format(_); | ||
} | ||
return retVal; | ||
}; | ||
var tooltipValueFormat = ITooltip.prototype.tooltipValueFormat; | ||
@@ -711,0 +734,0 @@ ITooltip.prototype.tooltipValueFormat = function (_) { |
@@ -1,2 +0,2 @@ | ||
!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";function e(){}function r(){}function i(){}function l(){}function n(){}function p(){}e.prototype._dataFamily="1D",e.prototype._palette=o.Palette.rainbow("default"),e.prototype.click=function(t,o,e){},e.prototype.dblclick=function(t,o,e){},r.prototype._dataFamily="2D",r.prototype._palette=o.Palette.ordinal("default"),r.prototype.fillColor=function(t,o,e,r){return this._palette(t[0])},r.prototype.strokeColor=function(t,e,r,i){return o.hsl(this.fillColor(t,e,r,i)).darker().toString()},r.prototype.textColor=function(t,e,r,i){return o.Palette.textColor(this.fillColor(t,e,r,i))},r.prototype.click=function(t,o,e){},r.prototype.dblclick=function(t,o,e){},i.prototype._palette=o.Palette.rainbow("default"),i.prototype.fillColor=function(t,o,e){return this._palette(t.length)},i.prototype.strokeColor=function(t,e,r){return o.hsl(this.fillColor(t,e,r)).darker().toString()},i.prototype.textColor=function(t,e,r){return o.Palette.textColor(this.fillColor(t,e,r))},i.prototype.click=function(t,o,e){},i.prototype.dblclick=function(t,o,e){},l.prototype._dataFamily="graph",l.prototype.vertex_click=function(t,o,e,r){r&&r.vertex},l.prototype.vertex_dblclick=function(t,o,e,r){r&&r.vertex},l.prototype.edge_click=function(t,o,e,r){r&&r.edge},l.prototype.edge_dblclick=function(t,o,e,r){r&&r.edge},n.prototype=Object.create(o.Widget.prototype),n.prototype.constructor=n,n.prototype.isValid=function(){if(this.validate()&&!new RegExp(this.validate()).test(this.value()))return!1;return!0},n.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()},n.prototype.blur=function(t){},n.prototype.keyup=function(t){},n.prototype.focus=function(t){},n.prototype.click=function(t){},n.prototype.dblclick=function(t){},n.prototype.change=function(t,o){},n.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},n.prototype.disable=function(t){this._inputElement.forEach((function(o,e){o.attr("disabled",t?"disabled":null)}))},n.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},n.prototype.publish("name","","string","HTML name for the input"),n.prototype.publish("label","","string","Descriptive label"),n.prototype.publish("value","","string","Input Current Value"),n.prototype.publish("validate",null,"string","Input Validation"),p.prototype._dataFamily="ND",p.prototype._palette=o.Palette.ordinal("default"),p.prototype.fillColor=function(t,o,e,r){return this._palette(o)},p.prototype.strokeColor=function(t,e,r,i){return o.hsl(this.fillColor(t,e,r,i)).darker().toString()},p.prototype.textColor=function(t,e,r,i){return o.Palette.textColor(this.fillColor(t,e,r,i))},p.prototype.click=function(t,o,e){},p.prototype.dblclick=function(t,o,e){};function a(){if(this.tooltip=function(){var t=function(){return"n"},e=function(){return[0,0]},r=function(){return" "},i=y(document.body),l=f(),n=null,p=null,a=null,s=function(t){var o;if(o=t.node(),n=o?"svg"===o.tagName.toLowerCase()?o:o.ownerSVGElement:null){p=n.createSVGPoint();var e=i();e&&l&&e.appendChild(l)}};s.show=function(t,o,l){a=l[o];var n=Array.prototype.slice.call(arguments),p=r.apply(this,n);if(null===p)return s;var f,h=e.apply(this,n),y=d(),b=u.length,v=i().getBoundingClientRect();for(y.html(p).style("opacity",1).style("pointer-events","all");b--;)y.classed(u[b],!1);for(var m=!1,g={},x=u[0],w=0;w<u.length&&!(m=E(u[w]));w++);if(m)y.classed("notick",!1);else{y.classed("notick",!0);var C=T(g[x]),k=_(g[x]);E(x,C,k)}return s;function _(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function T(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function E(t,o,e){o=o||0,e=e||0,y.style("white-space","nowrap"),f=c.get(t).apply(this),y.classed(t,!0).style("top",f.top+h[0]-o+"px").style("left",f.left+h[1]-e+"px");var r=y.node().getBoundingClientRect(),i=r.top>v.top&&r.left>v.left&&r.bottom<v.bottom&&r.right<v.right;return g[t]={top:v.top-r.top,right:r.right-v.right,bottom:r.bottom-v.bottom,left:v.left-r.left},y.style("white-space","normal"),g[t].total_overflow=Object.keys(g[t]).filter((function(o){return g[t][o]>0})).reduce((function(o,e){return o+g[t][e]}),0),g[x].total_overflow>g[t].total_overflow&&(x=t),i||y.classed(t,!1),i}},s.hide=function(){return d().style("opacity",0).style("pointer-events","none"),s},s.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return d().attr(t);var r=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(d(),r),s},s.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return d().style(t);var r=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(d(),r),s},s.direction=function(o){return arguments.length?(t=null==o?o:y(o),s):t},s.offset=function(t){return arguments.length?(e=null==t?t:y(t),s):e},s.html=function(t){return arguments.length?(r=null==t?t:y(t),s):r},s.rootElement=function(t){return arguments.length?(i=y(t),s):i},s.destroy=function(){return l&&(d().remove(),l=null),s};var c=o.map({n:function(){var t=h(window);return{top:t.n.y-l.offsetHeight,left:t.n.x-l.offsetWidth/2}},s:function(){var t=h(window);return{top:t.s.y+8,left:t.s.x-l.offsetWidth/2}},e:function(){var t=h(window);return{top:t.e.y-l.offsetHeight/2,left:t.e.x+8}},w:function(){var t=h(window);return{top:t.w.y-l.offsetHeight/2,left:t.w.x-l.offsetWidth-8}},nw:function(){var t=h(window);return{top:t.nw.y-l.offsetHeight,left:t.nw.x-l.offsetWidth}},ne:function(){var t=h(window);return{top:t.ne.y-l.offsetHeight,left:t.ne.x}},sw:function(){var t=h(window);return{top:t.sw.y,left:t.sw.x-l.offsetWidth}},se:function(){var t=h(window);return{top:t.se.y,left:t.se.x}}}),u=c.keys();function f(){var 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 d(){return null==l&&(l=f(),i().appendChild(l)),o.select(l)}function h(t){for(var o=a||t;null==o.getCTM&&null!=o.parentNode;)o=o.parentNode;var e={},r=o.getCTM(),i=o.getBBox(),l=i.width,n=i.height,s=i.x,c=i.y;return p.x=s,p.y=c,e.nw=p.matrixTransform(r),p.x+=l,e.ne=p.matrixTransform(r),p.y+=n,e.se=p.matrixTransform(r),p.x-=l,e.sw=p.matrixTransform(r),p.y-=n/2,e.w=p.matrixTransform(r),p.x+=l,e.e=p.matrixTransform(r),p.x-=l/2,p.y-=n/2,e.n=p.matrixTransform(r),p.y+=n,e.s=p.matrixTransform(r),e}function y(t){return"function"==typeof t?t:function(){return t}}return s}(),this._valueFormatter=o.format(this.tooltipValueFormat()),this.layerEnter){var t=this.layerEnter;this.layerEnter=function(o,e,r){this._parentOverlay||(this._parentOverlay=o._parentOverlay),this.tooltipEnter(e),t.apply(this,arguments)};var e=this.layerUpdate;this.layerUpdate=function(t){e.apply(this,arguments),this.tooltipUpdate()};var r=this.layerExit;this.layerExit=function(t){this.tooltipExit(),r.apply(this,arguments)}}else{var i=this.enter;this.enter=function(t,o){this.tooltipEnter(o),i.apply(this,arguments)};var l=this.update;this.update=function(t,o){l.apply(this,arguments),this.tooltipUpdate()};var n=this.exit;this.exit=function(t,o){this.tooltipExit(),n.apply(this,arguments)}}}!function(t,o){void 0===o&&(o={});var e=o.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===e&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}('.d3-tip{background:rgba(0,0,0,.66);border-radius:2px;color:#fff;font-weight:700;line-height:1;padding:12px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{border:4px solid rgba(0,0,0,.66);box-sizing:border-box;content:" ";display:inline-block;height:8px;margin:0;pointer-events:none!important;position:absolute;width:8px}.d3-tip.n:after{border-right-color:transparent;border-top-width:8px;left:calc(50% - 4px);top:100%}.d3-tip.e:after,.d3-tip.n:after{border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{border-right-width:8px;border-top-color:transparent;left:-12px;top:calc(50% - 4px)}.d3-tip.s{margin-top:8px}.d3-tip.s:after{border-bottom-width:8px;border-left-color:transparent;left:calc(50% - 4px);top:-12px}.d3-tip.s:after,.d3-tip.w:after{border-right-color:transparent;border-top-color:transparent}.d3-tip.w:after{border-bottom-color:transparent;border-left-width:8px;left:100%;top:calc(50% - 4px)}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:rgba(0,0,0,.66);opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table td,.d3-tip .ITooltip-series-table th{border:1px solid #d1d1d1;padding:6px;text-align:left}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;margin-right:10px;width: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}'),a.prototype=Object.create(o.Widget.prototype),a.prototype.constructor=a,a.prototype.tooltipEnter=function(t){var o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)},a.prototype.tooltipUpdate=function(){var t=this;this.tooltip.offset((function(){if(event&&t.tooltipFollowMouse()){var o=document.querySelector(".d3-tip");return o.style.display="block",o.style.left=t.tooltipOffset()+event.clientX+"px",o.style.top=event.clientY+"px",[]}return"e"===t.tooltip.direction()()?[0,t.tooltipOffset()]:[-t.tooltipOffset(),0]}));var o=this.tooltip.attr("class");o&&(o=(o=o.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":"")).split(" ").filter((function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")})).join(" "),o+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",o))},a.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},a.prototype._tooltipHTML=function(t){return t},a.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},a.prototype.tooltipFormat=function(t){switch(void 0===t&&(t={}),t.label=void 0===t.label?"":t.label,t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":t.value=this._valueFormatter(t.value)||"",this.tooltipStyle()){case"none":break;case"series-table":var 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>";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>"}},a.prototype.tooltipKeyValueFormat=function(t,o){var e="";for(var r in o)if(r!==t){var i=o&&o[r]?o[r]:"";e+='<tr><td style="'.concat(this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():"",'">').concat(r,'</td><td style="font-weight:normal">').concat(i,"</td></tr>")}return'<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">'.concat(o[t],"</th></tr>\n </thead>\n <tbody>\n ").concat(e,"\n </tbody>\n </table>")},a.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),a.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),a.prototype.publish("tooltipValueFormat",",.2f","string","Number format of tooltip value(s)",null,{}),a.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),a.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text",null,{}),a.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),a.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),a.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});var s=a.prototype.tooltipValueFormat;function c(){}a.prototype.tooltipValueFormat=function(t){var e=s.apply(this,arguments);return arguments.length&&(this._valueFormatter=o.format(t)),e},c.prototype.constructor=c,c.prototype.click=function(t,o,e){},c.prototype.dblclick=function(t,o,e){},c.prototype._palette=o.Palette.ordinal("default"),t.BUILD_VERSION="2.103.1",t.I1DChart=e,t.I2DAggrChart=i,t.I2DChart=r,t.IGraph=l,t.IInput=n,t.INDChart=p,t.ITooltip=a,t.ITree=c,t.PKG_NAME="@hpcc-js/api",t.PKG_VERSION="2.10.1",t.instanceOfIHighlight=function(t){return"function"==typeof t.highlightColumn},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!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";function e(){}function r(){}function l(){}function i(){}function n(){}function p(){}e.prototype._dataFamily="1D",e.prototype._palette=o.Palette.rainbow("default"),e.prototype.click=function(t,o,e){},e.prototype.dblclick=function(t,o,e){},r.prototype._dataFamily="2D",r.prototype._palette=o.Palette.ordinal("default"),r.prototype.fillColor=function(t,o,e,r){return this._palette(t[0])},r.prototype.strokeColor=function(t,e,r,l){return o.hsl(this.fillColor(t,e,r,l)).darker().toString()},r.prototype.textColor=function(t,e,r,l){return o.Palette.textColor(this.fillColor(t,e,r,l))},r.prototype.click=function(t,o,e){},r.prototype.dblclick=function(t,o,e){},l.prototype._palette=o.Palette.rainbow("default"),l.prototype.fillColor=function(t,o,e){return this._palette(t.length)},l.prototype.strokeColor=function(t,e,r){return o.hsl(this.fillColor(t,e,r)).darker().toString()},l.prototype.textColor=function(t,e,r){return o.Palette.textColor(this.fillColor(t,e,r))},l.prototype.click=function(t,o,e){},l.prototype.dblclick=function(t,o,e){},i.prototype._dataFamily="graph",i.prototype.vertex_click=function(t,o,e,r){r&&r.vertex},i.prototype.vertex_dblclick=function(t,o,e,r){r&&r.vertex},i.prototype.edge_click=function(t,o,e,r){r&&r.edge},i.prototype.edge_dblclick=function(t,o,e,r){r&&r.edge},n.prototype=Object.create(o.Widget.prototype),n.prototype.constructor=n,n.prototype.isValid=function(){if(this.validate()&&!new RegExp(this.validate()).test(this.value()))return!1;return!0},n.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()},n.prototype.blur=function(t){},n.prototype.keyup=function(t){},n.prototype.focus=function(t){},n.prototype.click=function(t){},n.prototype.dblclick=function(t){},n.prototype.change=function(t,o){},n.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},n.prototype.disable=function(t){this._inputElement.forEach((function(o,e){o.attr("disabled",t?"disabled":null)}))},n.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},n.prototype.publish("name","","string","HTML name for the input"),n.prototype.publish("label","","string","Descriptive label"),n.prototype.publish("value","","string","Input Current Value"),n.prototype.publish("validate",null,"string","Input Validation"),p.prototype._dataFamily="ND",p.prototype._palette=o.Palette.ordinal("default"),p.prototype.fillColor=function(t,o,e,r){return this._palette(o)},p.prototype.strokeColor=function(t,e,r,l){return o.hsl(this.fillColor(t,e,r,l)).darker().toString()},p.prototype.textColor=function(t,e,r,l){return o.Palette.textColor(this.fillColor(t,e,r,l))},p.prototype.click=function(t,o,e){},p.prototype.dblclick=function(t,o,e){};function a(){if(this.tooltip=function(){var t=function(){return"n"},e=function(){return[0,0]},r=function(){return" "},l=y(document.body),i=f(),n=null,p=null,a=null,s=function(t){var o;if(o=t.node(),n=o?"svg"===o.tagName.toLowerCase()?o:o.ownerSVGElement:null){p=n.createSVGPoint();var e=l();e&&i&&e.appendChild(i)}};s.show=function(t,o,i){a=i[o];var n=Array.prototype.slice.call(arguments),p=r.apply(this,n);if(null===p)return s;var f,h=e.apply(this,n),y=d(),b=c.length,m=l().getBoundingClientRect();for(y.html(p).style("opacity",1).style("pointer-events","all");b--;)y.classed(c[b],!1);for(var v=!1,g={},x=c[0],w=0;w<c.length&&!(v=T(c[w]));w++);if(v)y.classed("notick",!1);else{y.classed("notick",!0);var C=F(g[x]),k=_(g[x]);T(x,C,k)}return s;function _(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function F(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function T(t,o,e){o=o||0,e=e||0,y.style("white-space","nowrap"),f=u.get(t).apply(this),y.classed(t,!0).style("top",f.top+h[0]-o+"px").style("left",f.left+h[1]-e+"px");var r=y.node().getBoundingClientRect(),l=r.top>m.top&&r.left>m.left&&r.bottom<m.bottom&&r.right<m.right;return g[t]={top:m.top-r.top,right:r.right-m.right,bottom:r.bottom-m.bottom,left:m.left-r.left},y.style("white-space","normal"),g[t].total_overflow=Object.keys(g[t]).filter((function(o){return g[t][o]>0})).reduce((function(o,e){return o+g[t][e]}),0),g[x].total_overflow>g[t].total_overflow&&(x=t),l||y.classed(t,!1),l}},s.hide=function(){return d().style("opacity",0).style("pointer-events","none"),s},s.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return d().attr(t);var r=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(d(),r),s},s.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return d().style(t);var r=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(d(),r),s},s.direction=function(o){return arguments.length?(t=null==o?o:y(o),s):t},s.offset=function(t){return arguments.length?(e=null==t?t:y(t),s):e},s.html=function(t){return arguments.length?(r=null==t?t:y(t),s):r},s.rootElement=function(t){return arguments.length?(l=y(t),s):l},s.destroy=function(){return i&&(d().remove(),i=null),s};var u=o.map({n:function(){var t=h(window);return{top:t.n.y-i.offsetHeight,left:t.n.x-i.offsetWidth/2}},s:function(){var t=h(window);return{top:t.s.y+8,left:t.s.x-i.offsetWidth/2}},e:function(){var t=h(window);return{top:t.e.y-i.offsetHeight/2,left:t.e.x+8}},w:function(){var t=h(window);return{top:t.w.y-i.offsetHeight/2,left:t.w.x-i.offsetWidth-8}},nw:function(){var t=h(window);return{top:t.nw.y-i.offsetHeight,left:t.nw.x-i.offsetWidth}},ne:function(){var t=h(window);return{top:t.ne.y-i.offsetHeight,left:t.ne.x}},sw:function(){var t=h(window);return{top:t.sw.y,left:t.sw.x-i.offsetWidth}},se:function(){var t=h(window);return{top:t.se.y,left:t.se.x}}}),c=u.keys();function f(){var 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 d(){return null==i&&(i=f(),l().appendChild(i)),o.select(i)}function h(t){for(var o=a||t;null==o.getCTM&&null!=o.parentNode;)o=o.parentNode;var e={},r=o.getCTM(),l=o.getBBox(),i=l.width,n=l.height,s=l.x,u=l.y;return p.x=s,p.y=u,e.nw=p.matrixTransform(r),p.x+=i,e.ne=p.matrixTransform(r),p.y+=n,e.se=p.matrixTransform(r),p.x-=i,e.sw=p.matrixTransform(r),p.y-=n/2,e.w=p.matrixTransform(r),p.x+=i,e.e=p.matrixTransform(r),p.x-=i/2,p.y-=n/2,e.n=p.matrixTransform(r),p.y+=n,e.s=p.matrixTransform(r),e}function y(t){return"function"==typeof t?t:function(){return t}}return s}(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=o.format(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=o.format(this.tooltipValueFormat())),this.layerEnter){var t=this.layerEnter;this.layerEnter=function(o,e,r){this._parentOverlay||(this._parentOverlay=o._parentOverlay),this.tooltipEnter(e),t.apply(this,arguments)};var e=this.layerUpdate;this.layerUpdate=function(t){e.apply(this,arguments),this.tooltipUpdate()};var r=this.layerExit;this.layerExit=function(t){this.tooltipExit(),r.apply(this,arguments)}}else{var l=this.enter;this.enter=function(t,o){this.tooltipEnter(o),l.apply(this,arguments)};var i=this.update;this.update=function(t,o){i.apply(this,arguments),this.tooltipUpdate()};var n=this.exit;this.exit=function(t,o){this.tooltipExit(),n.apply(this,arguments)}}}!function(t,o){void 0===o&&(o={});var e=o.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===e&&r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),l.styleSheet?l.styleSheet.cssText=t:l.appendChild(document.createTextNode(t))}}('.d3-tip{background:rgba(0,0,0,.66);border-radius:2px;color:#fff;font-weight:700;line-height:1;padding:12px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{border:4px solid rgba(0,0,0,.66);box-sizing:border-box;content:" ";display:inline-block;height:8px;margin:0;pointer-events:none!important;position:absolute;width:8px}.d3-tip.n:after{border-right-color:transparent;border-top-width:8px;left:calc(50% - 4px);top:100%}.d3-tip.e:after,.d3-tip.n:after{border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{border-right-width:8px;border-top-color:transparent;left:-12px;top:calc(50% - 4px)}.d3-tip.s{margin-top:8px}.d3-tip.s:after{border-bottom-width:8px;border-left-color:transparent;left:calc(50% - 4px);top:-12px}.d3-tip.s:after,.d3-tip.w:after{border-right-color:transparent;border-top-color:transparent}.d3-tip.w:after{border-bottom-color:transparent;border-left-width:8px;left:100%;top:calc(50% - 4px)}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:rgba(0,0,0,.66);opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table td,.d3-tip .ITooltip-series-table th{border:1px solid #d1d1d1;padding:6px;text-align:left}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;margin-right:10px;width: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}'),a.prototype=Object.create(o.Widget.prototype),a.prototype.constructor=a,a.prototype.tooltipEnter=function(t){var o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)},a.prototype.tooltipUpdate=function(){var t=this;this.tooltip.offset((function(){if(event&&t.tooltipFollowMouse()){var o=document.querySelector(".d3-tip");return o.style.display="block",o.style.left=t.tooltipOffset()+event.clientX+"px",o.style.top=event.clientY+"px",[]}return"e"===t.tooltip.direction()()?[0,t.tooltipOffset()]:[-t.tooltipOffset(),0]}));var o=this.tooltip.attr("class");o&&(o=(o=o.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":"")).split(" ").filter((function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")})).join(" "),o+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",o))},a.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},a.prototype._tooltipHTML=function(t){return t},a.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},a.prototype.tooltipFormat=function(t){switch(void 0===t&&(t={}),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":var 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>";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>"}},a.prototype.tooltipKeyValueFormat=function(t,o){var e="";for(var r in o)if(r!==t){var l=o&&o[r]?o[r]:"";e+='<tr><td style="'.concat(this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():"",'">').concat(r,'</td><td style="font-weight:normal">').concat(l,"</td></tr>")}return'<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">'.concat(o[t],"</th></tr>\n </thead>\n <tbody>\n ").concat(e,"\n </tbody>\n </table>")},a.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),a.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),a.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),a.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),a.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),a.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),a.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),a.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),a.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});var s=a.prototype.tooltipLabelFormat;a.prototype.tooltipLabelFormat=function(t){var e=s.apply(this,arguments);return arguments.length&&(this._labelFormatter=o.format(t)),e};var u=a.prototype.tooltipValueFormat;function c(){}a.prototype.tooltipValueFormat=function(t){var e=u.apply(this,arguments);return arguments.length&&(this._valueFormatter=o.format(t)),e},c.prototype.constructor=c,c.prototype.click=function(t,o,e){},c.prototype.dblclick=function(t,o,e){},c.prototype._palette=o.Palette.ordinal("default"),t.BUILD_VERSION="2.103.2",t.I1DChart=e,t.I2DAggrChart=l,t.I2DChart=r,t.IGraph=i,t.IInput=n,t.INDChart=p,t.ITooltip=a,t.ITree=c,t.PKG_NAME="@hpcc-js/api",t.PKG_VERSION="2.11.0",t.instanceOfIHighlight=function(t){return"function"==typeof t.highlightColumn},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@hpcc-js/api", | ||
"version": "2.10.1", | ||
"version": "2.11.0", | ||
"description": "hpcc-js - Viz api", | ||
@@ -41,3 +41,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hpcc-js/common": "^2.68.1" | ||
"@hpcc-js/common": "^2.69.0" | ||
}, | ||
@@ -63,3 +63,3 @@ "devDependencies": { | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "b7c5d9a853196b53078d665df4368629a1a87903" | ||
"gitHead": "46e2dd7a9998fe771f9104ddc09b3b0992d0bdfe" | ||
} |
export const PKG_NAME = "@hpcc-js/api"; | ||
export const PKG_VERSION = "2.10.1"; | ||
export const BUILD_VERSION = "2.103.1"; | ||
export const PKG_VERSION = "2.11.0"; | ||
export const BUILD_VERSION = "2.103.2"; |
@@ -13,4 +13,10 @@ import { Widget } from "@hpcc-js/common"; | ||
this._valueFormatter = d3Format(this.tooltipValueFormat() as string); | ||
if (this.tooltipLabelFormat_exists()) { | ||
this._labelFormatter = d3Format(this.tooltipLabelFormat() as string); | ||
} | ||
if (this.tooltipValueFormat_exists()) { | ||
this._valueFormatter = d3Format(this.tooltipValueFormat() as string); | ||
} | ||
if (this.layerEnter) { | ||
@@ -116,7 +122,14 @@ const layerEnter = this.layerEnter; | ||
opts.label = opts.label === undefined ? "" : opts.label; | ||
if (this._labelFormatter) { | ||
opts.label = this._labelFormatter(opts.label) || ""; | ||
} else if (this.formatData && this.parseData) { | ||
opts.label = this.formatData(this.parseData(opts.label)); | ||
} | ||
opts.series = opts.series || ""; | ||
if (opts.value instanceof Date) { | ||
opts.value = opts.value || ""; | ||
} else { | ||
} else if (this._valueFormatter) { | ||
opts.value = this._valueFormatter(opts.value) || ""; | ||
} else if (this.formatValue && this.parseValue) { | ||
opts.value = this.formatValue(this.parseValue(opts.value)); | ||
} | ||
@@ -176,3 +189,6 @@ switch (this.tooltipStyle()) { | ||
tooltipFollowMouse: { (): boolean; (_: boolean): ITooltip; }; | ||
tooltipLabelFormat: (_?) => string | ITooltip; | ||
tooltipLabelFormat_exists: () => boolean; | ||
tooltipValueFormat: (_?) => string | ITooltip; | ||
tooltipValueFormat_exists: () => boolean; | ||
tooltipSeriesColor: { (): string; (_: string): ITooltip; }; | ||
@@ -188,5 +204,6 @@ tooltipLabelColor: { (): string; (_: string): ITooltip; }; | ||
ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {}); | ||
ITooltip.prototype.publish("tooltipValueFormat", ",.2f", "string", "Number format of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelFormat", undefined, "string", "Format of tooltip label(s) (the domain axis)", null, {}); | ||
ITooltip.prototype.publish("tooltipValueFormat", undefined, "string", "Number format of tooltip value(s)", null, {}); | ||
ITooltip.prototype.publish("tooltipSeriesColor", "#EAFFFF", "html-color", "Color of tooltip series text", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text", null, {}); | ||
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text (the domain axis)", null, {}); | ||
ITooltip.prototype.publish("tooltipValueColor", "white", "html-color", "Color of tooltip value(s)", null, {}); | ||
@@ -196,2 +213,11 @@ ITooltip.prototype.publish("tooltipTick", true, "boolean", "Show tooltip tick", null, {}); | ||
const tooltipLabelFormat = ITooltip.prototype.tooltipLabelFormat; | ||
ITooltip.prototype.tooltipLabelFormat = function (_?): string | ITooltip { | ||
const retVal = tooltipLabelFormat.apply(this, arguments); | ||
if (arguments.length) { | ||
this._labelFormatter = d3Format(_); | ||
} | ||
return retVal; | ||
}; | ||
const tooltipValueFormat = ITooltip.prototype.tooltipValueFormat; | ||
@@ -198,0 +224,0 @@ ITooltip.prototype.tooltipValueFormat = function (_?): string | ITooltip { |
export declare const PKG_NAME = "@hpcc-js/api"; | ||
export declare const PKG_VERSION = "2.10.1"; | ||
export declare const BUILD_VERSION = "2.103.1"; | ||
export declare const PKG_VERSION = "2.11.0"; | ||
export declare const BUILD_VERSION = "2.103.2"; | ||
//# sourceMappingURL=__package__.d.ts.map |
@@ -15,3 +15,6 @@ import "../src/ITooltip.css"; | ||
}; | ||
tooltipLabelFormat: (_?: any) => string | ITooltip; | ||
tooltipLabelFormat_exists: () => boolean; | ||
tooltipValueFormat: (_?: any) => string | ITooltip; | ||
tooltipValueFormat_exists: () => boolean; | ||
tooltipSeriesColor: { | ||
@@ -18,0 +21,0 @@ (): string; |
export declare const PKG_NAME = "@hpcc-js/api"; | ||
export declare const PKG_VERSION = "2.10.1"; | ||
export declare const BUILD_VERSION = "2.103.1"; | ||
export declare const PKG_VERSION = "2.11.0"; | ||
export declare const BUILD_VERSION = "2.103.2"; | ||
//# sourceMappingURL=__package__.d.ts.map |
@@ -15,3 +15,6 @@ import "../src/ITooltip.css"; | ||
}; | ||
tooltipLabelFormat: (_?: any) => string | ITooltip; | ||
tooltipLabelFormat_exists: () => boolean; | ||
tooltipValueFormat: (_?: any) => string | ITooltip; | ||
tooltipValueFormat_exists: () => boolean; | ||
tooltipSeriesColor: { | ||
@@ -18,0 +21,0 @@ (): string; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
278084
2590
Updated@hpcc-js/common@^2.69.0