@hpcc-js/api
Advanced tools
Comparing version 0.0.27 to 0.0.29
1327
dist/api.js
@@ -1,2 +0,6 @@ | ||
define(['exports', '@hpcc-js/common', '@hpcc-js/common-vendor', '@hpcc-js/api-vendor'], function (exports, _hpccJs_common, tslib_1, _tip) { 'use strict'; | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common'], factory) : | ||
(factory((global['@hpcc-js/api'] = global['@hpcc-js/api'] || {}),global['@hpcc-js/common'])); | ||
}(this, (function (exports,tslib_1) { 'use strict'; | ||
@@ -20,7 +24,5 @@ function __$styleInject(css, returnValue) { | ||
var _tip__default = _tip['default']; | ||
function I1DChart() { | ||
} | ||
I1DChart.prototype._palette = _hpccJs_common.Palette.rainbow("default"); | ||
I1DChart.prototype._palette = tslib_1.Palette.rainbow("default"); | ||
// Events --- | ||
@@ -36,3 +38,3 @@ I1DChart.prototype.click = function (row, column, selected) { | ||
} | ||
I2DChart.prototype._palette = _hpccJs_common.Palette.ordinal("default"); | ||
I2DChart.prototype._palette = tslib_1.Palette.ordinal("default"); | ||
// Events --- | ||
@@ -123,3 +125,3 @@ I2DChart.prototype.click = function (row, column, selected) { | ||
return IInput; | ||
}(_hpccJs_common.Widget)); | ||
}(tslib_1.Widget)); | ||
IInput.prototype.publish("name", "", "string", "HTML name for the input"); | ||
@@ -132,3 +134,3 @@ IInput.prototype.publish("label", "", "string", "Descriptive label"); | ||
} | ||
INDChart.prototype._palette = _hpccJs_common.Palette.ordinal("default"); | ||
INDChart.prototype._palette = tslib_1.Palette.ordinal("default"); | ||
// Events --- | ||
@@ -142,5 +144,1306 @@ INDChart.prototype.click = function (row, column, selected) { | ||
var xhtml = "http://www.w3.org/1999/xhtml"; | ||
var namespaces = { | ||
svg: "http://www.w3.org/2000/svg", | ||
xhtml: xhtml, | ||
xlink: "http://www.w3.org/1999/xlink", | ||
xml: "http://www.w3.org/XML/1998/namespace", | ||
xmlns: "http://www.w3.org/2000/xmlns/" | ||
}; | ||
var namespace = function(name) { | ||
var prefix = name += "", i = prefix.indexOf(":"); | ||
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); | ||
return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; | ||
}; | ||
function creatorInherit(name) { | ||
return function() { | ||
var document = this.ownerDocument, | ||
uri = this.namespaceURI; | ||
return uri === xhtml && document.documentElement.namespaceURI === xhtml | ||
? document.createElement(name) | ||
: document.createElementNS(uri, name); | ||
}; | ||
} | ||
function creatorFixed(fullname) { | ||
return function() { | ||
return this.ownerDocument.createElementNS(fullname.space, fullname.local); | ||
}; | ||
} | ||
var creator = function(name) { | ||
var fullname = namespace(name); | ||
return (fullname.local | ||
? creatorFixed | ||
: creatorInherit)(fullname); | ||
}; | ||
var matcher = function(selector) { | ||
return function() { | ||
return this.matches(selector); | ||
}; | ||
}; | ||
if (typeof document !== "undefined") { | ||
var element = document.documentElement; | ||
if (!element.matches) { | ||
var vendorMatches = element.webkitMatchesSelector | ||
|| element.msMatchesSelector | ||
|| element.mozMatchesSelector | ||
|| element.oMatchesSelector; | ||
matcher = function(selector) { | ||
return function() { | ||
return vendorMatches.call(this, selector); | ||
}; | ||
}; | ||
} | ||
} | ||
var matcher$1 = matcher; | ||
var filterEvents = {}; | ||
var event$1 = null; | ||
if (typeof document !== "undefined") { | ||
var element$1 = document.documentElement; | ||
if (!("onmouseenter" in element$1)) { | ||
filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"}; | ||
} | ||
} | ||
function filterContextListener(listener, index, group) { | ||
listener = contextListener(listener, index, group); | ||
return function(event) { | ||
var related = event.relatedTarget; | ||
if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) { | ||
listener.call(this, event); | ||
} | ||
}; | ||
} | ||
function contextListener(listener, index, group) { | ||
return function(event1) { | ||
var event0 = event$1; // Events can be reentrant (e.g., focus). | ||
event$1 = event1; | ||
try { | ||
listener.call(this, this.__data__, index, group); | ||
} finally { | ||
event$1 = event0; | ||
} | ||
}; | ||
} | ||
function parseTypenames(typenames) { | ||
return typenames.trim().split(/^|\s+/).map(function(t) { | ||
var name = "", i = t.indexOf("."); | ||
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); | ||
return {type: t, name: name}; | ||
}); | ||
} | ||
function onRemove(typename) { | ||
return function() { | ||
var on = this.__on; | ||
if (!on) return; | ||
for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { | ||
if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { | ||
this.removeEventListener(o.type, o.listener, o.capture); | ||
} else { | ||
on[++i] = o; | ||
} | ||
} | ||
if (++i) on.length = i; | ||
else delete this.__on; | ||
}; | ||
} | ||
function onAdd(typename, value, capture) { | ||
var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener; | ||
return function(d, i, group) { | ||
var on = this.__on, o, listener = wrap(value, i, group); | ||
if (on) for (var j = 0, m = on.length; j < m; ++j) { | ||
if ((o = on[j]).type === typename.type && o.name === typename.name) { | ||
this.removeEventListener(o.type, o.listener, o.capture); | ||
this.addEventListener(o.type, o.listener = listener, o.capture = capture); | ||
o.value = value; | ||
return; | ||
} | ||
} | ||
this.addEventListener(typename.type, listener, capture); | ||
o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture}; | ||
if (!on) this.__on = [o]; | ||
else on.push(o); | ||
}; | ||
} | ||
var selection_on = function(typename, value, capture) { | ||
var typenames = parseTypenames(typename + ""), i, n = typenames.length, t; | ||
if (arguments.length < 2) { | ||
var on = this.node().__on; | ||
if (on) for (var j = 0, m = on.length, o; j < m; ++j) { | ||
for (i = 0, o = on[j]; i < n; ++i) { | ||
if ((t = typenames[i]).type === o.type && t.name === o.name) { | ||
return o.value; | ||
} | ||
} | ||
} | ||
return; | ||
} | ||
on = value ? onAdd : onRemove; | ||
if (capture == null) capture = false; | ||
for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture)); | ||
return this; | ||
}; | ||
function none() {} | ||
var selector = function(selector) { | ||
return selector == null ? none : function() { | ||
return this.querySelector(selector); | ||
}; | ||
}; | ||
var selection_select = function(select) { | ||
if (typeof select !== "function") select = selector(select); | ||
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { | ||
if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { | ||
if ("__data__" in node) subnode.__data__ = node.__data__; | ||
subgroup[i] = subnode; | ||
} | ||
} | ||
} | ||
return new Selection(subgroups, this._parents); | ||
}; | ||
function empty() { | ||
return []; | ||
} | ||
var selectorAll = function(selector) { | ||
return selector == null ? empty : function() { | ||
return this.querySelectorAll(selector); | ||
}; | ||
}; | ||
var selection_selectAll = function(select) { | ||
if (typeof select !== "function") select = selectorAll(select); | ||
for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { | ||
for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { | ||
if (node = group[i]) { | ||
subgroups.push(select.call(node, node.__data__, i, group)); | ||
parents.push(node); | ||
} | ||
} | ||
} | ||
return new Selection(subgroups, parents); | ||
}; | ||
var selection_filter = function(match) { | ||
if (typeof match !== "function") match = matcher$1(match); | ||
for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { | ||
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { | ||
if ((node = group[i]) && match.call(node, node.__data__, i, group)) { | ||
subgroup.push(node); | ||
} | ||
} | ||
} | ||
return new Selection(subgroups, this._parents); | ||
}; | ||
var sparse = function(update) { | ||
return new Array(update.length); | ||
}; | ||
var selection_enter = function() { | ||
return new Selection(this._enter || this._groups.map(sparse), this._parents); | ||
}; | ||
function EnterNode(parent, datum) { | ||
this.ownerDocument = parent.ownerDocument; | ||
this.namespaceURI = parent.namespaceURI; | ||
this._next = null; | ||
this._parent = parent; | ||
this.__data__ = datum; | ||
} | ||
EnterNode.prototype = { | ||
constructor: EnterNode, | ||
appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, | ||
insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, | ||
querySelector: function(selector) { return this._parent.querySelector(selector); }, | ||
querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } | ||
}; | ||
var constant = function(x) { | ||
return function() { | ||
return x; | ||
}; | ||
}; | ||
var keyPrefix = "$"; // Protect against keys like “__proto__”. | ||
function bindIndex(parent, group, enter, update, exit, data) { | ||
var i = 0, | ||
node, | ||
groupLength = group.length, | ||
dataLength = data.length; | ||
// Put any non-null nodes that fit into update. | ||
// Put any null nodes into enter. | ||
// Put any remaining data into enter. | ||
for (; i < dataLength; ++i) { | ||
if (node = group[i]) { | ||
node.__data__ = data[i]; | ||
update[i] = node; | ||
} else { | ||
enter[i] = new EnterNode(parent, data[i]); | ||
} | ||
} | ||
// Put any non-null nodes that don’t fit into exit. | ||
for (; i < groupLength; ++i) { | ||
if (node = group[i]) { | ||
exit[i] = node; | ||
} | ||
} | ||
} | ||
function bindKey(parent, group, enter, update, exit, data, key) { | ||
var i, | ||
node, | ||
nodeByKeyValue = {}, | ||
groupLength = group.length, | ||
dataLength = data.length, | ||
keyValues = new Array(groupLength), | ||
keyValue; | ||
// Compute the key for each node. | ||
// If multiple nodes have the same key, the duplicates are added to exit. | ||
for (i = 0; i < groupLength; ++i) { | ||
if (node = group[i]) { | ||
keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group); | ||
if (keyValue in nodeByKeyValue) { | ||
exit[i] = node; | ||
} else { | ||
nodeByKeyValue[keyValue] = node; | ||
} | ||
} | ||
} | ||
// Compute the key for each datum. | ||
// If there a node associated with this key, join and add it to update. | ||
// If there is not (or the key is a duplicate), add it to enter. | ||
for (i = 0; i < dataLength; ++i) { | ||
keyValue = keyPrefix + key.call(parent, data[i], i, data); | ||
if (node = nodeByKeyValue[keyValue]) { | ||
update[i] = node; | ||
node.__data__ = data[i]; | ||
nodeByKeyValue[keyValue] = null; | ||
} else { | ||
enter[i] = new EnterNode(parent, data[i]); | ||
} | ||
} | ||
// Add any remaining nodes that were not bound to data to exit. | ||
for (i = 0; i < groupLength; ++i) { | ||
if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) { | ||
exit[i] = node; | ||
} | ||
} | ||
} | ||
var selection_data = function(value, key) { | ||
if (!value) { | ||
data = new Array(this.size()), j = -1; | ||
this.each(function(d) { data[++j] = d; }); | ||
return data; | ||
} | ||
var bind = key ? bindKey : bindIndex, | ||
parents = this._parents, | ||
groups = this._groups; | ||
if (typeof value !== "function") value = constant(value); | ||
for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { | ||
var parent = parents[j], | ||
group = groups[j], | ||
groupLength = group.length, | ||
data = value.call(parent, parent && parent.__data__, j, parents), | ||
dataLength = data.length, | ||
enterGroup = enter[j] = new Array(dataLength), | ||
updateGroup = update[j] = new Array(dataLength), | ||
exitGroup = exit[j] = new Array(groupLength); | ||
bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); | ||
// Now connect the enter nodes to their following update node, such that | ||
// appendChild can insert the materialized enter node before this node, | ||
// rather than at the end of the parent node. | ||
for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { | ||
if (previous = enterGroup[i0]) { | ||
if (i0 >= i1) i1 = i0 + 1; | ||
while (!(next = updateGroup[i1]) && ++i1 < dataLength); | ||
previous._next = next || null; | ||
} | ||
} | ||
} | ||
update = new Selection(update, parents); | ||
update._enter = enter; | ||
update._exit = exit; | ||
return update; | ||
}; | ||
var selection_exit = function() { | ||
return new Selection(this._exit || this._groups.map(sparse), this._parents); | ||
}; | ||
var selection_merge = function(selection$$1) { | ||
for (var groups0 = this._groups, groups1 = selection$$1._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { | ||
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { | ||
if (node = group0[i] || group1[i]) { | ||
merge[i] = node; | ||
} | ||
} | ||
} | ||
for (; j < m0; ++j) { | ||
merges[j] = groups0[j]; | ||
} | ||
return new Selection(merges, this._parents); | ||
}; | ||
var selection_order = function() { | ||
for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { | ||
for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { | ||
if (node = group[i]) { | ||
if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next); | ||
next = node; | ||
} | ||
} | ||
} | ||
return this; | ||
}; | ||
var selection_sort = function(compare) { | ||
if (!compare) compare = ascending; | ||
function compareNode(a, b) { | ||
return a && b ? compare(a.__data__, b.__data__) : !a - !b; | ||
} | ||
for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { | ||
for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { | ||
if (node = group[i]) { | ||
sortgroup[i] = node; | ||
} | ||
} | ||
sortgroup.sort(compareNode); | ||
} | ||
return new Selection(sortgroups, this._parents).order(); | ||
}; | ||
function ascending(a, b) { | ||
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; | ||
} | ||
var selection_call = function() { | ||
var callback = arguments[0]; | ||
arguments[0] = this; | ||
callback.apply(null, arguments); | ||
return this; | ||
}; | ||
var selection_nodes = function() { | ||
var nodes = new Array(this.size()), i = -1; | ||
this.each(function() { nodes[++i] = this; }); | ||
return nodes; | ||
}; | ||
var selection_node = function() { | ||
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { | ||
for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { | ||
var node = group[i]; | ||
if (node) return node; | ||
} | ||
} | ||
return null; | ||
}; | ||
var selection_size = function() { | ||
var size = 0; | ||
this.each(function() { ++size; }); | ||
return size; | ||
}; | ||
var selection_empty = function() { | ||
return !this.node(); | ||
}; | ||
var selection_each = function(callback) { | ||
for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { | ||
for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { | ||
if (node = group[i]) callback.call(node, node.__data__, i, group); | ||
} | ||
} | ||
return this; | ||
}; | ||
function attrRemove(name) { | ||
return function() { | ||
this.removeAttribute(name); | ||
}; | ||
} | ||
function attrRemoveNS(fullname) { | ||
return function() { | ||
this.removeAttributeNS(fullname.space, fullname.local); | ||
}; | ||
} | ||
function attrConstant(name, value) { | ||
return function() { | ||
this.setAttribute(name, value); | ||
}; | ||
} | ||
function attrConstantNS(fullname, value) { | ||
return function() { | ||
this.setAttributeNS(fullname.space, fullname.local, value); | ||
}; | ||
} | ||
function attrFunction(name, value) { | ||
return function() { | ||
var v = value.apply(this, arguments); | ||
if (v == null) this.removeAttribute(name); | ||
else this.setAttribute(name, v); | ||
}; | ||
} | ||
function attrFunctionNS(fullname, value) { | ||
return function() { | ||
var v = value.apply(this, arguments); | ||
if (v == null) this.removeAttributeNS(fullname.space, fullname.local); | ||
else this.setAttributeNS(fullname.space, fullname.local, v); | ||
}; | ||
} | ||
var selection_attr = function(name, value) { | ||
var fullname = namespace(name); | ||
if (arguments.length < 2) { | ||
var node = this.node(); | ||
return fullname.local | ||
? node.getAttributeNS(fullname.space, fullname.local) | ||
: node.getAttribute(fullname); | ||
} | ||
return this.each((value == null | ||
? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" | ||
? (fullname.local ? attrFunctionNS : attrFunction) | ||
: (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); | ||
}; | ||
var defaultView = function(node) { | ||
return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node | ||
|| (node.document && node) // node is a Window | ||
|| node.defaultView; // node is a Document | ||
}; | ||
function styleRemove(name) { | ||
return function() { | ||
this.style.removeProperty(name); | ||
}; | ||
} | ||
function styleConstant(name, value, priority) { | ||
return function() { | ||
this.style.setProperty(name, value, priority); | ||
}; | ||
} | ||
function styleFunction(name, value, priority) { | ||
return function() { | ||
var v = value.apply(this, arguments); | ||
if (v == null) this.style.removeProperty(name); | ||
else this.style.setProperty(name, v, priority); | ||
}; | ||
} | ||
var selection_style = function(name, value, priority) { | ||
return arguments.length > 1 | ||
? this.each((value == null | ||
? styleRemove : typeof value === "function" | ||
? styleFunction | ||
: styleConstant)(name, value, priority == null ? "" : priority)) | ||
: styleValue(this.node(), name); | ||
}; | ||
function styleValue(node, name) { | ||
return node.style.getPropertyValue(name) | ||
|| defaultView(node).getComputedStyle(node, null).getPropertyValue(name); | ||
} | ||
function propertyRemove(name) { | ||
return function() { | ||
delete this[name]; | ||
}; | ||
} | ||
function propertyConstant(name, value) { | ||
return function() { | ||
this[name] = value; | ||
}; | ||
} | ||
function propertyFunction(name, value) { | ||
return function() { | ||
var v = value.apply(this, arguments); | ||
if (v == null) delete this[name]; | ||
else this[name] = v; | ||
}; | ||
} | ||
var selection_property = function(name, value) { | ||
return arguments.length > 1 | ||
? this.each((value == null | ||
? propertyRemove : typeof value === "function" | ||
? propertyFunction | ||
: propertyConstant)(name, value)) | ||
: this.node()[name]; | ||
}; | ||
function classArray(string) { | ||
return string.trim().split(/^|\s+/); | ||
} | ||
function classList(node) { | ||
return node.classList || new ClassList(node); | ||
} | ||
function ClassList(node) { | ||
this._node = node; | ||
this._names = classArray(node.getAttribute("class") || ""); | ||
} | ||
ClassList.prototype = { | ||
add: function(name) { | ||
var i = this._names.indexOf(name); | ||
if (i < 0) { | ||
this._names.push(name); | ||
this._node.setAttribute("class", this._names.join(" ")); | ||
} | ||
}, | ||
remove: function(name) { | ||
var i = this._names.indexOf(name); | ||
if (i >= 0) { | ||
this._names.splice(i, 1); | ||
this._node.setAttribute("class", this._names.join(" ")); | ||
} | ||
}, | ||
contains: function(name) { | ||
return this._names.indexOf(name) >= 0; | ||
} | ||
}; | ||
function classedAdd(node, names) { | ||
var list = classList(node), i = -1, n = names.length; | ||
while (++i < n) list.add(names[i]); | ||
} | ||
function classedRemove(node, names) { | ||
var list = classList(node), i = -1, n = names.length; | ||
while (++i < n) list.remove(names[i]); | ||
} | ||
function classedTrue(names) { | ||
return function() { | ||
classedAdd(this, names); | ||
}; | ||
} | ||
function classedFalse(names) { | ||
return function() { | ||
classedRemove(this, names); | ||
}; | ||
} | ||
function classedFunction(names, value) { | ||
return function() { | ||
(value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); | ||
}; | ||
} | ||
var selection_classed = function(name, value) { | ||
var names = classArray(name + ""); | ||
if (arguments.length < 2) { | ||
var list = classList(this.node()), i = -1, n = names.length; | ||
while (++i < n) if (!list.contains(names[i])) return false; | ||
return true; | ||
} | ||
return this.each((typeof value === "function" | ||
? classedFunction : value | ||
? classedTrue | ||
: classedFalse)(names, value)); | ||
}; | ||
function textRemove() { | ||
this.textContent = ""; | ||
} | ||
function textConstant(value) { | ||
return function() { | ||
this.textContent = value; | ||
}; | ||
} | ||
function textFunction(value) { | ||
return function() { | ||
var v = value.apply(this, arguments); | ||
this.textContent = v == null ? "" : v; | ||
}; | ||
} | ||
var selection_text = function(value) { | ||
return arguments.length | ||
? this.each(value == null | ||
? textRemove : (typeof value === "function" | ||
? textFunction | ||
: textConstant)(value)) | ||
: this.node().textContent; | ||
}; | ||
function htmlRemove() { | ||
this.innerHTML = ""; | ||
} | ||
function htmlConstant(value) { | ||
return function() { | ||
this.innerHTML = value; | ||
}; | ||
} | ||
function htmlFunction(value) { | ||
return function() { | ||
var v = value.apply(this, arguments); | ||
this.innerHTML = v == null ? "" : v; | ||
}; | ||
} | ||
var selection_html = function(value) { | ||
return arguments.length | ||
? this.each(value == null | ||
? htmlRemove : (typeof value === "function" | ||
? htmlFunction | ||
: htmlConstant)(value)) | ||
: this.node().innerHTML; | ||
}; | ||
function raise() { | ||
if (this.nextSibling) this.parentNode.appendChild(this); | ||
} | ||
var selection_raise = function() { | ||
return this.each(raise); | ||
}; | ||
function lower() { | ||
if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); | ||
} | ||
var selection_lower = function() { | ||
return this.each(lower); | ||
}; | ||
var selection_append = function(name) { | ||
var create = typeof name === "function" ? name : creator(name); | ||
return this.select(function() { | ||
return this.appendChild(create.apply(this, arguments)); | ||
}); | ||
}; | ||
function constantNull() { | ||
return null; | ||
} | ||
var selection_insert = function(name, before) { | ||
var create = typeof name === "function" ? name : creator(name), | ||
select = before == null ? constantNull : typeof before === "function" ? before : selector(before); | ||
return this.select(function() { | ||
return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); | ||
}); | ||
}; | ||
function remove() { | ||
var parent = this.parentNode; | ||
if (parent) parent.removeChild(this); | ||
} | ||
var selection_remove = function() { | ||
return this.each(remove); | ||
}; | ||
var selection_datum = function(value) { | ||
return arguments.length | ||
? this.property("__data__", value) | ||
: this.node().__data__; | ||
}; | ||
function dispatchEvent(node, type, params) { | ||
var window = defaultView(node), | ||
event = window.CustomEvent; | ||
if (typeof event === "function") { | ||
event = new event(type, params); | ||
} else { | ||
event = window.document.createEvent("Event"); | ||
if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; | ||
else event.initEvent(type, false, false); | ||
} | ||
node.dispatchEvent(event); | ||
} | ||
function dispatchConstant(type, params) { | ||
return function() { | ||
return dispatchEvent(this, type, params); | ||
}; | ||
} | ||
function dispatchFunction(type, params) { | ||
return function() { | ||
return dispatchEvent(this, type, params.apply(this, arguments)); | ||
}; | ||
} | ||
var selection_dispatch = function(type, params) { | ||
return this.each((typeof params === "function" | ||
? dispatchFunction | ||
: dispatchConstant)(type, params)); | ||
}; | ||
var root = [null]; | ||
function Selection(groups, parents) { | ||
this._groups = groups; | ||
this._parents = parents; | ||
} | ||
function selection() { | ||
return new Selection([[document.documentElement]], root); | ||
} | ||
Selection.prototype = selection.prototype = { | ||
constructor: Selection, | ||
select: selection_select, | ||
selectAll: selection_selectAll, | ||
filter: selection_filter, | ||
data: selection_data, | ||
enter: selection_enter, | ||
exit: selection_exit, | ||
merge: selection_merge, | ||
order: selection_order, | ||
sort: selection_sort, | ||
call: selection_call, | ||
nodes: selection_nodes, | ||
node: selection_node, | ||
size: selection_size, | ||
empty: selection_empty, | ||
each: selection_each, | ||
attr: selection_attr, | ||
style: selection_style, | ||
property: selection_property, | ||
classed: selection_classed, | ||
text: selection_text, | ||
html: selection_html, | ||
raise: selection_raise, | ||
lower: selection_lower, | ||
append: selection_append, | ||
insert: selection_insert, | ||
remove: selection_remove, | ||
datum: selection_datum, | ||
on: selection_on, | ||
dispatch: selection_dispatch | ||
}; | ||
var select = function(selector) { | ||
return typeof selector === "string" | ||
? new Selection([[document.querySelector(selector)]], [document.documentElement]) | ||
: new Selection([[selector]], root); | ||
}; | ||
var prefix = "$"; | ||
function Map() {} | ||
Map.prototype = map.prototype = { | ||
constructor: Map, | ||
has: function(key) { | ||
return (prefix + key) in this; | ||
}, | ||
get: function(key) { | ||
return this[prefix + key]; | ||
}, | ||
set: function(key, value) { | ||
this[prefix + key] = value; | ||
return this; | ||
}, | ||
remove: function(key) { | ||
var property = prefix + key; | ||
return property in this && delete this[property]; | ||
}, | ||
clear: function() { | ||
for (var property in this) if (property[0] === prefix) delete this[property]; | ||
}, | ||
keys: function() { | ||
var keys = []; | ||
for (var property in this) if (property[0] === prefix) keys.push(property.slice(1)); | ||
return keys; | ||
}, | ||
values: function() { | ||
var values = []; | ||
for (var property in this) if (property[0] === prefix) values.push(this[property]); | ||
return values; | ||
}, | ||
entries: function() { | ||
var entries = []; | ||
for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]}); | ||
return entries; | ||
}, | ||
size: function() { | ||
var size = 0; | ||
for (var property in this) if (property[0] === prefix) ++size; | ||
return size; | ||
}, | ||
empty: function() { | ||
for (var property in this) if (property[0] === prefix) return false; | ||
return true; | ||
}, | ||
each: function(f) { | ||
for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this); | ||
} | ||
}; | ||
function map(object, f) { | ||
var map = new Map; | ||
// Copy constructor. | ||
if (object instanceof Map) object.each(function(value, key) { map.set(key, value); }); | ||
// Index array by numeric index or specified key function. | ||
else if (Array.isArray(object)) { | ||
var i = -1, | ||
n = object.length, | ||
o; | ||
if (f == null) while (++i < n) map.set(i, object[i]); | ||
else while (++i < n) map.set(f(o = object[i], i, object), o); | ||
} | ||
// Convert object to map. | ||
else if (object) for (var key in object) map.set(key, object[key]); | ||
return map; | ||
} | ||
function Set() {} | ||
var proto = map.prototype; | ||
Set.prototype = set.prototype = { | ||
constructor: Set, | ||
has: proto.has, | ||
add: function(value) { | ||
value += ""; | ||
this[prefix + value] = value; | ||
return this; | ||
}, | ||
remove: proto.remove, | ||
clear: proto.clear, | ||
values: proto.keys, | ||
size: proto.size, | ||
empty: proto.empty, | ||
each: proto.each | ||
}; | ||
function set(object, f) { | ||
var set = new Set; | ||
// Copy constructor. | ||
if (object instanceof Set) object.each(function(value) { set.add(value); }); | ||
// Otherwise, assume it’s an array. | ||
else if (object) { | ||
var i = -1, n = object.length; | ||
if (f == null) while (++i < n) set.add(object[i]); | ||
else while (++i < n) set.add(f(object[i], i, object)); | ||
} | ||
return set; | ||
} | ||
/** | ||
* d3.tip | ||
* Copyright (c) 2013-2017 Justin Palmer | ||
* | ||
* Tooltips for d3.js SVG visualizations | ||
*/ | ||
// eslint-disable-next-line no-extra-semi | ||
// Public - contructs a new tooltip | ||
// | ||
// Returns a tip | ||
function tip$1() { | ||
var direction = d3TipDirection, | ||
offset = d3TipOffset, | ||
html = d3TipHTML, | ||
rootElement = functor(document.body), | ||
node = initNode(), | ||
svg = null, | ||
point = null, | ||
target = null; | ||
function tip(vis) { | ||
svg = getSVGNode(vis); | ||
if (!svg) return | ||
point = svg.createSVGPoint(); | ||
rootElement().appendChild(node); | ||
} | ||
// Public - show the tooltip on the screen | ||
// | ||
// Returns a tip | ||
tip.show = function() { | ||
var args = Array.prototype.slice.call(arguments); | ||
if (args[args.length - 1] instanceof SVGElement) target = args.pop(); | ||
var content = html.apply(this, args), | ||
poffset = offset.apply(this, args), | ||
dir = direction.apply(this, args), | ||
nodel = getNodeEl(), | ||
i = directions.length, | ||
coords, | ||
scrollTop = document.documentElement.scrollTop || | ||
rootElement().scrollTop, | ||
scrollLeft = document.documentElement.scrollLeft || | ||
rootElement().scrollLeft; | ||
nodel.html(content) | ||
.style('opacity', 1).style('pointer-events', 'all'); | ||
while (i--) nodel.classed(directions[i], false); | ||
coords = directionCallbacks.get(dir).apply(this); | ||
nodel.classed(dir, true) | ||
.style('top', (coords.top + poffset[0]) + scrollTop + 'px') | ||
.style('left', (coords.left + poffset[1]) + scrollLeft + 'px'); | ||
return tip | ||
}; | ||
// Public - hide the tooltip | ||
// | ||
// Returns a tip | ||
tip.hide = function() { | ||
var nodel = getNodeEl(); | ||
nodel.style('opacity', 0).style('pointer-events', 'none'); | ||
return tip | ||
}; | ||
// Public: Proxy attr calls to the d3 tip container. | ||
// Sets or gets attribute value. | ||
// | ||
// n - name of the attribute | ||
// v - value of the attribute | ||
// | ||
// Returns tip or attribute value | ||
// eslint-disable-next-line no-unused-vars | ||
tip.attr = function(n, v) { | ||
if (arguments.length < 2 && typeof n === 'string') { | ||
return getNodeEl().attr(n) | ||
} | ||
var args = Array.prototype.slice.call(arguments); | ||
selection.prototype.attr.apply(getNodeEl(), args); | ||
return tip | ||
}; | ||
// Public: Proxy style calls to the d3 tip container. | ||
// Sets or gets a style value. | ||
// | ||
// n - name of the property | ||
// v - value of the property | ||
// | ||
// Returns tip or style property value | ||
// eslint-disable-next-line no-unused-vars | ||
tip.style = function(n, v) { | ||
if (arguments.length < 2 && typeof n === 'string') { | ||
return getNodeEl().style(n) | ||
} | ||
var args = Array.prototype.slice.call(arguments); | ||
selection.prototype.style.apply(getNodeEl(), args); | ||
return tip | ||
}; | ||
// Public: Set or get the direction of the tooltip | ||
// | ||
// v - One of n(north), s(south), e(east), or w(west), nw(northwest), | ||
// sw(southwest), ne(northeast) or se(southeast) | ||
// | ||
// Returns tip or direction | ||
tip.direction = function(v) { | ||
if (!arguments.length) return direction | ||
direction = v == null ? v : functor(v); | ||
return tip | ||
}; | ||
// Public: Sets or gets the offset of the tip | ||
// | ||
// v - Array of [x, y] offset | ||
// | ||
// Returns offset or | ||
tip.offset = function(v) { | ||
if (!arguments.length) return offset | ||
offset = v == null ? v : functor(v); | ||
return tip | ||
}; | ||
// Public: sets or gets the html value of the tooltip | ||
// | ||
// v - String value of the tip | ||
// | ||
// Returns html value or tip | ||
tip.html = function(v) { | ||
if (!arguments.length) return html | ||
html = v == null ? v : functor(v); | ||
return tip | ||
}; | ||
// Public: sets or gets the root element anchor of the tooltip | ||
// | ||
// v - root element of the tooltip | ||
// | ||
// Returns root node of tip | ||
tip.rootElement = function(v) { | ||
if (!arguments.length) return rootElement | ||
rootElement = v == null ? v : functor(v); | ||
return tip | ||
}; | ||
// Public: destroys the tooltip and removes it from the DOM | ||
// | ||
// Returns a tip | ||
tip.destroy = function() { | ||
if (node) { | ||
getNodeEl().remove(); | ||
node = null; | ||
} | ||
return tip | ||
}; | ||
function d3TipDirection() { return 'n' } | ||
function d3TipOffset() { return [0, 0] } | ||
function d3TipHTML() { return ' ' } | ||
var directionCallbacks = map({ | ||
n: directionNorth, | ||
s: directionSouth, | ||
e: directionEast, | ||
w: directionWest, | ||
nw: directionNorthWest, | ||
ne: directionNorthEast, | ||
sw: directionSouthWest, | ||
se: directionSouthEast | ||
}), | ||
directions = directionCallbacks.keys(); | ||
function directionNorth() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.n.y - node.offsetHeight, | ||
left: bbox.n.x - node.offsetWidth / 2 | ||
} | ||
} | ||
function directionSouth() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.s.y, | ||
left: bbox.s.x - node.offsetWidth / 2 | ||
} | ||
} | ||
function directionEast() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.e.y - node.offsetHeight / 2, | ||
left: bbox.e.x | ||
} | ||
} | ||
function directionWest() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.w.y - node.offsetHeight / 2, | ||
left: bbox.w.x - node.offsetWidth | ||
} | ||
} | ||
function directionNorthWest() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.nw.y - node.offsetHeight, | ||
left: bbox.nw.x - node.offsetWidth | ||
} | ||
} | ||
function directionNorthEast() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.ne.y - node.offsetHeight, | ||
left: bbox.ne.x | ||
} | ||
} | ||
function directionSouthWest() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.sw.y, | ||
left: bbox.sw.x - node.offsetWidth | ||
} | ||
} | ||
function directionSouthEast() { | ||
var bbox = getScreenBBox(); | ||
return { | ||
top: bbox.se.y, | ||
left: bbox.se.x | ||
} | ||
} | ||
function initNode() { | ||
var div = select(document.createElement('div')); | ||
div | ||
.style('position', 'absolute') | ||
.style('top', 0) | ||
.style('opacity', 0) | ||
.style('pointer-events', 'none') | ||
.style('box-sizing', 'border-box'); | ||
return div.node() | ||
} | ||
function getSVGNode(element) { | ||
var svgNode = element.node(); | ||
if (!svgNode) return null | ||
if (svgNode.tagName.toLowerCase() === 'svg') return svgNode | ||
return svgNode.ownerSVGElement | ||
} | ||
function getNodeEl() { | ||
if (node == null) { | ||
node = initNode(); | ||
// re-add node to DOM | ||
rootElement().appendChild(node); | ||
} | ||
return select(node) | ||
} | ||
// Private - gets the screen coordinates of a shape | ||
// | ||
// Given a shape on the screen, will return an SVGPoint for the directions | ||
// n(north), s(south), e(east), w(west), ne(northeast), se(southeast), | ||
// nw(northwest), sw(southwest). | ||
// | ||
// +-+-+ | ||
// | | | ||
// + + | ||
// | | | ||
// +-+-+ | ||
// | ||
// Returns an Object {n, s, e, w, nw, sw, ne, se} | ||
function getScreenBBox() { | ||
var targetel = target || event.target; | ||
while (targetel.getScreenCTM == null && targetel.parentNode == null) { | ||
targetel = targetel.parentNode; | ||
} | ||
var bbox = {}, | ||
matrix = targetel.getScreenCTM(), | ||
tbbox = targetel.getBBox(), | ||
width = tbbox.width, | ||
height = tbbox.height, | ||
x = tbbox.x, | ||
y = tbbox.y; | ||
point.x = x; | ||
point.y = y; | ||
bbox.nw = point.matrixTransform(matrix); | ||
point.x += width; | ||
bbox.ne = point.matrixTransform(matrix); | ||
point.y += height; | ||
bbox.se = point.matrixTransform(matrix); | ||
point.x -= width; | ||
bbox.sw = point.matrixTransform(matrix); | ||
point.y -= height / 2; | ||
bbox.w = point.matrixTransform(matrix); | ||
point.x += width; | ||
bbox.e = point.matrixTransform(matrix); | ||
point.x -= width / 2; | ||
point.y -= height / 2; | ||
bbox.n = point.matrixTransform(matrix); | ||
point.y += height; | ||
bbox.s = point.matrixTransform(matrix); | ||
return bbox | ||
} | ||
// Private - replace D3JS 3.X d3.functor() function | ||
function functor(v) { | ||
return typeof v === 'function' ? v : function() { | ||
return v | ||
} | ||
} | ||
return tip | ||
} | ||
var _tip = Object.freeze({ | ||
tip: tip$1 | ||
}); | ||
__$styleInject(".d3-tip {\r\n line-height: 1;\r\n font-weight: bold;\r\n padding: 12px;\r\n background: rgba(0, 0, 0, 0.66);\r\n color: #fff;\r\n border-radius: 2px;\r\n pointer-events: none !important;\r\n z-index:10;\r\n}\r\n\r\n.d3-tip.hidden {\r\n visibility:hidden;\r\n}\r\n\r\n/* Creates a small triangle extender for the tooltip */\r\n.d3-tip:after {\r\n box-sizing: border-box;\r\n display: inline;\r\n font-size: 10px;\r\n width: 100%;\r\n line-height: 1;\r\n color: rgba(0, 0, 0, 0.66);\r\n position: absolute;\r\n pointer-events: none !important;\r\n}\r\n\r\n/* Northward tooltips */\r\n.d3-tip.n:after {\r\n content: \"\\25BC\";\r\n margin: -1px 0 0 0;\r\n top: 100%;\r\n left: 0;\r\n text-align: center;\r\n}\r\n\r\n/* Eastward tooltips */\r\n.d3-tip.e:after {\r\n content: \"\\25C0\";\r\n margin: -4px 0 0 0;\r\n top: 50%;\r\n left: -8px;\r\n}\r\n\r\n/* Southward tooltips */\r\n.d3-tip.s:after {\r\n content: \"\\25B2\";\r\n margin: 0 0 1px 0;\r\n top: -8px;\r\n left: 0;\r\n text-align: center;\r\n}\r\n\r\n/* Westward tooltips */\r\n.d3-tip.w:after {\r\n content: \"\\25B6\";\r\n margin: -4px 0 0 -1px;\r\n top: 50%;\r\n left: 100%;\r\n}\r\n\r\n.d3-tip.notick:after {\r\n content: \"\" !important;\r\n}\r\n\r\n.common_Widget .over {\r\n stroke: rgba(0, 0, 0, 0.66);\r\n opacity: 0.66;\r\n}\r\n",undefined); | ||
var tip$1 = _tip.tip || _tip__default || _tip; | ||
var tip = tip$1 || undefined || _tip; | ||
var ITooltip = (function (_super) { | ||
@@ -189,3 +1492,3 @@ tslib_1.__extends(ITooltip, _super); | ||
var context = this; | ||
this.tooltip = tip$1() | ||
this.tooltip = tip() | ||
.attr("class", "d3-tip") | ||
@@ -240,3 +1543,3 @@ .offset(function () { | ||
return ITooltip; | ||
}(_hpccJs_common.Widget)); | ||
}(tslib_1.Widget)); | ||
ITooltip.prototype.publish("tooltipStyle", "default", "set", "Style", ["default", "none"], {}); | ||
@@ -270,3 +1573,3 @@ ITooltip.prototype.publish("tooltipValueFormat", ",.2f", "string", "Value Format", null, {}); | ||
}()); | ||
ITree.prototype._palette = _hpccJs_common.Palette.ordinal("default"); | ||
ITree.prototype._palette = tslib_1.Palette.ordinal("default"); | ||
@@ -283,3 +1586,3 @@ exports.I1DChart = I1DChart; | ||
}); | ||
}))); | ||
//# sourceMappingURL=api.js.map |
@@ -1,2 +0,2 @@ | ||
define(["exports","@hpcc-js/common","@hpcc-js/common-vendor","@hpcc-js/api-vendor"],function(t,o,e,n){"use strict";function i(){}function r(){}function l(){}function p(){}var a=n.default;i.prototype._palette=o.Palette.rainbow("default"),i.prototype.click=function(t,o,e){console.log("Click: "+JSON.stringify(t)+", "+o+", "+e)},i.prototype.dblclick=function(t,o,e){console.log("Double click: "+JSON.stringify(t)+", "+o+", "+e)},r.prototype._palette=o.Palette.ordinal("default"),r.prototype.click=function(t,o,e){console.log("Click: "+JSON.stringify(t)+", "+o+", "+e)},r.prototype.dblclick=function(t,o,e){console.log("Double click: "+JSON.stringify(t)+", "+o+", "+e)},l.prototype.vertex_click=function(t,o,e,n){n&&n.vertex&&console.log("Vertex click: "+n.vertex.id())},l.prototype.vertex_dblclick=function(t,o,e,n){n&&n.vertex&&console.log("Vertex double click: "+n.vertex.id())},l.prototype.edge_click=function(t,o,e,n){n&&n.edge&&console.log("Edge click: "+n.edge.id())},l.prototype.edge_dblclick=function(t,o,e,n){n&&n.edge&&console.log("Edge double click: "+n.edge.id())};var s=function(t){function o(){return t.call(this)||this}return e.__extends(o,t),o.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},o.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()},o.prototype.blur=function(t){},o.prototype.click=function(t){},o.prototype.dblclick=function(t){},o.prototype.change=function(t){},o.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},o.prototype.disable=function(t){this._inputElement.forEach(function(o,e){o.attr("disabled",t?"disabled":null)})},o}(o.Widget);s.prototype.publish("name","","string","HTML name for the input"),s.prototype.publish("label","","string","Descriptive label"),s.prototype.publish("value","","string","Input Current Value"),s.prototype.publish("validate",null,"string","Input Validation"),p.prototype._palette=o.Palette.ordinal("default"),p.prototype.click=function(t,o,e){console.log("Click: "+JSON.stringify(t)+", "+o+", "+e)},p.prototype.dblclick=function(t,o,e){console.log("Double click: "+JSON.stringify(t)+", "+o+", "+e)},function(t,o){if("undefined"==typeof document)return o;t=t||"";var e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),e.appendChild(n)}('.d3-tip {\r\n line-height: 1;\r\n font-weight: bold;\r\n padding: 12px;\r\n background: rgba(0, 0, 0, 0.66);\r\n color: #fff;\r\n border-radius: 2px;\r\n pointer-events: none !important;\r\n z-index:10;\r\n}\r\n\r\n.d3-tip.hidden {\r\n visibility:hidden;\r\n}\r\n\r\n/* Creates a small triangle extender for the tooltip */\r\n.d3-tip:after {\r\n box-sizing: border-box;\r\n display: inline;\r\n font-size: 10px;\r\n width: 100%;\r\n line-height: 1;\r\n color: rgba(0, 0, 0, 0.66);\r\n position: absolute;\r\n pointer-events: none !important;\r\n}\r\n\r\n/* Northward tooltips */\r\n.d3-tip.n:after {\r\n content: "\\25BC";\r\n margin: -1px 0 0 0;\r\n top: 100%;\r\n left: 0;\r\n text-align: center;\r\n}\r\n\r\n/* Eastward tooltips */\r\n.d3-tip.e:after {\r\n content: "\\25C0";\r\n margin: -4px 0 0 0;\r\n top: 50%;\r\n left: -8px;\r\n}\r\n\r\n/* Southward tooltips */\r\n.d3-tip.s:after {\r\n content: "\\25B2";\r\n margin: 0 0 1px 0;\r\n top: -8px;\r\n left: 0;\r\n text-align: center;\r\n}\r\n\r\n/* Westward tooltips */\r\n.d3-tip.w:after {\r\n content: "\\25B6";\r\n margin: -4px 0 0 -1px;\r\n top: 50%;\r\n left: 100%;\r\n}\r\n\r\n.d3-tip.notick:after {\r\n content: "" !important;\r\n}\r\n\r\n.common_Widget .over {\r\n stroke: rgba(0, 0, 0, 0.66);\r\n opacity: 0.66;\r\n}\r\n',void 0);var c=n.tip||a||n,u=function(t){function o(){var o=t.call(this)||this;if(o._valueFormatter=e.format(o.tooltipValueFormat()),o.layerEnter){var n=o.layerEnter;o.layerEnter=function(t,o,e){this.tooltipEnter(o),n.apply(this,arguments)};var i=o.layerUpdate;o.layerUpdate=function(t){i.apply(this,arguments),this.tooltipUpdate()};var r=o.layerExit;o.layerExit=function(t){r.apply(this,arguments),this.tooltipExit()}}else{var l=o.enter;o.enter=function(t,o){this.tooltipEnter(o),l.apply(this,arguments)};var p=o.update;o.update=function(t,o){p.apply(this,arguments),this.tooltipUpdate()};var a=o.exit;o.exit=function(t,o){a.apply(this,arguments),this.tooltipExit()}}return o}return e.__extends(o,t),o.prototype.tooltipEnter=function(t){var o=this;this.tooltip=c().attr("class","d3-tip").offset(function(){switch(o.tooltip.direction()()){case"e":return[0,o.tooltipOffset()];default:return[-o.tooltipOffset(),0]}}),t.call(this.tooltip)},o.prototype.tooltipUpdate=function(){var t=this.tooltip.attr("class");t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),this.tooltip.attr("class",t)},o.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},o.prototype._tooltipHTML=function(t){return t},o.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},o.prototype.tooltipFormat=function(t){switch(t=t||{},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;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>":"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},o}(o.Widget);u.prototype.publish("tooltipStyle","default","set","Style",["default","none"],{}),u.prototype.publish("tooltipValueFormat",",.2f","string","Value Format",null,{}),u.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Series Color",null,{}),u.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Label Color",null,{}),u.prototype.publish("tooltipValueColor","white","html-color","Value Color",null,{}),u.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),u.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});var d=u.prototype.tooltipValueFormat;u.prototype.tooltipValueFormat=function(t){var o=d.apply(this,arguments);return arguments.length&&(this._valueFormatter=e.format(t)),o};var f=function(){function t(){}return t.prototype.click=function(t,o,e){console.log("Click: "+JSON.stringify(t)+", "+o+", "+e)},t.prototype.dblclick=function(t,o,e){console.log("Double click: "+JSON.stringify(t)+", "+o+", "+e)},t}();f.prototype._palette=o.Palette.ordinal("default"),t.I1DChart=i,t.I2DChart=r,t.IGraph=l,t.IInput=s,t.INDChart=p,t.ITooltip=u,t.ITree=f,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],n):n(t["@hpcc-js/api"]=t["@hpcc-js/api"]||{},t["@hpcc-js/common"])}(this,function(t,n){"use strict";function e(){}function r(){}function o(){}function i(){}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===ut&&n.documentElement.namespaceURI===ut?n.createElement(t):n.createElementNS(e,t)}}function u(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t,n,e){return t=s(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function s(t,n,e){return function(r){var o=vt;vt=r;try{t.call(this,this.__data__,n,e)}finally{vt=o}}}function c(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function p(t){return function(){var n=this.__on;if(n){for(var e,r=0,o=-1,i=n.length;r<i;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++o]=e:this.removeEventListener(e.type,e.listener,e.capture);++o?n.length=o:delete this.__on}}}function f(t,n,e){var r=dt.hasOwnProperty(t.type)?a:s;return function(o,i,l){var u,a=this.__on,s=r(n,i,l);if(a)for(var c=0,p=a.length;c<p;++c)if((u=a[c]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=s,u.capture=e),void(u.value=n);this.addEventListener(t.type,s,e),u={type:t.type,name:t.name,value:n,listener:s,capture:e},a?a.push(u):this.__on=[u]}}function h(){}function y(){return[]}function d(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function v(t,n,e,r,o,i){for(var l,u=0,a=n.length,s=i.length;u<s;++u)(l=n[u])?(l.__data__=i[u],r[u]=l):e[u]=new d(t,i[u]);for(;u<a;++u)(l=n[u])&&(o[u]=l)}function m(t,n,e,r,o,i,l){var u,a,s,c={},p=n.length,f=i.length,h=new Array(p);for(u=0;u<p;++u)(a=n[u])&&(h[u]=s=Ct+l.call(a,a.__data__,u,n),s in c?o[u]=a:c[s]=a);for(u=0;u<f;++u)(a=c[s=Ct+l.call(t,i[u],u,i)])?(r[u]=a,a.__data__=i[u],c[s]=null):e[u]=new d(t,i[u]);for(u=0;u<p;++u)(a=n[u])&&c[h[u]]===a&&(o[u]=a)}function g(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function _(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function x(t,n){return function(){this.setAttribute(t,n)}}function b(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function S(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function E(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function k(t){return function(){this.style.removeProperty(t)}}function C(t,n,e){return function(){this.style.setProperty(t,n,e)}}function A(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function N(t,n){return t.style.getPropertyValue(n)||zt(t).getComputedStyle(t,null).getPropertyValue(n)}function T(t){return function(){delete this[t]}}function V(t,n){return function(){this[t]=n}}function O(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function L(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=L(t.getAttribute("class")||"")}function M(t,n){for(var e=F(t),r=-1,o=n.length;++r<o;)e.add(n[r])}function P(t,n){for(var e=F(t),r=-1,o=n.length;++r<o;)e.remove(n[r])}function I(t){return function(){M(this,t)}}function $(t){return function(){P(this,t)}}function z(t,n){return function(){(n.apply(this,arguments)?M:P)(this,t)}}function B(){this.textContent=""}function H(t){return function(){this.textContent=t}}function j(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function U(){this.innerHTML=""}function W(t){return function(){this.innerHTML=t}}function q(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function J(){this.nextSibling&&this.parentNode.appendChild(this)}function R(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function G(){return null}function X(){var t=this.parentNode;t&&t.removeChild(this)}function K(t,n,e){var r=zt(t),o=r.CustomEvent;"function"==typeof o?o=new o(n,e):(o=r.document.createEvent("Event"),e?(o.initEvent(n,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(n,!1,!1)),t.dispatchEvent(o)}function Q(t,n){return function(){return K(this,t,n)}}function Y(t,n){return function(){return K(this,t,n.apply(this,arguments))}}function Z(t,n){this._groups=t,this._parents=n}function tt(){return new Z([[document.documentElement]],Yt)}function nt(){}function et(t,n){var e=new nt;if(t instanceof nt)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,o=-1,i=t.length;if(null==n)for(;++o<i;)e.set(o,t[o]);else for(;++o<i;)e.set(n(r=t[o],o,t),r)}else if(t)for(var l in t)e.set(l,t[l]);return e}function rt(){}function ot(t,n){var e=new rt;if(t instanceof rt)t.each(function(t){e.add(t)});else if(t){var r=-1,o=t.length;if(null==n)for(;++r<o;)e.add(t[r]);else for(;++r<o;)e.add(n(t[r],r,t))}return e}function it(){function t(t){(b=h(t))&&(S=b.createSVGPoint(),w().appendChild(x))}function n(){return"n"}function e(){return[0,0]}function r(){return" "}function o(){var t=d();return{top:t.n.y-x.offsetHeight,left:t.n.x-x.offsetWidth/2}}function i(){var t=d();return{top:t.s.y,left:t.s.x-x.offsetWidth/2}}function l(){var t=d();return{top:t.e.y-x.offsetHeight/2,left:t.e.x}}function u(){var t=d();return{top:t.w.y-x.offsetHeight/2,left:t.w.x-x.offsetWidth}}function a(){var t=d();return{top:t.nw.y-x.offsetHeight,left:t.nw.x-x.offsetWidth}}function s(){var t=d();return{top:t.ne.y-x.offsetHeight,left:t.ne.x}}function c(){var t=d();return{top:t.sw.y,left:t.sw.x-x.offsetWidth}}function p(){var t=d();return{top:t.se.y,left:t.se.x}}function f(){var t=Zt(document.createElement("div"));return t.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function h(t){var n=t.node();return n?"svg"===n.tagName.toLowerCase()?n:n.ownerSVGElement:null}function y(){return null==x&&(x=f(),w().appendChild(x)),Zt(x)}function d(){for(var t=E||event.target;null==t.getScreenCTM&&null==t.parentNode;)t=t.parentNode;var n={},e=t.getScreenCTM(),r=t.getBBox(),o=r.width,i=r.height,l=r.x,u=r.y;return S.x=l,S.y=u,n.nw=S.matrixTransform(e),S.x+=o,n.ne=S.matrixTransform(e),S.y+=i,n.se=S.matrixTransform(e),S.x-=o,n.sw=S.matrixTransform(e),S.y-=i/2,n.w=S.matrixTransform(e),S.x+=o,n.e=S.matrixTransform(e),S.x-=o/2,S.y-=i/2,n.n=S.matrixTransform(e),S.y+=i,n.s=S.matrixTransform(e),n}function v(t){return"function"==typeof t?t:function(){return t}}var m=n,g=e,_=r,w=v(document.body),x=f(),b=null,S=null,E=null;t.show=function(){var n=Array.prototype.slice.call(arguments);n[n.length-1]instanceof SVGElement&&(E=n.pop());var e,r=_.apply(this,n),o=g.apply(this,n),i=m.apply(this,n),l=y(),u=C.length,a=document.documentElement.scrollTop||w().scrollTop,s=document.documentElement.scrollLeft||w().scrollLeft;for(l.html(r).style("opacity",1).style("pointer-events","all");u--;)l.classed(C[u],!1);return e=k.get(i).apply(this),l.classed(i,!0).style("top",e.top+o[0]+a+"px").style("left",e.left+o[1]+s+"px"),t},t.hide=function(){return y().style("opacity",0).style("pointer-events","none"),t},t.attr=function(n,e){if(arguments.length<2&&"string"==typeof n)return y().attr(n);var r=Array.prototype.slice.call(arguments);return tt.prototype.attr.apply(y(),r),t},t.style=function(n,e){if(arguments.length<2&&"string"==typeof n)return y().style(n);var r=Array.prototype.slice.call(arguments);return tt.prototype.style.apply(y(),r),t},t.direction=function(n){return arguments.length?(m=null==n?n:v(n),t):m},t.offset=function(n){return arguments.length?(g=null==n?n:v(n),t):g},t.html=function(n){return arguments.length?(_=null==n?n:v(n),t):_},t.rootElement=function(n){return arguments.length?(w=null==n?n:v(n),t):w},t.destroy=function(){return x&&(y().remove(),x=null),t};var k=et({n:o,s:i,e:l,w:u,nw:a,ne:s,sw:c,se:p}),C=k.keys();return t}e.prototype._palette=n.Palette.rainbow("default"),e.prototype.click=function(t,n,e){console.log("Click: "+JSON.stringify(t)+", "+n+", "+e)},e.prototype.dblclick=function(t,n,e){console.log("Double click: "+JSON.stringify(t)+", "+n+", "+e)},r.prototype._palette=n.Palette.ordinal("default"),r.prototype.click=function(t,n,e){console.log("Click: "+JSON.stringify(t)+", "+n+", "+e)},r.prototype.dblclick=function(t,n,e){console.log("Double click: "+JSON.stringify(t)+", "+n+", "+e)},o.prototype.vertex_click=function(t,n,e,r){r&&r.vertex&&console.log("Vertex click: "+r.vertex.id())},o.prototype.vertex_dblclick=function(t,n,e,r){r&&r.vertex&&console.log("Vertex double click: "+r.vertex.id())},o.prototype.edge_click=function(t,n,e,r){r&&r.edge&&console.log("Edge click: "+r.edge.id())},o.prototype.edge_dblclick=function(t,n,e,r){r&&r.edge&&console.log("Edge double click: "+r.edge.id())};var lt=function(t){function e(){return t.call(this)||this}return n.__extends(e,t),e.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},e.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()},e.prototype.blur=function(t){},e.prototype.click=function(t){},e.prototype.dblclick=function(t){},e.prototype.change=function(t){},e.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},e.prototype.disable=function(t){this._inputElement.forEach(function(n,e){n.attr("disabled",t?"disabled":null)})},e}(n.Widget);lt.prototype.publish("name","","string","HTML name for the input"),lt.prototype.publish("label","","string","Descriptive label"),lt.prototype.publish("value","","string","Input Current Value"),lt.prototype.publish("validate",null,"string","Input Validation"),i.prototype._palette=n.Palette.ordinal("default"),i.prototype.click=function(t,n,e){console.log("Click: "+JSON.stringify(t)+", "+n+", "+e)},i.prototype.dblclick=function(t,n,e){console.log("Double click: "+JSON.stringify(t)+", "+n+", "+e)};var ut="http://www.w3.org/1999/xhtml",at={svg:"http://www.w3.org/2000/svg",xhtml:ut,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},st=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),at.hasOwnProperty(n)?{space:at[n],local:t}:t},ct=function(t){var n=st(t);return(n.local?u:l)(n)},pt=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var ft=document.documentElement;if(!ft.matches){var ht=ft.webkitMatchesSelector||ft.msMatchesSelector||ft.mozMatchesSelector||ft.oMatchesSelector;pt=function(t){return function(){return ht.call(this,t)}}}}var yt=pt,dt={},vt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(dt={mouseenter:"mouseover",mouseleave:"mouseout"}));var mt=function(t,n,e){var r,o,i=c(t+""),l=i.length;{if(!(arguments.length<2)){for(u=n?f:p,null==e&&(e=!1),r=0;r<l;++r)this.each(u(i[r],n,e));return this}var u=this.node().__on;if(u)for(var a,s=0,h=u.length;s<h;++s)for(r=0,a=u[s];r<l;++r)if((o=i[r]).type===a.type&&o.name===a.name)return a.value}},gt=function(t){return null==t?h:function(){return this.querySelector(t)}},_t=function(t){"function"!=typeof t&&(t=gt(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,l,u=n[o],a=u.length,s=r[o]=new Array(a),c=0;c<a;++c)(i=u[c])&&(l=t.call(i,i.__data__,c,u))&&("__data__"in i&&(l.__data__=i.__data__),s[c]=l);return new Z(r,this._parents)},wt=function(t){return null==t?y:function(){return this.querySelectorAll(t)}},xt=function(t){"function"!=typeof t&&(t=wt(t));for(var n=this._groups,e=n.length,r=[],o=[],i=0;i<e;++i)for(var l,u=n[i],a=u.length,s=0;s<a;++s)(l=u[s])&&(r.push(t.call(l,l.__data__,s,u)),o.push(l));return new Z(r,o)},bt=function(t){"function"!=typeof t&&(t=yt(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,l=n[o],u=l.length,a=r[o]=[],s=0;s<u;++s)(i=l[s])&&t.call(i,i.__data__,s,l)&&a.push(i);return new Z(r,this._parents)},St=function(t){return new Array(t.length)},Et=function(){return new Z(this._enter||this._groups.map(St),this._parents)};d.prototype={constructor:d,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var kt=function(t){return function(){return t}},Ct="$",At=function(t,n){if(!t)return h=new Array(this.size()),s=-1,this.each(function(t){h[++s]=t}),h;var e=n?m:v,r=this._parents,o=this._groups;"function"!=typeof t&&(t=kt(t));for(var i=o.length,l=new Array(i),u=new Array(i),a=new Array(i),s=0;s<i;++s){var c=r[s],p=o[s],f=p.length,h=t.call(c,c&&c.__data__,s,r),y=h.length,d=u[s]=new Array(y),g=l[s]=new Array(y);e(c,p,d,g,a[s]=new Array(f),h,n);for(var _,w,x=0,b=0;x<y;++x)if(_=d[x]){for(x>=b&&(b=x+1);!(w=g[b])&&++b<y;);_._next=w||null}}return l=new Z(l,r),l._enter=u,l._exit=a,l},Nt=function(){return new Z(this._exit||this._groups.map(St),this._parents)},Tt=function(t){for(var n=this._groups,e=t._groups,r=n.length,o=e.length,i=Math.min(r,o),l=new Array(r),u=0;u<i;++u)for(var a,s=n[u],c=e[u],p=s.length,f=l[u]=new Array(p),h=0;h<p;++h)(a=s[h]||c[h])&&(f[h]=a);for(;u<r;++u)l[u]=n[u];return new Z(l,this._parents)},Vt=function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,o=t[n],i=o.length-1,l=o[i];--i>=0;)(r=o[i])&&(l&&l!==r.nextSibling&&l.parentNode.insertBefore(r,l),l=r);return this},Ot=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=g);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i){for(var l,u=e[i],a=u.length,s=o[i]=new Array(a),c=0;c<a;++c)(l=u[c])&&(s[c]=l);s.sort(n)}return new Z(o,this._parents).order()},Lt=function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},Ft=function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},Dt=function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],o=0,i=r.length;o<i;++o){var l=r[o];if(l)return l}return null},Mt=function(){var t=0;return this.each(function(){++t}),t},Pt=function(){return!this.node()},It=function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var o,i=n[e],l=0,u=i.length;l<u;++l)(o=i[l])&&t.call(o,o.__data__,l,i);return this},$t=function(t,n){var e=st(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?w:_:"function"==typeof n?e.local?E:S:e.local?b:x)(e,n))},zt=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView},Bt=function(t,n,e){return arguments.length>1?this.each((null==n?k:"function"==typeof n?A:C)(t,n,null==e?"":e)):N(this.node(),t)},Ht=function(t,n){return arguments.length>1?this.each((null==n?T:"function"==typeof n?O:V)(t,n)):this.node()[t]};D.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var jt=function(t,n){var e=L(t+"");if(arguments.length<2){for(var r=F(this.node()),o=-1,i=e.length;++o<i;)if(!r.contains(e[o]))return!1;return!0}return this.each(("function"==typeof n?z:n?I:$)(e,n))},Ut=function(t){return arguments.length?this.each(null==t?B:("function"==typeof t?j:H)(t)):this.node().textContent},Wt=function(t){return arguments.length?this.each(null==t?U:("function"==typeof t?q:W)(t)):this.node().innerHTML},qt=function(){return this.each(J)},Jt=function(){return this.each(R)},Rt=function(t){var n="function"==typeof t?t:ct(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},Gt=function(t,n){var e="function"==typeof t?t:ct(t),r=null==n?G:"function"==typeof n?n:gt(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},Xt=function(){return this.each(X)},Kt=function(t){return arguments.length?this.property("__data__",t):this.node().__data__},Qt=function(t,n){return this.each(("function"==typeof n?Y:Q)(t,n))},Yt=[null];Z.prototype=tt.prototype={constructor:Z,select:_t,selectAll:xt,filter:bt,data:At,enter:Et,exit:Nt,merge:Tt,order:Vt,sort:Ot,call:Lt,nodes:Ft,node:Dt,size:Mt,empty:Pt,each:It,attr:$t,style:Bt,property:Ht,classed:jt,text:Ut,html:Wt,raise:qt,lower:Jt,append:Rt,insert:Gt,remove:Xt,datum:Kt,on:mt,dispatch:Qt};var Zt=function(t){return"string"==typeof t?new Z([[document.querySelector(t)]],[document.documentElement]):new Z([[t]],Yt)};nt.prototype=et.prototype={constructor:nt,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var tn=et.prototype;rt.prototype=ot.prototype={constructor:rt,has:tn.has,add:function(t){return t+="",this["$"+t]=t,this},remove:tn.remove,clear:tn.clear,values:tn.keys,size:tn.size,empty:tn.empty,each:tn.each};var nn=Object.freeze({tip:it});!function(t,n){if("undefined"==typeof document)return n;t=t||"";var e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t)),e.appendChild(r)}('.d3-tip {\r\n line-height: 1;\r\n font-weight: bold;\r\n padding: 12px;\r\n background: rgba(0, 0, 0, 0.66);\r\n color: #fff;\r\n border-radius: 2px;\r\n pointer-events: none !important;\r\n z-index:10;\r\n}\r\n\r\n.d3-tip.hidden {\r\n visibility:hidden;\r\n}\r\n\r\n/* Creates a small triangle extender for the tooltip */\r\n.d3-tip:after {\r\n box-sizing: border-box;\r\n display: inline;\r\n font-size: 10px;\r\n width: 100%;\r\n line-height: 1;\r\n color: rgba(0, 0, 0, 0.66);\r\n position: absolute;\r\n pointer-events: none !important;\r\n}\r\n\r\n/* Northward tooltips */\r\n.d3-tip.n:after {\r\n content: "\\25BC";\r\n margin: -1px 0 0 0;\r\n top: 100%;\r\n left: 0;\r\n text-align: center;\r\n}\r\n\r\n/* Eastward tooltips */\r\n.d3-tip.e:after {\r\n content: "\\25C0";\r\n margin: -4px 0 0 0;\r\n top: 50%;\r\n left: -8px;\r\n}\r\n\r\n/* Southward tooltips */\r\n.d3-tip.s:after {\r\n content: "\\25B2";\r\n margin: 0 0 1px 0;\r\n top: -8px;\r\n left: 0;\r\n text-align: center;\r\n}\r\n\r\n/* Westward tooltips */\r\n.d3-tip.w:after {\r\n content: "\\25B6";\r\n margin: -4px 0 0 -1px;\r\n top: 50%;\r\n left: 100%;\r\n}\r\n\r\n.d3-tip.notick:after {\r\n content: "" !important;\r\n}\r\n\r\n.common_Widget .over {\r\n stroke: rgba(0, 0, 0, 0.66);\r\n opacity: 0.66;\r\n}\r\n',void 0);var en=it||void 0||nn,rn=function(t){function e(){var e=t.call(this)||this;if(e._valueFormatter=n.format(e.tooltipValueFormat()),e.layerEnter){var r=e.layerEnter;e.layerEnter=function(t,n,e){this.tooltipEnter(n),r.apply(this,arguments)};var o=e.layerUpdate;e.layerUpdate=function(t){o.apply(this,arguments),this.tooltipUpdate()};var i=e.layerExit;e.layerExit=function(t){i.apply(this,arguments),this.tooltipExit()}}else{var l=e.enter;e.enter=function(t,n){this.tooltipEnter(n),l.apply(this,arguments)};var u=e.update;e.update=function(t,n){u.apply(this,arguments),this.tooltipUpdate()};var a=e.exit;e.exit=function(t,n){a.apply(this,arguments),this.tooltipExit()}}return e}return n.__extends(e,t),e.prototype.tooltipEnter=function(t){var n=this;this.tooltip=en().attr("class","d3-tip").offset(function(){switch(n.tooltip.direction()()){case"e":return[0,n.tooltipOffset()];default:return[-n.tooltipOffset(),0]}}),t.call(this.tooltip)},e.prototype.tooltipUpdate=function(){var t=this.tooltip.attr("class");t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),this.tooltip.attr("class",t)},e.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},e.prototype._tooltipHTML=function(t){return t},e.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},e.prototype.tooltipFormat=function(t){switch(t=t||{},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;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>":"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},e}(n.Widget);rn.prototype.publish("tooltipStyle","default","set","Style",["default","none"],{}),rn.prototype.publish("tooltipValueFormat",",.2f","string","Value Format",null,{}),rn.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Series Color",null,{}),rn.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Label Color",null,{}),rn.prototype.publish("tooltipValueColor","white","html-color","Value Color",null,{}),rn.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),rn.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});var on=rn.prototype.tooltipValueFormat;rn.prototype.tooltipValueFormat=function(t){var e=on.apply(this,arguments);return arguments.length&&(this._valueFormatter=n.format(t)),e};var ln=function(){function t(){}return t.prototype.click=function(t,n,e){console.log("Click: "+JSON.stringify(t)+", "+n+", "+e)},t.prototype.dblclick=function(t,n,e){console.log("Double click: "+JSON.stringify(t)+", "+n+", "+e)},t}();ln.prototype._palette=n.Palette.ordinal("default"),t.I1DChart=e,t.I2DChart=r,t.IGraph=o,t.IInput=lt,t.INDChart=i,t.ITooltip=rn,t.ITree=ln,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=api.min.js.map |
{ | ||
"name": "@hpcc-js/api", | ||
"version": "0.0.27", | ||
"version": "0.0.29", | ||
"description": "hpcc-js - Viz api", | ||
@@ -14,8 +14,10 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"clean": "rimraf lib* && rimraf dist*", | ||
"build": "tsc", | ||
"clean": "rimraf lib* && rimraf dist*", | ||
"build-es6": "tsc --module es6 --outDir ./lib-es6", | ||
"bundle": "node ./node_modules/@hpcc-js/bundle/lib/rollup", | ||
"docs": "typedoc --options tdoptions.json ." | ||
}, | ||
"dependencies": { | ||
"@hpcc-js/common": "^0.0.27", | ||
"@hpcc-js/common": "^0.0.29", | ||
"d3-format": "^1.2.0", | ||
@@ -26,2 +28,3 @@ "d3-tip": "GordonSmith/d3-tip#vJSNEXT", | ||
"devDependencies": { | ||
"@hpcc-js/bundle": "^0.0.3", | ||
"rimraf": "^2.6.1", | ||
@@ -28,0 +31,0 @@ "typedoc": "^0.7.1", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
303095
4
53
2265
2
2
2
+ Added@hpcc-js/common@0.0.29(transitive)
- Removed@hpcc-js/common@0.0.27(transitive)
Updated@hpcc-js/common@^0.0.29