@xplortech/apollo-data 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +15 -91
  2. package/dist/apollo-data/apollo-data.esm.js +1 -1
  3. package/dist/apollo-data/p-25841a73.entry.js +1 -0
  4. package/dist/apollo-data/p-839050b7.entry.js +1 -0
  5. package/dist/apollo-data/p-C2k3WBpi.js +11 -0
  6. package/dist/apollo-data/p-D64asVrg.js +2 -0
  7. package/dist/apollo-data/{p-b7471c12.entry.js → p-e2c3a317.entry.js} +1 -1
  8. package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +10 -9
  9. package/dist/cjs/{apollo-data-base-CxVQ-WVP.js → apollo-data-base-COGMOEqL.js} +7 -11
  10. package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +3 -3
  11. package/dist/cjs/{apollo-data-line-chart_2.cjs.entry.js → apollo-data-heat-map_4.cjs.entry.js} +358 -9
  12. package/dist/cjs/apollo-data.cjs.js +3 -3
  13. package/dist/cjs/{index-Cl7HgRm0.js → index-Bd5risOy.js} +116 -63
  14. package/dist/cjs/loader.cjs.js +2 -2
  15. package/dist/collection/apollo-data-base.js +4 -8
  16. package/dist/collection/collection-manifest.json +5 -2
  17. package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +8 -7
  18. package/dist/collection/components/apollo-data-bar/apollo-data-bar.stories.js +122 -0
  19. package/dist/collection/components/apollo-data-donut/apollo-data-donut.js +1 -1
  20. package/dist/collection/components/apollo-data-donut/apollo-data-donut.stories.js +132 -0
  21. package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.js +208 -0
  22. package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.stories.js +137 -0
  23. package/dist/collection/components/apollo-data-line/apollo-data-line.js +8 -6
  24. package/dist/collection/components/apollo-data-line/apollo-data-line.stories.js +122 -0
  25. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +1 -1
  26. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.stories.js +147 -0
  27. package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.js +294 -0
  28. package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.stories.js +126 -0
  29. package/dist/collection/examples/apollo-data-heat-map.examples.js +131 -0
  30. package/dist/collection/examples/apollo-data-world-map.examples.js +45 -0
  31. package/dist/collection/examples/index.js +2 -0
  32. package/dist/collection/utils/code-generator.js +1 -1
  33. package/dist/components/apollo-data-bar-chart.js +1 -1
  34. package/dist/components/apollo-data-donut-chart.js +1 -1
  35. package/dist/components/apollo-data-heat-map.d.ts +11 -0
  36. package/dist/components/apollo-data-heat-map.js +1 -0
  37. package/dist/components/apollo-data-line-chart.js +1 -1
  38. package/dist/components/apollo-data-scatter-chart.js +1 -1
  39. package/dist/components/apollo-data-world-map-chart.d.ts +11 -0
  40. package/dist/components/apollo-data-world-map-chart.js +1 -0
  41. package/dist/components/index.js +1 -1
  42. package/dist/components/p-CfbMSXKd.js +11 -0
  43. package/dist/components/p-gcjU8DVr.js +1 -0
  44. package/dist/esm/apollo-data-bar-chart.entry.js +10 -9
  45. package/dist/esm/{apollo-data-base-BWkrM8dc.js → apollo-data-base-C2k3WBpi.js} +7 -11
  46. package/dist/esm/apollo-data-donut-chart.entry.js +3 -3
  47. package/dist/esm/{apollo-data-line-chart_2.entry.js → apollo-data-heat-map_4.entry.js} +357 -10
  48. package/dist/esm/apollo-data.js +4 -4
  49. package/dist/esm/{index-Bb2nY-Tf.js → index-D64asVrg.js} +116 -63
  50. package/dist/esm/loader.js +3 -3
  51. package/dist/types/apollo-data-base.d.ts +2 -2
  52. package/dist/types/components/apollo-data-bar/apollo-data-bar.stories.d.ts +5 -0
  53. package/dist/types/components/apollo-data-donut/apollo-data-donut.stories.d.ts +5 -0
  54. package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.d.ts +140 -0
  55. package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.stories.d.ts +5 -0
  56. package/dist/types/components/apollo-data-line/apollo-data-line.stories.d.ts +5 -0
  57. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +1 -3
  58. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.stories.d.ts +5 -0
  59. package/dist/types/components/apollo-data-world-map/apollo-data-world-map.d.ts +281 -0
  60. package/dist/types/components/apollo-data-world-map/apollo-data-world-map.stories.d.ts +5 -0
  61. package/dist/types/components.d.ts +128 -8
  62. package/dist/types/examples/apollo-data-heat-map.examples.d.ts +11 -0
  63. package/dist/types/examples/apollo-data-scatter.examples.d.ts +1 -1
  64. package/dist/types/examples/apollo-data-world-map.examples.d.ts +11 -0
  65. package/dist/types/examples/index.d.ts +2 -0
  66. package/dist/types/stencil-public-runtime.d.ts +23 -2
  67. package/dist/types/utils/code-generator.d.ts +1 -3
  68. package/package.json +8 -8
  69. package/src/examples/apollo-data-bar.examples.ts +157 -157
  70. package/src/examples/apollo-data-heat-map.examples.ts +147 -0
  71. package/src/examples/apollo-data-line.examples.ts +91 -91
  72. package/src/examples/apollo-data-scatter.examples.ts +1 -1
  73. package/src/examples/apollo-data-world-map.examples.ts +57 -0
  74. package/src/examples/index.ts +3 -1
  75. package/dist/apollo-data/p-4ac3c97c.entry.js +0 -1
  76. package/dist/apollo-data/p-BWkrM8dc.js +0 -11
  77. package/dist/apollo-data/p-Bb2nY-Tf.js +0 -2
  78. package/dist/apollo-data/p-e518baac.entry.js +0 -1
  79. package/dist/components/p-7XF5Cax8.js +0 -11
  80. package/dist/components/p-Dws5s-Xe.js +0 -1
@@ -0,0 +1,2 @@
1
+ function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],i=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);i&&Object.defineProperty(e,o,{get(){return i.get.call(this)},set(t){i.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>{e&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},i=(t,e)=>(0,console.error)(t,e),s=new Map,r="undefined"!=typeof window?window:{},c={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=t=>Promise.resolve(t),a=!!(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})()&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),f=!1,d=[],h=[],p=(t,e)=>n=>{t.push(n),f||(f=!0,e&&4&c.u?$(v):c.raf(v))},m=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},v=()=>{m(d),m(h),(f=d.length>0)&&c.raf(v)},$=t=>u().then(t),b=p(h,!0);function y(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var w,j=new WeakMap,g=t=>"object"==(t=typeof t)||"function"===t,O=(t,e,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!g(o))&&(o+=""),i&&s?r[r.length-1].p+=o:r.push(i?S(null,o):o),s=i)};c(n),e&&e.key&&(l=e.key);const u=S(t,null);return u.m=e,r.length>0&&(u.v=r),u.$=l,u},S=(t,e)=>({u:0,j:t,p:null!=e?e:null,O:null,v:null,m:null,$:null}),k={},M=(t,e)=>null==t||g(t)?t:1&e?t+"":t,E=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},C=(t,e,n,l,i,s)=>{if(n===l)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("key"===e);else{if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let i;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(i=t[1])}}return i||(i=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=g(l);if((r||o&&null!==l)&&!i)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?r=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||i)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}},L=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.m||{},i=e.m||{};for(const t of x(Object.keys(l)))t in i||C(o,t,l[t],void 0,n,e.u);for(const t of x(Object.keys(i)))C(o,t,l[t],i[t],n,e.u)};function x(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var P=!1,R=(t,e,n)=>{const o=e.v[n];let l,i,s=0;if(!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=r.document.createElement(o.j),L(null,o,P),o.v){const e="template"===o.j?l.content:l;for(s=0;s<o.v.length;++s)i=R(t,o,s),i&&e.appendChild(i)}return l["s-hn"]=w,l},T=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===w&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);l<=i;++l)o[l]&&(s=R(null,n,l),s&&(o[l].O=s,U(r,s,e)))},D=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;t&&t.remove()}}},H=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),N=(t,e,n=!1)=>{const o=e.O=t.O,l=t.v,i=e.v;L(t,e,P),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],h=e[f],p=o.length-1,m=o[0],v=o[p];const $="template"===n.j?t.content:t;for(;r<=f&&c<=p;)if(null==d)d=e[++r];else if(null==h)h=e[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(H(d,m,l))N(d,m,l),d=e[++r],m=o[++c];else if(H(h,v,l))N(h,v,l),h=e[--f],v=o[--p];else if(H(d,v,l))N(d,v,l),U($,d.O,h.O.nextSibling),d=e[++r],v=o[--p];else if(H(h,m,l))N(h,m,l),U($,h.O,d.O),h=e[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].$&&e[a].$===m.$){u=a;break}u>=0?(s=e[u],s.j!==m.j?i=R(e&&e[c],n,u):(N(s,m,l),e[u]=void 0,i=s.O),m=o[++c]):(i=R(e&&e[c],n,c),m=o[++c]),i&&U(d.O.parentNode,i,d.O)}r>f?T(t,null==o[p+1]?null:o[p+1].O,n,o,c,p):c>p&&D(e,r,f)})(o,l,e,i,n):null!==i?T(o,null,e,i,0,i.length-1):!n&&null!==l&&D(l,0,l.length-1)},U=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),A=(t,e)=>{if(e&&!t.S&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.S=()=>{e["s-p"].splice(n-1,1),o()})))}},W=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);A(t,t.k);const n=()=>z(t,e);if(!e)return b(n);queueMicrotask((()=>{n()}))},z=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.M.length&&t.M.forEach((t=>t(n))),l=_(o,"componentWillLoad",void 0,n)):l=_(o,"componentWillUpdate",void 0,n),l=q(l,(()=>_(o,"componentWillRender",void 0,n))),q(l,(()=>V(t,o,e)))},q=(t,e)=>F(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),F=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,V=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];G(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>Y(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},G=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.C||S(null,null),i=(t=>t&&t.j===k)(e)?e:O(null,null,e);if(w=o.tagName,n&&i.m)for(const t of Object.keys(i.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=o[t]);i.j=null,i.u|=4,t.C=i,i.O=l.O=o.shadowRoot||o,N(l,i,n)})(t,e,o)}catch(e){i(e,t.$hostElement$)}return null},Y=t=>{const e=t.$hostElement$,n=t.i,o=t.k;_(n,"componentDidRender",void 0,e),64&t.u?_(n,"componentDidUpdate",void 0,e):(t.u|=64,B(e),_(n,"componentDidLoad",void 0,e),t.L(e),o||Z()),t.S&&(t.S(),t.S=void 0),512&t.u&&$((()=>W(t,!1))),t.u&=-517},Z=()=>{$((()=>(t=>{const e=c.ce("appload",{detail:{namespace:"apollo-data"}});return t.dispatchEvent(e),e})(r)))},_=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},B=t=>t.classList.add("hydrated"),I=(t,e,n,l)=>{const i=o(t);if(!i)return;if(!i)throw Error(`Couldn't find host element for "${l.P}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const s=i.l.get(e),r=i.u,c=i.i;if(n=M(n,l.t[e][0]),(!(8&r)||void 0===s)&&n!==s&&(!Number.isNaN(s)||!Number.isNaN(n))&&(i.l.set(e,n),2&r)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,s,e)&&!(16&r))return;16&r||W(i,!1)}},J=(e,n,l)=>{var i,s;const r=e.prototype;if(n.t){const u=Object.entries(null!=(i=n.t)?i:{});if(u.map((([e,[i]])=>{if(31&i||2&l&&32&i){const{get:s,set:c}=t(r,e)||{};s&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!s)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=o(this);if(s){if(c)return void 0===(32&i?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),c.call(this,M(t,i)),void I(this,e,t=32&i?this[e]:s.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return I(this,e,t,n),void(1&l&&!s.i&&s.M.push((()=>{4096&n.t[e][0]&&s.i[e]!==s.l.get(e)&&(s.i[e]=t)})));const o=()=>{const o=s.i[e];!s.l.get(e)&&o&&s.l.set(e,o),s.i[e]=M(t,i),I(this,e,s.i[e],n)};s.i?o():s.M.push((()=>{o()}))}}}})}})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,i){c.jmp((()=>{var s;const c=t.get(e),a=o(this);if(this.hasOwnProperty(c)&&(i=this[c],delete this[c]),r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==i)return;if(null==c){const t=null==a?void 0:a.u;if(a&&t&&!(8&t)&&i!==l){const o=a.i,r=null==(s=n.R)?void 0:s[e];null==r||r.forEach((n=>{const[[s,r]]=Object.entries(n);null!=o[s]&&(128&t||1&r)&&o[s].call(o,i,l,e)}))}return}const f=u.find((([t])=>t===c));f&&4&f[1][0]&&(i=null!==i&&"false"!==i);const d=Object.getOwnPropertyDescriptor(r,c);i==this[c]||d.get&&!d.set||(this[c]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.R)?s:{}),...u.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},K=(t,e)=>{_(t,"connectedCallback",void 0,e)},Q=(t,e)=>{_(t,"disconnectedCallback",void 0,e||t)},X=(t,e={})=>{var n;if(!r.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],u=e.exclude||[],a=r.customElements,f=r.document.head,d=f.querySelector("meta[charset]"),h=r.document.createElement("style"),p=[];let m,v=!0;if(Object.assign(c,e),c.h=new URL(e.resourcesUrl||"./",r.document.baseURI).href,t.map((t=>{t[1].map((e=>{const n={u:e[0],P:e[1],t:e[2],T:e[3]};n.t=e[2];const r=n.P,f=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,D:new Map};n.H=new Promise((t=>n.L=t)),t["s-p"]=[],t["s-rc"]=[],n.M=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,n),1&n.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${n.P}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else y.call(t,n)}connectedCallback(){o(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),m&&(clearTimeout(m),m=null),v?p.push(this):c.jmp((()=>(t=>{if(!(1&c.u)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.u)(null==e?void 0:e.i)?K(e.i,t):(null==e?void 0:e.H)&&e.H.then((()=>K(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){A(e,e.k=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.u))if(e.u|=32,n.N){const l=((t,e)=>{const n=t.P.replace(/-/g,"_"),o=t.N;if(!o)return;const l=s.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(s.set(o,t),t[n])),(t=>{i(t,e.$hostElement$)}))
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.P}#${e.U}" was not found`);o.isProxied||(J(o,n,2),o.isProxied=!0);const r=()=>{};e.u|=8;try{new o(e)}catch(e){i(e,t)}e.u&=-9,r(),K(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));const l=e.k,r=()=>W(e,!0);l&&l["s-rc"]?l["s-rc"].push(r):r()}catch(n){i(n,t),e.S&&(e.S(),e.S=void 0),e.L&&e.L(t)}})(t,e,n)}l()}})(this))))}disconnectedCallback(){c.jmp((()=>(async t=>{if(!(1&c.u)){const e=o(t);(null==e?void 0:e.i)?Q(e.i,t):(null==e?void 0:e.H)&&e.H.then((()=>Q(e.i,t)))}j.has(t)&&j.delete(t),t.shadowRoot&&j.has(t.shadowRoot)&&j.delete(t.shadowRoot)})(this))),c.raf((()=>{var t;const e=o(this);if(!e)return;const n=p.findIndex((t=>t===this));n>-1&&p.splice(n,1),(null==(t=null==e?void 0:e.C)?void 0:t.O)instanceof Node&&!e.C.O.isConnected&&delete e.C.O}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.H}};n.N=t[0],u.includes(r)||a.get(r)||(l.push(r),a.define(r,J(f,n,1)))}))})),l.length>0&&(h.textContent+=l.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",h.innerHTML.length)){h.setAttribute("data-styles","");const t=null!=(n=c.A)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();null!=t&&h.setAttribute("nonce",t),f.insertBefore(h,d?d.nextSibling:f.firstChild)}v=!1,p.length?p.map((t=>t.connectedCallback())):c.jmp((()=>m=setTimeout(Z,30)))},tt=t=>c.A=t;export{k as H,X as b,E as g,O as h,u as p,l as r,tt as s}
@@ -1 +1 @@
1
- import{r as e,g as a,h as t,H as n}from"./p-Bb2nY-Tf.js";import{A as l}from"./p-BWkrM8dc.js";const r=class extends l{constructor(a){super(),e(this,a)}get el(){return a(this)}adData=[];adSpec={};categories;dataValues;totalRevenue;chartColors;defaultChartColors=["#4d1ab2","#f99170","#e550c8","#ffd563","#8857fa","#52ebba","#bf1d78","#31cff8"];defaultCenterText="Total Revenue";async componentDidRender(){await this.renderChart()}async getViewData(e,a){const t=e;return this.chartColors=a?.colorSet?a.colorSet:this.defaultChartColors,this.categories=t.map((e=>e.category)),this.dataValues=t.map(((e,a)=>({...e,order:a+1}))),this.totalRevenue=Math.round(100*t.reduce(((e,a)=>e+a.value),0))/100,{$schema:"https://vega.github.io/schema/vega/v5.json",description:"Donut chart with correctly placed percentage labels and exploded 'Other' slices on hover",height:250,signals:[{name:"containerW",update:"min(containerSize()[0], 400)"},{name:"centerX",update:"containerW / 2"},{name:"centerY",update:"250 / 2"},{name:"radius",update:"min(containerW, 250) / 2 - 20"},{name:"categoryDisplay",value:null,on:[{events:{type:"mouseover",markname:"mainArc"},update:"datum.category"},{events:{type:"mouseover",markname:"mainArcLabel"},update:"datum.category"},{events:{type:"mouseout",markname:"mainArc"},update:"null"},{events:{type:"mouseout",markname:"mainArcLabel"},update:"null"},{events:{type:"mouseover",markname:"innerArc"},update:"null"},{events:{type:"mouseover",markname:"outerArc"},update:"null"},{events:{type:"mouseover",markname:"otherArc"},update:"datum.category"},{events:{type:"mouseout",markname:"otherArc"},update:"null"}]},{name:"displayText",update:`categoryDisplay && length(categoryDisplay) > 18 ? (lastindexof(categoryDisplay, ' ') > 0 ? slice(categoryDisplay, 0, lastindexof(categoryDisplay, ' ')) + '\\n' + slice(categoryDisplay, lastindexof(categoryDisplay, ' ') + 1) : categoryDisplay) : categoryDisplay || '${a?.centerText?a.centerText:this.defaultCenterText}'`},{name:"hoveredCategory",value:null,on:[{events:{type:"mouseover",markname:"mainArc"},update:"datum.category"},{events:{type:"mouseover",markname:"mainArcLabel"},update:"datum.category"},{events:{type:"mouseover",markname:"outerArc"},update:"null"},{events:{type:"mouseover",markname:"innerArc"},update:"null"},{events:{type:"mouseout",markname:"innerArc"},update:"null"}]},{name:"hoveredValue",value:null,on:[{events:{type:"mouseover",markname:"mainArc"},update:"datum.value"},{events:{type:"mouseover",markname:"mainArcLabel"},update:"datum.value"},{events:{type:"mouseout",markname:"mainArc"},update:"null"},{events:{type:"mouseover",markname:"otherArc"},update:"datum.value"},{events:{type:"mouseout",markname:"otherArc"},update:"null"}]}],width:{signal:"containerW"},data:[{name:"table",values:this.dataValues,transform:[{type:"joinaggregate",fields:["value"],ops:["sum"],as:["total"]},{type:"formula",as:"percent",expr:"datum.value / datum.total"},{type:"collect",sort:{field:"order",order:"descending"}},{type:"pie",field:"value",as:["startAngle","endAngle"]},{type:"formula",as:"midAngle",expr:"((datum.startAngle + datum.endAngle) + 9.418) / 2"},{type:"formula",as:"labelX",expr:"centerX + (radius * 1.2 * cos(datum.midAngle))"},{type:"formula",as:"labelY",expr:"centerY + (radius * 1.2 * sin(datum.midAngle))"},{type:"formula",as:"percentLabel",expr:`format(datum.value / ${this.totalRevenue} * 100, '.1f') + '%'`}]},{name:"defaultCenterText",values:[{category:a?.centerText?a.centerText:this.defaultCenterText,value:this.totalRevenue,order:4}],transform:[{type:"filter",expr:"hoveredCategory === null"},{type:"formula",as:"textDisplay",expr:`'${a?.prefix??"$"}' + format(floor(datum.value), ',') + '${a?.suffix??""}' `}]}],scales:[{name:"mainColor",type:"ordinal",domain:this.categories,range:this.chartColors}],legends:[{fill:"mainColor",orient:"bottom",direction:"horizontal",columns:2,title:"",padding:10,symbolType:"square",symbolSize:100,labelFontSize:12,labelColor:"#6A6D7D",rowPadding:8}],marks:[{type:"rule",name:"labelLines",from:{data:"table"},encode:{enter:{stroke:{value:"black"},strokeWidth:{value:1},x:{signal:"centerX + (radius * 0.9) * cos(datum.midAngle)"},y:{signal:"centerY + (radius * 0.9) * sin(datum.midAngle)"},x2:{signal:"datum.labelX - 12 * cos(datum.midAngle)"},y2:{signal:"datum.labelY - 12 * sin(datum.midAngle)"}},update:{opacity:{value:1}}},zindex:5},{type:"arc",name:"mainArc",from:{data:"table"},encode:{enter:{fill:{scale:"mainColor",field:"category"},x:{signal:"centerX"},y:{signal:"centerY"},startAngle:{field:"startAngle"},endAngle:{field:"endAngle"},innerRadius:{signal:"radius * 0.5"},outerRadius:{signal:"radius * 0.9"},padAngle:{value:.03},cornerRadius:{value:1}}},interactive:!0},{type:"arc",name:"innerArc",from:{data:"table"},encode:{enter:{fill:{value:"transparent"},x:{signal:"centerX"},y:{signal:"centerY"},startAngle:{field:"startAngle"},endAngle:{field:"endAngle"},innerRadius:{signal:"radius * 0.4"},outerRadius:{signal:"radius * 0.5"},padAngle:{value:.03},cornerRadius:{value:1}}},zindex:1},{type:"arc",name:"outerArc",from:{data:"table"},encode:{enter:{fill:{value:"transparent"},x:{signal:"centerX"},y:{signal:"centerY"},startAngle:{field:"startAngle"},endAngle:{field:"endAngle"},innerRadius:{signal:"radius * 0.91"},outerRadius:{signal:"radius * 1.30"}}},zindex:1},{type:"text",name:"mainArcLabel",from:{data:"table"},encode:{enter:{text:{field:"percentLabel"},align:{value:"center"},baseline:{value:"middle"},fill:{value:"#302D3B"},fontSize:{value:10},x:{field:"labelX"},y:{field:"labelY"},font:{value:"apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif"},fontWeight:600}}},{type:"text",encode:{enter:{text:{value:"$850,000"},x:{signal:"centerX"},y:{signal:"centerY"},align:{value:"center"},baseline:{value:"middle"},fontSize:{value:16},fontWeight:{value:"bold"},fill:{value:"#302D3B"},font:{value:"apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif"}},update:{text:{signal:`hoveredValue ? '${a?.prefix??"$"}' + format(floor(hoveredValue), ',') + '${a?.suffix??""}' : '${a?.prefix??"$"}' + format(floor(${this.totalRevenue??1}), ',') + '${a?.suffix??""}'`}}}},{type:"text",encode:{enter:{x:{signal:"centerX"},y:{signal:"centerY + 15"},align:{value:"center"},baseline:{value:"middle"},fontSize:{value:10},fill:{value:"#6A6D7D"},font:{value:"apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif"},fontWeight:400,limit:{value:100},lineBreak:{value:"\\n"}},update:{text:{signal:"displayText"}}}}]}}render(){return t(n,{key:"fb26a6b02b83b0ce64a8301149b66f5d09a4a7b4"},t("div",{key:"fc08cdc3c0c0fda7f7c13149532eb61f511aa035",id:"container",style:{width:"100%",height:"100%"}}))}};export{r as apollo_data_donut_chart}
1
+ import{r as e,g as a,h as t,H as n}from"./p-D64asVrg.js";import{A as l}from"./p-C2k3WBpi.js";const r=class extends l{constructor(a){super(),e(this,a)}get el(){return a(this)}adData=[];adSpec={};categories;dataValues;totalRevenue;chartColors;defaultChartColors=["#4d1ab2","#f99170","#e550c8","#ffd563","#8857fa","#52ebba","#bf1d78","#31cff8"];defaultCenterText="Total Revenue";async componentDidRender(){await this.renderChart()}async getViewData(e,a){const t=e;return this.chartColors=a?.colorSet?a.colorSet:this.defaultChartColors,this.categories=t.map((e=>e.category)),this.dataValues=t.map(((e,a)=>({...e,order:a+1}))),this.totalRevenue=Math.round(100*t.reduce(((e,a)=>e+a.value),0))/100,{$schema:"https://vega.github.io/schema/vega/v5.json",description:"Donut chart with correctly placed percentage labels and exploded 'Other' slices on hover",height:250,signals:[{name:"containerW",update:"min(containerSize()[0], 400)"},{name:"centerX",update:"containerW / 2"},{name:"centerY",update:"250 / 2"},{name:"radius",update:"min(containerW, 250) / 2 - 20"},{name:"categoryDisplay",value:null,on:[{events:{type:"mouseover",markname:"mainArc"},update:"datum.category"},{events:{type:"mouseover",markname:"mainArcLabel"},update:"datum.category"},{events:{type:"mouseout",markname:"mainArc"},update:"null"},{events:{type:"mouseout",markname:"mainArcLabel"},update:"null"},{events:{type:"mouseover",markname:"innerArc"},update:"null"},{events:{type:"mouseover",markname:"outerArc"},update:"null"},{events:{type:"mouseover",markname:"otherArc"},update:"datum.category"},{events:{type:"mouseout",markname:"otherArc"},update:"null"}]},{name:"displayText",update:`categoryDisplay && length(categoryDisplay) > 18 ? (lastindexof(categoryDisplay, ' ') > 0 ? slice(categoryDisplay, 0, lastindexof(categoryDisplay, ' ')) + '\\n' + slice(categoryDisplay, lastindexof(categoryDisplay, ' ') + 1) : categoryDisplay) : categoryDisplay || '${a?.centerText?a.centerText:this.defaultCenterText}'`},{name:"hoveredCategory",value:null,on:[{events:{type:"mouseover",markname:"mainArc"},update:"datum.category"},{events:{type:"mouseover",markname:"mainArcLabel"},update:"datum.category"},{events:{type:"mouseover",markname:"outerArc"},update:"null"},{events:{type:"mouseover",markname:"innerArc"},update:"null"},{events:{type:"mouseout",markname:"innerArc"},update:"null"}]},{name:"hoveredValue",value:null,on:[{events:{type:"mouseover",markname:"mainArc"},update:"datum.value"},{events:{type:"mouseover",markname:"mainArcLabel"},update:"datum.value"},{events:{type:"mouseout",markname:"mainArc"},update:"null"},{events:{type:"mouseover",markname:"otherArc"},update:"datum.value"},{events:{type:"mouseout",markname:"otherArc"},update:"null"}]}],width:{signal:"containerW"},data:[{name:"table",values:this.dataValues,transform:[{type:"joinaggregate",fields:["value"],ops:["sum"],as:["total"]},{type:"formula",as:"percent",expr:"datum.value / datum.total"},{type:"collect",sort:{field:"order",order:"descending"}},{type:"pie",field:"value",as:["startAngle","endAngle"]},{type:"formula",as:"midAngle",expr:"((datum.startAngle + datum.endAngle) + 9.418) / 2"},{type:"formula",as:"labelX",expr:"centerX + (radius * 1.2 * cos(datum.midAngle))"},{type:"formula",as:"labelY",expr:"centerY + (radius * 1.2 * sin(datum.midAngle))"},{type:"formula",as:"percentLabel",expr:`format(datum.value / ${this.totalRevenue} * 100, '.1f') + '%'`}]},{name:"defaultCenterText",values:[{category:a?.centerText?a.centerText:this.defaultCenterText,value:this.totalRevenue,order:4}],transform:[{type:"filter",expr:"hoveredCategory === null"},{type:"formula",as:"textDisplay",expr:`'${a?.prefix??"$"}' + format(floor(datum.value), ',') + '${a?.suffix??""}' `}]}],scales:[{name:"mainColor",type:"ordinal",domain:this.categories,range:this.chartColors}],legends:[{fill:"mainColor",orient:"bottom",direction:"horizontal",columns:2,title:"",padding:10,symbolType:"square",symbolSize:100,labelFontSize:12,labelColor:"#6A6D7D",rowPadding:8}],marks:[{type:"rule",name:"labelLines",from:{data:"table"},encode:{enter:{stroke:{value:"black"},strokeWidth:{value:1},x:{signal:"centerX + (radius * 0.9) * cos(datum.midAngle)"},y:{signal:"centerY + (radius * 0.9) * sin(datum.midAngle)"},x2:{signal:"datum.labelX - 12 * cos(datum.midAngle)"},y2:{signal:"datum.labelY - 12 * sin(datum.midAngle)"}},update:{opacity:{value:1}}},zindex:5},{type:"arc",name:"mainArc",from:{data:"table"},encode:{enter:{fill:{scale:"mainColor",field:"category"},x:{signal:"centerX"},y:{signal:"centerY"},startAngle:{field:"startAngle"},endAngle:{field:"endAngle"},innerRadius:{signal:"radius * 0.5"},outerRadius:{signal:"radius * 0.9"},padAngle:{value:.03},cornerRadius:{value:1}}},interactive:!0},{type:"arc",name:"innerArc",from:{data:"table"},encode:{enter:{fill:{value:"transparent"},x:{signal:"centerX"},y:{signal:"centerY"},startAngle:{field:"startAngle"},endAngle:{field:"endAngle"},innerRadius:{signal:"radius * 0.4"},outerRadius:{signal:"radius * 0.5"},padAngle:{value:.03},cornerRadius:{value:1}}},zindex:1},{type:"arc",name:"outerArc",from:{data:"table"},encode:{enter:{fill:{value:"transparent"},x:{signal:"centerX"},y:{signal:"centerY"},startAngle:{field:"startAngle"},endAngle:{field:"endAngle"},innerRadius:{signal:"radius * 0.91"},outerRadius:{signal:"radius * 1.30"}}},zindex:1},{type:"text",name:"mainArcLabel",from:{data:"table"},encode:{enter:{text:{field:"percentLabel"},align:{value:"center"},baseline:{value:"middle"},fill:{value:"#302D3B"},fontSize:{value:10},x:{field:"labelX"},y:{field:"labelY"},font:{value:"apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif"},fontWeight:600}}},{type:"text",encode:{enter:{text:{value:"$850,000"},x:{signal:"centerX"},y:{signal:"centerY"},align:{value:"center"},baseline:{value:"middle"},fontSize:{value:16},fontWeight:{value:"bold"},fill:{value:"#302D3B"},font:{value:"apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif"}},update:{text:{signal:`hoveredValue ? '${a?.prefix??"$"}' + format(floor(hoveredValue), ',') + '${a?.suffix??""}' : '${a?.prefix??"$"}' + format(floor(${this.totalRevenue??1}), ',') + '${a?.suffix??""}'`}}}},{type:"text",encode:{enter:{x:{signal:"centerX"},y:{signal:"centerY + 15"},align:{value:"center"},baseline:{value:"middle"},fontSize:{value:10},fill:{value:"#6A6D7D"},font:{value:"apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif"},fontWeight:400,limit:{value:100},lineBreak:{value:"\\n"}},update:{text:{signal:"displayText"}}}}]}}render(){return t(n,{key:"5d9ba4976956c4f0d29b9aa8638373895c0c3f7f"},t("div",{key:"2db6d1418492898de84a167e35ecc8b16d695942",id:"container",style:{width:"100%",height:"100%"}}))}};export{r as apollo_data_donut_chart}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cl7HgRm0.js');
4
- var apolloDataBase = require('./apollo-data-base-CxVQ-WVP.js');
3
+ var index = require('./index-Bd5risOy.js');
4
+ var apolloDataBase = require('./apollo-data-base-COGMOEqL.js');
5
5
  var constants = require('./constants-B3weDEpc.js');
6
6
 
7
7
  const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
@@ -21,12 +21,13 @@ const ApolloDataBarChart = class extends apolloDataBase.ApolloBase {
21
21
  await this.renderChart();
22
22
  }
23
23
  injectTooltipStyles() {
24
- if (ApolloDataBarChart.tooltipStylesInjected) {
24
+ const chartClass = this.constructor;
25
+ if (chartClass.tooltipStylesInjected) {
25
26
  return;
26
27
  }
27
28
  const styleId = 'apollo-data-bar-tooltip-styles';
28
29
  if (document.getElementById(styleId)) {
29
- ApolloDataBarChart.tooltipStylesInjected = true;
30
+ chartClass.tooltipStylesInjected = true;
30
31
  return;
31
32
  }
32
33
  const style = document.createElement('style');
@@ -75,16 +76,16 @@ const ApolloDataBarChart = class extends apolloDataBase.ApolloBase {
75
76
  }
76
77
  `;
77
78
  document.head.appendChild(style);
78
- ApolloDataBarChart.tooltipStylesInjected = true;
79
+ chartClass.tooltipStylesInjected = true;
79
80
  }
80
- // @ts-ignore
81
81
  async getViewData(data, spec) {
82
+ const componentTag = this.el?.tagName?.toLowerCase() ?? 'apollo-data-bar-chart';
82
83
  if (!spec) {
83
- throw new Error('adSpec is required for apollo-data-bar-chart');
84
+ throw new Error(`adSpec is required for ${componentTag}`);
84
85
  }
85
86
  const { tooltipPrefix = '', currencySymbol = '' } = spec;
86
87
  if (!data || data.length === 0) {
87
- throw new Error('Data is required for apollo-data-bar-chart');
88
+ throw new Error(`Data is required for ${componentTag}`);
88
89
  }
89
90
  const uniqueCategories = Array.from(new Set(data.map(item => item.category)));
90
91
  const formatNumber = tooltipPrefix ? '.2f' : '.0f';
@@ -307,7 +308,7 @@ const ApolloDataBarChart = class extends apolloDataBase.ApolloBase {
307
308
  };
308
309
  }
309
310
  render() {
310
- return (index.h(index.Host, { key: '86ed2e74e5abd57e684a93bc9cf6a014b3ed081c' }, index.h("div", { key: '96e5f7dd2dfa6a104ca709d1399308a86041c2f3', id: "container", style: { width: '100%', height: '100%' } })));
311
+ return (index.h(index.Host, { key: 'a0aebbff4fb177de35eb90329de81a1098663620' }, index.h("div", { key: '9e753e876df877d46254a02349850414914d9231', id: "container", style: { width: '100%', height: '100%' } })));
311
312
  }
312
313
  };
313
314
 
@@ -22831,7 +22831,7 @@ var boundsStream$1 = {
22831
22831
  boundsStream$1.lineEnd = boundsLineEnd;
22832
22832
  if (areaRingSum$1 < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
22833
22833
  else if (deltaSum > epsilon$3) phi1 = 90;
22834
- else if (deltaSum < -1e-6) phi0 = -90;
22834
+ else if (deltaSum < -epsilon$3) phi0 = -90;
22835
22835
  range$4[0] = lambda0, range$4[1] = lambda1;
22836
22836
  },
22837
22837
  sphere: function() {
@@ -23432,7 +23432,7 @@ function polygonContains(polygon, point) {
23432
23432
  // from the point to the South pole. If it is zero, then the point is the
23433
23433
  // same side as the South pole.
23434
23434
 
23435
- return (angle < -1e-6 || angle < epsilon$3 && sum < -1e-12) ^ (winding & 1);
23435
+ return (angle < -epsilon$3 || angle < epsilon$3 && sum < -epsilon2) ^ (winding & 1);
23436
23436
  }
23437
23437
 
23438
23438
  function clip$1(pointVisible, clipLine, interpolate, start) {
@@ -23883,7 +23883,7 @@ function clipLine(a, b, x0, y0, x1, y1) {
23883
23883
  return true;
23884
23884
  }
23885
23885
 
23886
- var clipMax = 1e9, clipMin = -1e9;
23886
+ var clipMax = 1e9, clipMin = -clipMax;
23887
23887
 
23888
23888
  // TODO Use d3-polygon’s polygonContains here for the ring check?
23889
23889
  // TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
@@ -67613,17 +67613,12 @@ async function _embed(el, spec, opts = {}, loader) {
67613
67613
  return { view, spec, vgSpec, finalize, embedOptions: opts };
67614
67614
  }
67615
67615
 
67616
- // @ts-ignore
67617
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
67618
67616
  class ApolloBase {
67619
- // @ts-ignore
67620
- getViewData(data, spec) {
67621
- throw new Error('getViewData is not implemented');
67622
- }
67623
67617
  async renderChart() {
67624
67618
  // Wait for shadow DOM to be ready
67625
- await new Promise(resolve => setTimeout(resolve, 0));
67626
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
67619
+ await new Promise(resolve => {
67620
+ setTimeout(resolve, 0);
67621
+ });
67627
67622
  const container = this.el?.shadowRoot?.querySelector('#container');
67628
67623
  if (!container) {
67629
67624
  return;
@@ -67635,6 +67630,7 @@ class ApolloBase {
67635
67630
  spec = typeof this.adSpec === 'string' ? JSON.parse(this.adSpec) : this.adSpec;
67636
67631
  }
67637
67632
  catch (err) {
67633
+ // eslint-disable-next-line no-console
67638
67634
  console.error('Error parsing data/spec', err);
67639
67635
  return;
67640
67636
  }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cl7HgRm0.js');
4
- var apolloDataBase = require('./apollo-data-base-CxVQ-WVP.js');
3
+ var index = require('./index-Bd5risOy.js');
4
+ var apolloDataBase = require('./apollo-data-base-COGMOEqL.js');
5
5
 
6
6
  const ApolloDataDonutChart = class extends apolloDataBase.ApolloBase {
7
7
  constructor(hostRef) {
@@ -401,7 +401,7 @@ const ApolloDataDonutChart = class extends apolloDataBase.ApolloBase {
401
401
  };
402
402
  }
403
403
  render() {
404
- return (index.h(index.Host, { key: 'fb26a6b02b83b0ce64a8301149b66f5d09a4a7b4' }, index.h("div", { key: 'fc08cdc3c0c0fda7f7c13149532eb61f511aa035', id: "container", style: { width: '100%', height: '100%' } })));
404
+ return (index.h(index.Host, { key: '5d9ba4976956c4f0d29b9aa8638373895c0c3f7f' }, index.h("div", { key: '2db6d1418492898de84a167e35ecc8b16d695942', id: "container", style: { width: '100%', height: '100%' } })));
405
405
  }
406
406
  };
407
407
 
@@ -1,9 +1,137 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cl7HgRm0.js');
4
- var apolloDataBase = require('./apollo-data-base-CxVQ-WVP.js');
3
+ var index = require('./index-Bd5risOy.js');
4
+ var apolloDataBase = require('./apollo-data-base-COGMOEqL.js');
5
5
  var constants = require('./constants-B3weDEpc.js');
6
6
 
7
+ const ApolloDataHeatMap = class extends apolloDataBase.ApolloBase {
8
+ constructor(hostRef) {
9
+ super();
10
+ index.registerInstance(this, hostRef);
11
+ }
12
+ get el() { return index.getElement(this); }
13
+ /**
14
+ * Data for the heat map. Each item defines a cell by xLabel, yLabel, and value.
15
+ * @property {string} xLabel - Label for the X-axis (horizontal).
16
+ * @property {string} yLabel - Label for the Y-axis (vertical).
17
+ * @property {number} value - Numeric value encoded as color.
18
+ */
19
+ adData = [];
20
+ /**
21
+ * Optional specification for axis titles, color range, and tooltip behavior.
22
+ * @property {string} [xAxisTitle] - Label for the X-axis.
23
+ * @property {string} [yAxisTitle] - Label for the Y-axis.
24
+ * @property {string[]} [colorRange] - Two or more colors for the value scale (Vega interpolates between them).
25
+ * @property {'auto' | 'none'} [tooltip] - Tooltip behavior.
26
+ */
27
+ adSpec = {};
28
+ async componentDidRender() {
29
+ await this.renderChart();
30
+ }
31
+ DEFAULT_COLOR_RANGE = ['#e8f4f8', '#0066a1'];
32
+ // @ts-ignore
33
+ async getViewData(data, spec) {
34
+ const rawRange = spec?.colorRange;
35
+ const colorRange = Array.isArray(rawRange) && rawRange.length >= 2 ? rawRange : this.DEFAULT_COLOR_RANGE;
36
+ const tooltip = spec?.tooltip !== 'none';
37
+ const valid = data.filter(d => d != null && typeof d.xLabel === 'string' && typeof d.yLabel === 'string' && d.xLabel !== '' && d.yLabel !== '' && typeof d.value === 'number');
38
+ const xLabels = [...new Set(valid.map(d => d.xLabel))];
39
+ const yLabels = [...new Set(valid.map(d => d.yLabel))];
40
+ return {
41
+ $schema: 'https://vega.github.io/schema/vega/v6.json',
42
+ description: 'A heat map with xLabel and yLabel categories and value encoded as color.',
43
+ width: 450,
44
+ height: 350,
45
+ padding: { left: 5, top: 5, bottom: 5, right: 70 },
46
+ autosize: { type: 'fit', resize: true },
47
+ data: [
48
+ {
49
+ name: 'source',
50
+ values: valid,
51
+ },
52
+ ],
53
+ scales: [
54
+ {
55
+ name: 'xscale',
56
+ type: 'band',
57
+ range: [0, { signal: 'width' }],
58
+ domain: xLabels,
59
+ padding: 0.05,
60
+ },
61
+ {
62
+ name: 'yscale',
63
+ type: 'band',
64
+ range: [{ signal: 'height' }, 0],
65
+ domain: yLabels,
66
+ padding: 0.05,
67
+ },
68
+ {
69
+ name: 'color',
70
+ type: 'sequential',
71
+ range: colorRange,
72
+ domain: { data: 'source', field: 'value' },
73
+ zero: true,
74
+ },
75
+ ],
76
+ axes: [
77
+ {
78
+ orient: 'bottom',
79
+ scale: 'xscale',
80
+ title: spec?.xAxisTitle ?? 'X',
81
+ labelAngle: -90,
82
+ labelAlign: 'right',
83
+ },
84
+ {
85
+ orient: 'left',
86
+ scale: 'yscale',
87
+ title: spec?.yAxisTitle ?? 'Y',
88
+ },
89
+ ],
90
+ legends: [
91
+ {
92
+ type: 'gradient',
93
+ fill: 'color',
94
+ orient: 'right',
95
+ direction: 'vertical',
96
+ title: 'Value',
97
+ titleLimit: 120,
98
+ tickCount: 5,
99
+ format: 's',
100
+ },
101
+ ],
102
+ marks: [
103
+ {
104
+ type: 'rect',
105
+ from: { data: 'source' },
106
+ encode: {
107
+ ...(tooltip && {
108
+ enter: {
109
+ tooltip: {
110
+ signal: "datum.xLabel + ' | ' + datum.yLabel + ' | ' + format(datum.value, ',.2f')",
111
+ },
112
+ },
113
+ }),
114
+ update: {
115
+ x: { scale: 'xscale', field: 'xLabel' },
116
+ y: { scale: 'yscale', field: 'yLabel' },
117
+ width: { scale: 'xscale', band: 1 },
118
+ height: { scale: 'yscale', band: 1 },
119
+ fill: { scale: 'color', field: 'value' },
120
+ },
121
+ hover: {
122
+ fill: { value: 'firebrick' },
123
+ opacity: { value: 0.8 },
124
+ },
125
+ },
126
+ },
127
+ ],
128
+ };
129
+ }
130
+ render() {
131
+ return (index.h(index.Host, { key: 'd15b44f268f153498e61dc7829fe0d45f315a992' }, index.h("div", { key: '7783444f4675c885980f1cd571737d506e00fdbc', id: "container", style: { width: '100%', height: '100%' } })));
132
+ }
133
+ };
134
+
7
135
  const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
8
136
  function lineStyleToStrokeDash(lineStyle) {
9
137
  switch (lineStyle) {
@@ -32,12 +160,13 @@ const ApolloDataLineChart = class extends apolloDataBase.ApolloBase {
32
160
  await this.renderChart();
33
161
  }
34
162
  injectTooltipStyles() {
35
- if (ApolloDataLineChart.tooltipStylesInjected) {
163
+ const chartClass = this.constructor;
164
+ if (chartClass.tooltipStylesInjected) {
36
165
  return;
37
166
  }
38
167
  const styleId = 'apollo-data-line-tooltip-styles';
39
168
  if (document.getElementById(styleId)) {
40
- ApolloDataLineChart.tooltipStylesInjected = true;
169
+ chartClass.tooltipStylesInjected = true;
41
170
  return;
42
171
  }
43
172
  const style = document.createElement('style');
@@ -86,16 +215,17 @@ const ApolloDataLineChart = class extends apolloDataBase.ApolloBase {
86
215
  }
87
216
  `;
88
217
  document.head.appendChild(style);
89
- ApolloDataLineChart.tooltipStylesInjected = true;
218
+ chartClass.tooltipStylesInjected = true;
90
219
  }
91
220
  // @ts-ignore
92
221
  async getViewData(data, spec) {
222
+ const componentTag = this.el?.tagName?.toLowerCase() ?? 'apollo-data-line-chart';
93
223
  if (!spec) {
94
- throw new Error('adSpec is required for apollo-data-line-chart');
224
+ throw new Error(`adSpec is required for ${componentTag}`);
95
225
  }
96
226
  const { tooltipPrefix = '', currencySymbol = '' } = spec;
97
227
  if (!data || data.length === 0) {
98
- throw new Error('Data is required for apollo-data-line-chart');
228
+ throw new Error(`Data is required for ${componentTag}`);
99
229
  }
100
230
  const uniqueCategories = Array.from(new Set(data.map(item => item.category)));
101
231
  const uniqueXValues = [...new Set(data.map(item => item.xValue))].sort((a, b) => a - b);
@@ -286,7 +416,7 @@ const ApolloDataLineChart = class extends apolloDataBase.ApolloBase {
286
416
  };
287
417
  }
288
418
  render() {
289
- return (index.h(index.Host, { key: '7799f01536f212d7a06da08c1e463d8529c5bf21' }, index.h("div", { key: '25463f10bbc0f5443c35ab03b5b53164d9ad1efd', id: "container", style: { width: '100%', height: '100%' } })));
419
+ return (index.h(index.Host, { key: 'fd64f4abb624b14a878808b23345910c9b23a72c' }, index.h("div", { key: 'aeda5086730862ca1368a0374caf2d918969839d', id: "container", style: { width: '100%', height: '100%' } })));
290
420
  }
291
421
  };
292
422
 
@@ -526,9 +656,228 @@ const ApolloDataScatterChart = class extends apolloDataBase.ApolloBase {
526
656
  };
527
657
  }
528
658
  render() {
529
- return (index.h(index.Host, { key: '60005ab926b0153b3e31729a69f5a64cf6558085' }, index.h("div", { key: '820de3e0ddbbc2650b9764e279d87531338e72e3', id: "container", style: { width: '100%', height: '100%' } })));
659
+ return (index.h(index.Host, { key: 'f6c1e8d9e9a6ba41dbbf8c2c5737895b96b0915d' }, index.h("div", { key: '2aeba82bc31c5995a3d5b532c339f5b45ae850f7', id: "container", style: { width: '100%', height: '100%' } })));
660
+ }
661
+ };
662
+
663
+ const ApolloDataWorldMapChart = class extends apolloDataBase.ApolloBase {
664
+ constructor(hostRef) {
665
+ super();
666
+ index.registerInstance(this, hostRef);
667
+ }
668
+ get el() { return index.getElement(this); }
669
+ /**
670
+ * Represents a single data point in the world map chart.
671
+ * @property {number} lon - Longitude coordinate used to position the point on the map.
672
+ * @property {number} lat - Latitude coordinate used to position the point on the map.
673
+ * @property {number} value - A numeric metric tied to the point.
674
+ * @property {string} label - Label displayed for the place or location represented by the point.
675
+ */
676
+ adData = [];
677
+ /**
678
+ * @property {string} pinColor - Color of the pin representing the point.
679
+ * @property {'circle' | 'square' | 'triangle'} pinShape - Shape of the pin representing the point.
680
+ */
681
+ adSpec = {};
682
+ async componentDidRender() {
683
+ await this.renderChart();
684
+ }
685
+ // @ts-ignore
686
+ // eslint-disable-next-line class-methods-use-this
687
+ async getViewData(data, spec) {
688
+ const pinColor = spec?.pinColor || '#d3544b';
689
+ const pinShape = spec?.pinShape || 'circle';
690
+ return {
691
+ $schema: 'https://vega.github.io/schema/vega/v6.json',
692
+ description: 'World map + tooltip + points.',
693
+ width: 600,
694
+ height: 400,
695
+ autosize: 'none',
696
+ background: '#cfe3f1',
697
+ signals: [
698
+ {
699
+ name: 'scale',
700
+ value: 85,
701
+ on: [
702
+ {
703
+ events: { type: 'wheel', consume: true },
704
+ update: 'clamp(scale * pow(1.002, -event.deltaY), 85, 2000)',
705
+ },
706
+ ],
707
+ },
708
+ {
709
+ name: 'xc',
710
+ value: 0,
711
+ on: [{ events: 'mousedown', update: 'x()' }],
712
+ },
713
+ {
714
+ name: 'yc',
715
+ value: 0,
716
+ on: [{ events: 'mousedown', update: 'y()' }],
717
+ },
718
+ {
719
+ name: 'xo',
720
+ value: 300,
721
+ on: [{ events: 'mousedown', update: 'tx' }],
722
+ },
723
+ {
724
+ name: 'yo',
725
+ value: 175,
726
+ on: [{ events: 'mousedown', update: 'ty' }],
727
+ },
728
+ {
729
+ name: 'tx',
730
+ value: 300,
731
+ on: [
732
+ {
733
+ events: '[mousedown, window:mouseup] > window:mousemove',
734
+ update: 'xo - (x() - xc)',
735
+ },
736
+ ],
737
+ },
738
+ {
739
+ name: 'ty',
740
+ value: 270,
741
+ on: [
742
+ {
743
+ events: '[mousedown, window:mouseup] > window:mousemove',
744
+ update: 'clamp(yo + y() - yc, -scale * 0.5, scale * 2.5 + height)',
745
+ },
746
+ ],
747
+ },
748
+ ],
749
+ projections: [
750
+ {
751
+ name: 'projection',
752
+ type: 'mercator',
753
+ scale: { signal: 'scale' },
754
+ rotate: [{ signal: '-(tx - width / 2) * 180 / (scale * PI)' }, 0, 0],
755
+ center: [0, 0],
756
+ translate: [{ signal: 'width / 2' }, { signal: 'ty' }],
757
+ },
758
+ ],
759
+ data: [
760
+ {
761
+ name: 'names',
762
+ url: 'https://raw.githubusercontent.com/KoGor/Map-Icons-Generator/master/data/world-110m-country-names.tsv',
763
+ format: { type: 'tsv' },
764
+ transform: [{ type: 'formula', as: 'id', expr: 'toNumber(datum.id)' }],
765
+ },
766
+ {
767
+ name: 'metrics',
768
+ values: data,
769
+ },
770
+ {
771
+ name: 'world',
772
+ url: 'https://vega.github.io/editor/data/world-110m.json',
773
+ format: { type: 'topojson', feature: 'countries' },
774
+ transform: [
775
+ {
776
+ type: 'lookup',
777
+ from: 'names',
778
+ key: 'id',
779
+ fields: ['id'],
780
+ values: ['name'],
781
+ as: ['name'],
782
+ },
783
+ { type: 'filter', expr: "datum.name != 'Antarctica'" },
784
+ ],
785
+ },
786
+ {
787
+ name: 'points',
788
+ source: 'metrics',
789
+ transform: [
790
+ { type: 'filter', expr: 'isValid(datum.lon) && isValid(datum.lat)' },
791
+ {
792
+ type: 'geopoint',
793
+ projection: 'projection',
794
+ fields: ['lon', 'lat'],
795
+ as: ['x', 'y'],
796
+ },
797
+ ],
798
+ },
799
+ {
800
+ name: 'continentLabels',
801
+ values: [
802
+ { name: 'North America', lon: -105, lat: 45 },
803
+ { name: 'South America', lon: -60, lat: -15 },
804
+ { name: 'Europe', lon: 15, lat: 52 },
805
+ { name: 'Africa', lon: 20, lat: 5 },
806
+ { name: 'Asia', lon: 90, lat: 35 },
807
+ { name: 'Oceania', lon: 135, lat: -25 },
808
+ ],
809
+ transform: [
810
+ {
811
+ type: 'geopoint',
812
+ projection: 'projection',
813
+ fields: ['lon', 'lat'],
814
+ as: ['x', 'y'],
815
+ },
816
+ ],
817
+ },
818
+ ],
819
+ marks: [
820
+ {
821
+ type: 'shape',
822
+ from: { data: 'world' },
823
+ transform: [{ type: 'geoshape', projection: 'projection' }],
824
+ encode: {
825
+ update: {
826
+ fill: { value: '#8fbf8f' },
827
+ stroke: { value: '#6c8c8c' },
828
+ strokeWidth: { value: 0.7 },
829
+ tooltip: { signal: "{Country: datum.name ? datum.name : 'Unknown'}" },
830
+ },
831
+ hover: {
832
+ stroke: { value: '#2b3a42' },
833
+ strokeWidth: { value: 1.3 },
834
+ },
835
+ },
836
+ },
837
+ {
838
+ type: 'symbol',
839
+ from: { data: 'points' },
840
+ encode: {
841
+ update: {
842
+ x: { field: 'x' },
843
+ y: { field: 'y' },
844
+ size: { value: 80 },
845
+ fill: { value: pinColor },
846
+ stroke: { value: 'white' },
847
+ shape: { value: pinShape },
848
+ strokeWidth: { value: 1 },
849
+ tooltip: {
850
+ signal: '{Label: datum.label, Value: datum.value, Latitude: datum.lat, Longitude: datum.lon}',
851
+ },
852
+ },
853
+ },
854
+ },
855
+ {
856
+ type: 'text',
857
+ from: { data: 'continentLabels' },
858
+ encode: {
859
+ update: {
860
+ x: { field: 'x' },
861
+ y: { field: 'y' },
862
+ text: { field: 'name' },
863
+ align: { value: 'center' },
864
+ baseline: { value: 'middle' },
865
+ fontSize: { value: 12 },
866
+ fontWeight: { value: '600' },
867
+ fill: { value: '#2b3a42' },
868
+ fillOpacity: { value: 0.5 },
869
+ },
870
+ },
871
+ },
872
+ ],
873
+ };
874
+ }
875
+ render() {
876
+ return (index.h(index.Host, { key: '8053ea3b9706cdd03a430157b3f63e93c1201d1f' }, index.h("div", { key: '514807ae8dd4868d3d74e86c4260b7b9967c0ac2', id: "container", style: { width: '100%', height: '100%' } })));
530
877
  }
531
878
  };
532
879
 
880
+ exports.apollo_data_heat_map = ApolloDataHeatMap;
533
881
  exports.apollo_data_line_chart = ApolloDataLineChart;
534
882
  exports.apollo_data_scatter_chart = ApolloDataScatterChart;
883
+ exports.apollo_data_world_map_chart = ApolloDataWorldMapChart;
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cl7HgRm0.js');
3
+ var index = require('./index-Bd5risOy.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.41.3 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.43.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["apollo-data-line-chart_2.cjs",[[513,"apollo-data-line-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-scatter-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-bar-chart.cjs",[[513,"apollo-data-bar-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-donut-chart.cjs",[[513,"apollo-data-donut-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]]], options);
22
+ return index.bootstrapLazy([["apollo-data-heat-map_4.cjs",[[513,"apollo-data-heat-map",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-line-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-scatter-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}],[513,"apollo-data-world-map-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-bar-chart.cjs",[[513,"apollo-data-bar-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]],["apollo-data-donut-chart.cjs",[[513,"apollo-data-donut-chart",{"adData":[1,"ad-data"],"adSpec":[1,"ad-spec"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;