vega-tooltip
Advanced tools
Comparing version 0.30.1 to 0.31.0
@@ -8,3 +8,3 @@ (function (global, factory) { | ||
var name = "vega-tooltip"; | ||
var version$1 = "0.30.1"; | ||
var version$1 = "0.31.0"; | ||
var description = "A tooltip plugin for Vega-Lite and Vega visualizations."; | ||
@@ -73,13 +73,13 @@ var keywords = [ | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"release-it": "^15.6.0", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"browser-sync": "^2.27.11", | ||
concurrently: "^7.6.0", | ||
"gh-pages": "^5.0.0", | ||
"jest-environment-jsdom": "^29.4.2", | ||
"jest-environment-jsdom": "^29.4.3", | ||
path: "^0.12.7", | ||
rollup: "^3.15.0", | ||
"release-it": "^15.6.0", | ||
"rollup-plugin-bundle-size": "^1.0.3", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"rollup-plugin-ts": "^3.2.0", | ||
sass: "^1.58.0", | ||
rollup: "^3.17.2", | ||
sass: "^1.58.3", | ||
typescript: "~4.9.5", | ||
@@ -219,3 +219,3 @@ "vega-datasets": "^2.5.4", | ||
// generated with build-style.sh | ||
var defaultStyle = "#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n"; | ||
var defaultStyle = "#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n"; | ||
@@ -222,0 +222,0 @@ var EL_ID = 'vg-tooltip-element'; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vegaTooltip={},t.vega)}(this,(function(t,e){"use strict";var n="0.30.1",i=function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t,n,i){if(e.isArray(t))return"[".concat(t.map((function(t){return n(e.isString(t)?t:r(t,i))})).join(", "),"]");if(e.isObject(t)){var o="",l=t,a=l.title,s=l.image,d=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}(l,["title","image"]);a&&(o+="<h2>".concat(n(a),"</h2>")),s&&(o+='<img src="'.concat(n(s),'">'));var p=Object.keys(d);if(p.length>0){o+="<table>";for(var c=0,h=p;c<h.length;c++){var f=h[c],u=d[f];void 0!==u&&(e.isObject(u)&&(u=r(u,i)),o+='<tr><td class="key">'.concat(n(f),':</td><td class="value">').concat(n(u),"</td></tr>"))}o+="</table>"}return o||"{}"}return n(t)}function l(t){var e=[];return function(n,i){if("object"!=typeof i||null===i)return i;var o=e.indexOf(this)+1;return e.length=o,e.length>t?"[Object]":e.indexOf(i)>=0?"[Circular]":(e.push(i),i)}}function r(t,e){return JSON.stringify(t,l(e))}var a="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n",s="vg-tooltip-element",d={offsetX:10,offsetY:10,id:s,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:p,maxDepth:2,formatTooltip:o};function p(t){return String(t).replace(/&/g,"&").replace(/</g,"<")}function c(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return a.toString().replace(s,t)}function h(t,e,n,i){var o=t.clientX+n;o+e.width>window.innerWidth&&(o=+t.clientX-n-e.width);var l=t.clientY+i;return l+e.height>window.innerHeight&&(l=+t.clientY-i-e.height),{x:o,y:l}}var f=function(){function t(t){this.options=i(i({},d),t);var e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){var n=document.createElement("style");n.setAttribute("id",this.options.styleId),n.innerHTML=c(e);var o=document.head;o.childNodes.length>0?o.insertBefore(n,o.childNodes[0]):o.appendChild(n)}}return t.prototype.tooltipHandler=function(t,e,n,i){var o;(this.el=document.getElementById(this.options.id),this.el)||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(null!==(o=document.fullscreenElement)&&void 0!==o?o:document.body).appendChild(this.el));if(null!=i&&""!==i){this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible","".concat(this.options.theme,"-theme"));var l=h(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY),r=l.x,a=l.y;this.el.style.top="".concat(a,"px"),this.el.style.left="".concat(r,"px")}else this.el.classList.remove("visible","".concat(this.options.theme,"-theme"))},t}(),u=n;t.DEFAULT_OPTIONS=d,t.Handler=f,t.calculatePosition=h,t.createDefaultStyle=c,t.default=function(t,e){var n=new f(e);return t.tooltip(n.call).run(),n},t.escapeHTML=p,t.formatValue=o,t.replacer=l,t.stringify=r,t.version=u,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vega-util")):"function"==typeof define&&define.amd?define(["exports","vega-util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vegaTooltip={},t.vega)}(this,(function(t,e){"use strict";var n="0.31.0",i=function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t,n,i){if(e.isArray(t))return"[".concat(t.map((function(t){return n(e.isString(t)?t:r(t,i))})).join(", "),"]");if(e.isObject(t)){var o="",l=t,s=l.title,a=l.image,d=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n}(l,["title","image"]);s&&(o+="<h2>".concat(n(s),"</h2>")),a&&(o+='<img src="'.concat(n(a),'">'));var p=Object.keys(d);if(p.length>0){o+="<table>";for(var c=0,h=p;c<h.length;c++){var f=h[c],u=d[f];void 0!==u&&(e.isObject(u)&&(u=r(u,i)),o+='<tr><td class="key">'.concat(n(f),':</td><td class="value">').concat(n(u),"</td></tr>"))}o+="</table>"}return o||"{}"}return n(t)}function l(t){var e=[];return function(n,i){if("object"!=typeof i||null===i)return i;var o=e.indexOf(this)+1;return e.length=o,e.length>t?"[Object]":e.indexOf(i)>=0?"[Circular]":(e.push(i),i)}}function r(t,e){return JSON.stringify(t,l(e))}var s="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n",a="vg-tooltip-element",d={offsetX:10,offsetY:10,id:a,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:p,maxDepth:2,formatTooltip:o};function p(t){return String(t).replace(/&/g,"&").replace(/</g,"<")}function c(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return s.toString().replace(a,t)}function h(t,e,n,i){var o=t.clientX+n;o+e.width>window.innerWidth&&(o=+t.clientX-n-e.width);var l=t.clientY+i;return l+e.height>window.innerHeight&&(l=+t.clientY-i-e.height),{x:o,y:l}}var f=function(){function t(t){this.options=i(i({},d),t);var e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){var n=document.createElement("style");n.setAttribute("id",this.options.styleId),n.innerHTML=c(e);var o=document.head;o.childNodes.length>0?o.insertBefore(n,o.childNodes[0]):o.appendChild(n)}}return t.prototype.tooltipHandler=function(t,e,n,i){var o;(this.el=document.getElementById(this.options.id),this.el)||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(null!==(o=document.fullscreenElement)&&void 0!==o?o:document.body).appendChild(this.el));if(null!=i&&""!==i){this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible","".concat(this.options.theme,"-theme"));var l=h(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY),r=l.x,s=l.y;this.el.style.top="".concat(s,"px"),this.el.style.left="".concat(r,"px")}else this.el.classList.remove("visible","".concat(this.options.theme,"-theme"))},t}(),u=n;t.DEFAULT_OPTIONS=d,t.Handler=f,t.calculatePosition=h,t.createDefaultStyle=c,t.default=function(t,e){var n=new f(e);return t.tooltip(n.call).run(),n},t.escapeHTML=p,t.formatValue=o,t.replacer=l,t.stringify=r,t.version=u,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=vega-tooltip.min.js.map |
import { isArray, isString, isObject } from 'vega-util'; | ||
var name = "vega-tooltip"; | ||
var version$1 = "0.30.1"; | ||
var version$1 = "0.31.0"; | ||
var description = "A tooltip plugin for Vega-Lite and Vega visualizations."; | ||
@@ -68,13 +68,13 @@ var keywords = [ | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"release-it": "^15.6.0", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"browser-sync": "^2.27.11", | ||
concurrently: "^7.6.0", | ||
"gh-pages": "^5.0.0", | ||
"jest-environment-jsdom": "^29.4.2", | ||
"jest-environment-jsdom": "^29.4.3", | ||
path: "^0.12.7", | ||
rollup: "^3.15.0", | ||
"release-it": "^15.6.0", | ||
"rollup-plugin-bundle-size": "^1.0.3", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"rollup-plugin-ts": "^3.2.0", | ||
sass: "^1.58.0", | ||
rollup: "^3.17.2", | ||
sass: "^1.58.3", | ||
typescript: "~4.9.5", | ||
@@ -224,6 +224,2 @@ "vega-datasets": "^2.5.4", | ||
} | ||
#vg-tooltip-element img { | ||
max-width: 200px; | ||
max-height: 200px; | ||
} | ||
#vg-tooltip-element table { | ||
@@ -230,0 +226,0 @@ border-spacing: 0; |
{ | ||
"name": "vega-tooltip", | ||
"version": "0.30.1", | ||
"version": "0.31.0", | ||
"description": "A tooltip plugin for Vega-Lite and Vega visualizations.", | ||
@@ -67,13 +67,13 @@ "keywords": [ | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"release-it": "^15.6.0", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"browser-sync": "^2.27.11", | ||
"concurrently": "^7.6.0", | ||
"gh-pages": "^5.0.0", | ||
"jest-environment-jsdom": "^29.4.2", | ||
"jest-environment-jsdom": "^29.4.3", | ||
"path": "^0.12.7", | ||
"rollup": "^3.15.0", | ||
"release-it": "^15.6.0", | ||
"rollup-plugin-bundle-size": "^1.0.3", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"rollup-plugin-ts": "^3.2.0", | ||
"sass": "^1.58.0", | ||
"rollup": "^3.17.2", | ||
"sass": "^1.58.3", | ||
"typescript": "~4.9.5", | ||
@@ -80,0 +80,0 @@ "vega-datasets": "^2.5.4", |
@@ -24,6 +24,2 @@ // generated with build-style.sh | ||
} | ||
#vg-tooltip-element img { | ||
max-width: 200px; | ||
max-height: 200px; | ||
} | ||
#vg-tooltip-element table { | ||
@@ -30,0 +26,0 @@ border-spacing: 0; |
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed 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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
98387
1187