@xplortech/apollo-data 0.0.4 → 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 (88) 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-2nuV5Vny.js +1 -0
  5. package/dist/apollo-data/p-839050b7.entry.js +1 -0
  6. package/dist/apollo-data/p-C2k3WBpi.js +11 -0
  7. package/dist/apollo-data/p-D64asVrg.js +2 -0
  8. package/dist/apollo-data/p-e2c3a317.entry.js +1 -0
  9. package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +315 -0
  10. package/dist/{esm/apollo-data-bar-chart_2.entry.js → cjs/apollo-data-base-COGMOEqL.js} +9 -724
  11. package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +408 -0
  12. package/dist/cjs/apollo-data-heat-map_4.cjs.entry.js +883 -0
  13. package/dist/cjs/apollo-data.cjs.js +3 -3
  14. package/dist/cjs/constants-B3weDEpc.js +5 -0
  15. package/dist/cjs/{index-Cl7HgRm0.js → index-Bd5risOy.js} +116 -63
  16. package/dist/cjs/loader.cjs.js +2 -2
  17. package/dist/collection/apollo-data-base.js +4 -8
  18. package/dist/collection/collection-manifest.json +7 -2
  19. package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +8 -7
  20. package/dist/collection/components/apollo-data-bar/apollo-data-bar.stories.js +122 -0
  21. package/dist/collection/components/apollo-data-donut/apollo-data-donut.js +1 -1
  22. package/dist/collection/components/apollo-data-donut/apollo-data-donut.stories.js +132 -0
  23. package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.js +208 -0
  24. package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.stories.js +137 -0
  25. package/dist/collection/components/apollo-data-line/apollo-data-line.js +348 -0
  26. package/dist/collection/components/apollo-data-line/apollo-data-line.stories.js +122 -0
  27. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +329 -0
  28. package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.stories.js +147 -0
  29. package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.js +294 -0
  30. package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.stories.js +126 -0
  31. package/dist/collection/examples/apollo-data-heat-map.examples.js +131 -0
  32. package/dist/collection/examples/apollo-data-line.examples.js +91 -0
  33. package/dist/collection/examples/apollo-data-scatter.examples.js +94 -0
  34. package/dist/collection/examples/apollo-data-world-map.examples.js +45 -0
  35. package/dist/collection/examples/index.js +3 -0
  36. package/dist/collection/utils/code-generator.js +1 -1
  37. package/dist/components/apollo-data-bar-chart.js +1 -1
  38. package/dist/components/apollo-data-donut-chart.js +1 -1
  39. package/dist/components/apollo-data-heat-map.d.ts +11 -0
  40. package/dist/components/apollo-data-heat-map.js +1 -0
  41. package/dist/components/apollo-data-line-chart.d.ts +11 -0
  42. package/dist/components/apollo-data-line-chart.js +1 -0
  43. package/dist/components/apollo-data-scatter-chart.d.ts +11 -0
  44. package/dist/components/apollo-data-scatter-chart.js +1 -0
  45. package/dist/components/apollo-data-world-map-chart.d.ts +11 -0
  46. package/dist/components/apollo-data-world-map-chart.js +1 -0
  47. package/dist/components/index.js +1 -1
  48. package/dist/components/p-2nuV5Vny.js +1 -0
  49. package/dist/components/p-CfbMSXKd.js +11 -0
  50. package/dist/components/p-gcjU8DVr.js +1 -0
  51. package/dist/esm/apollo-data-bar-chart.entry.js +313 -0
  52. package/dist/{cjs/apollo-data-bar-chart_2.cjs.entry.js → esm/apollo-data-base-C2k3WBpi.js} +8 -728
  53. package/dist/esm/apollo-data-donut-chart.entry.js +406 -0
  54. package/dist/esm/apollo-data-heat-map_4.entry.js +878 -0
  55. package/dist/esm/apollo-data.js +4 -4
  56. package/dist/esm/constants-2nuV5Vny.js +3 -0
  57. package/dist/esm/{index-Bb2nY-Tf.js → index-D64asVrg.js} +116 -63
  58. package/dist/esm/loader.js +3 -3
  59. package/dist/types/apollo-data-base.d.ts +2 -2
  60. package/dist/types/components/apollo-data-bar/apollo-data-bar.stories.d.ts +5 -0
  61. package/dist/types/components/apollo-data-donut/apollo-data-donut.stories.d.ts +5 -0
  62. package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.d.ts +140 -0
  63. package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.stories.d.ts +5 -0
  64. package/dist/types/components/apollo-data-line/apollo-data-line.d.ts +244 -0
  65. package/dist/types/components/apollo-data-line/apollo-data-line.stories.d.ts +5 -0
  66. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +327 -0
  67. package/dist/types/components/apollo-data-scatter/apollo-data-scatter.stories.d.ts +5 -0
  68. package/dist/types/components/apollo-data-world-map/apollo-data-world-map.d.ts +281 -0
  69. package/dist/types/components/apollo-data-world-map/apollo-data-world-map.stories.d.ts +5 -0
  70. package/dist/types/components.d.ts +210 -4
  71. package/dist/types/examples/apollo-data-heat-map.examples.d.ts +11 -0
  72. package/dist/types/examples/apollo-data-line.examples.d.ts +12 -0
  73. package/dist/types/examples/apollo-data-scatter.examples.d.ts +11 -0
  74. package/dist/types/examples/apollo-data-world-map.examples.d.ts +11 -0
  75. package/dist/types/examples/index.d.ts +3 -0
  76. package/dist/types/stencil-public-runtime.d.ts +23 -2
  77. package/dist/types/utils/code-generator.d.ts +1 -3
  78. package/package.json +8 -8
  79. package/src/examples/apollo-data-bar.examples.ts +157 -157
  80. package/src/examples/apollo-data-heat-map.examples.ts +147 -0
  81. package/src/examples/apollo-data-line.examples.ts +103 -0
  82. package/src/examples/apollo-data-scatter.examples.ts +109 -0
  83. package/src/examples/apollo-data-world-map.examples.ts +57 -0
  84. package/src/examples/index.ts +4 -1
  85. package/dist/apollo-data/p-Bb2nY-Tf.js +0 -2
  86. package/dist/apollo-data/p-e6584598.entry.js +0 -11
  87. package/dist/components/p-7XF5Cax8.js +0 -11
  88. 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}
@@ -0,0 +1 @@
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}
@@ -0,0 +1,315 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-Bd5risOy.js');
4
+ var apolloDataBase = require('./apollo-data-base-COGMOEqL.js');
5
+ var constants = require('./constants-B3weDEpc.js');
6
+
7
+ const FONT_FAMILY = "apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
8
+ const ApolloDataBarChart = class extends apolloDataBase.ApolloBase {
9
+ constructor(hostRef) {
10
+ super();
11
+ index.registerInstance(this, hostRef);
12
+ }
13
+ get el() { return index.getElement(this); }
14
+ adData = [];
15
+ adSpec = null;
16
+ static tooltipStylesInjected = false;
17
+ componentDidLoad() {
18
+ this.injectTooltipStyles();
19
+ }
20
+ async componentDidRender() {
21
+ await this.renderChart();
22
+ }
23
+ injectTooltipStyles() {
24
+ const chartClass = this.constructor;
25
+ if (chartClass.tooltipStylesInjected) {
26
+ return;
27
+ }
28
+ const styleId = 'apollo-data-bar-tooltip-styles';
29
+ if (document.getElementById(styleId)) {
30
+ chartClass.tooltipStylesInjected = true;
31
+ return;
32
+ }
33
+ const style = document.createElement('style');
34
+ style.id = styleId;
35
+ style.textContent = `
36
+ #vg-tooltip-element {
37
+ background-color: #ffffff;
38
+ border: 1px solid #e1e2e8;
39
+ border-radius: 0.25rem;
40
+ box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.05);
41
+ font-family: apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif;
42
+ font-weight: 500;
43
+ padding: 0.25rem 0.75rem;
44
+ pointer-events: none;
45
+ text-align: center;
46
+ transform: translateY(20%);
47
+ white-space: pre;
48
+ z-index: 999999999;
49
+ }
50
+
51
+ #vg-tooltip-element table tr td.key {
52
+ color: #6a6d7d;
53
+ text-align: center;
54
+ }
55
+
56
+ #vg-tooltip-element table tr td.value {
57
+ text-align: center;
58
+ }
59
+
60
+ #vg-tooltip-element.dark-theme {
61
+ background-color: #292632;
62
+ border: 1px solid #6a6d7d;
63
+ box-shadow: 0 4px 6px -1px rgba(48, 45, 59, 0.1), 0 2px 4px -1px rgba(48, 45, 59, 0.5);
64
+ color: #ffffff;
65
+ }
66
+
67
+ #vg-tooltip-element::after {
68
+ border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
69
+ border-style: solid;
70
+ border-width: 9px;
71
+ bottom: -17px;
72
+ content: '';
73
+ left: 50%;
74
+ position: absolute;
75
+ transform: translateX(-50%);
76
+ }
77
+ `;
78
+ document.head.appendChild(style);
79
+ chartClass.tooltipStylesInjected = true;
80
+ }
81
+ async getViewData(data, spec) {
82
+ const componentTag = this.el?.tagName?.toLowerCase() ?? 'apollo-data-bar-chart';
83
+ if (!spec) {
84
+ throw new Error(`adSpec is required for ${componentTag}`);
85
+ }
86
+ const { tooltipPrefix = '', currencySymbol = '' } = spec;
87
+ if (!data || data.length === 0) {
88
+ throw new Error(`Data is required for ${componentTag}`);
89
+ }
90
+ const uniqueCategories = Array.from(new Set(data.map(item => item.category)));
91
+ const formatNumber = tooltipPrefix ? '.2f' : '.0f';
92
+ const currencyPrefix = tooltipPrefix ? currencySymbol : '';
93
+ return {
94
+ $schema: 'https://vega.github.io/schema/vega/v5.json',
95
+ config: {
96
+ text: {
97
+ fill: '#6a6d7d',
98
+ font: FONT_FAMILY,
99
+ labelFontSize: 12,
100
+ labelFontWeight: 400,
101
+ },
102
+ axis: {
103
+ labelColor: '#6a6d7d',
104
+ titleColor: '#6a6d7d',
105
+ labelFont: FONT_FAMILY,
106
+ titleFont: FONT_FAMILY,
107
+ titleFontWeight: 400,
108
+ },
109
+ legend: {
110
+ labelColor: '#6a6d7d',
111
+ titleColor: '#6a6d7d',
112
+ labelFont: FONT_FAMILY,
113
+ titleFont: FONT_FAMILY,
114
+ labelFontSize: 12,
115
+ labelLimit: 95,
116
+ },
117
+ title: {
118
+ color: '#6a6d7d',
119
+ font: FONT_FAMILY,
120
+ labelFontSize: 12,
121
+ labelFontWeight: 400,
122
+ },
123
+ },
124
+ height: 250,
125
+ autosize: { type: 'fit-x', contains: 'padding', resize: true },
126
+ signals: [
127
+ {
128
+ name: 'containerW',
129
+ update: 'max(containerSize()[0], 400)',
130
+ },
131
+ {
132
+ name: 'legendColumns',
133
+ update: 'ceil(containerW / 140)',
134
+ },
135
+ {
136
+ name: 'hoveredPeriod',
137
+ value: null,
138
+ on: [
139
+ { events: 'rect:mouseover', update: 'datum.period' },
140
+ { events: 'rect:mouseout', update: 'null' },
141
+ ],
142
+ },
143
+ ],
144
+ width: { signal: 'containerW' },
145
+ data: [
146
+ {
147
+ name: 'raw',
148
+ values: data,
149
+ },
150
+ {
151
+ name: 'periodTotals',
152
+ source: 'raw',
153
+ transform: [
154
+ {
155
+ type: 'aggregate',
156
+ groupby: ['periodId'],
157
+ fields: ['value'],
158
+ ops: ['sum'],
159
+ as: ['total'],
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ name: 'table',
165
+ source: 'raw',
166
+ transform: [
167
+ {
168
+ type: 'lookup',
169
+ from: 'periodTotals',
170
+ key: 'periodId',
171
+ fields: ['periodId'],
172
+ values: ['total'],
173
+ as: ['total'],
174
+ },
175
+ {
176
+ type: 'stack',
177
+ groupby: ['periodId'],
178
+ sort: { field: 'category' },
179
+ field: 'value',
180
+ },
181
+ {
182
+ type: 'formula',
183
+ as: 'periodId',
184
+ expr: 'datum.periodId',
185
+ },
186
+ {
187
+ type: 'formula',
188
+ as: 'labelOnly',
189
+ expr: 'datum.label',
190
+ },
191
+ ],
192
+ },
193
+ {
194
+ name: 'periodLabels',
195
+ source: 'raw',
196
+ transform: [
197
+ {
198
+ type: 'aggregate',
199
+ groupby: ['periodId', 'label'],
200
+ },
201
+ ],
202
+ },
203
+ ],
204
+ scales: [
205
+ {
206
+ name: 'x',
207
+ type: 'band',
208
+ domain: { data: 'table', field: 'periodId' },
209
+ range: 'width',
210
+ paddingInner: 0.35,
211
+ paddingOuter: 0.02,
212
+ },
213
+ {
214
+ name: 'xLabels',
215
+ type: 'ordinal',
216
+ domain: { data: 'periodLabels', field: 'periodId' },
217
+ range: { data: 'periodLabels', field: 'label' },
218
+ },
219
+ {
220
+ name: 'y',
221
+ type: 'linear',
222
+ domain: { data: 'table', field: 'y1' },
223
+ nice: true,
224
+ zero: true,
225
+ range: 'height',
226
+ },
227
+ {
228
+ name: 'color',
229
+ type: 'ordinal',
230
+ domain: uniqueCategories,
231
+ range: spec?.colorSet ?? constants.CHART_COLORS,
232
+ },
233
+ ],
234
+ axes: [
235
+ {
236
+ orient: 'bottom',
237
+ scale: 'x',
238
+ title: spec?.xAxisTitle,
239
+ labelPadding: 12,
240
+ titlePadding: 12,
241
+ labelAngle: -90,
242
+ labelAlign: 'right',
243
+ labelBaseline: 'middle',
244
+ tickSize: 3,
245
+ labelFontSize: 12,
246
+ titleFontSize: 14,
247
+ ticks: false,
248
+ domain: false,
249
+ encode: {
250
+ labels: {
251
+ update: {
252
+ text: { signal: "scale('xLabels', datum.value)" },
253
+ },
254
+ },
255
+ },
256
+ },
257
+ {
258
+ orient: 'left',
259
+ scale: 'y',
260
+ title: spec?.yAxisTitle || '',
261
+ format: ',.0f',
262
+ grid: true,
263
+ tickCount: 6,
264
+ labelFontSize: 12,
265
+ titleFontSize: 14,
266
+ ticks: false,
267
+ domain: false,
268
+ tickBand: 'extent',
269
+ labelPadding: 10,
270
+ },
271
+ ],
272
+ legends: [
273
+ {
274
+ fill: 'color',
275
+ orient: 'bottom',
276
+ direction: 'horizontal',
277
+ columns: { signal: 'legendColumns' },
278
+ title: null,
279
+ symbolType: 'square',
280
+ rowPadding: 8,
281
+ symbolOffset: -35,
282
+ symbolSize: 100,
283
+ labelOffset: 8,
284
+ labelLimit: 95,
285
+ },
286
+ ],
287
+ marks: [
288
+ {
289
+ type: 'rect',
290
+ from: { data: 'table' },
291
+ encode: {
292
+ enter: {
293
+ x: { scale: 'x', field: 'periodId' },
294
+ width: { scale: 'x', band: 1 },
295
+ y: { scale: 'y', field: 'y1' },
296
+ y2: { scale: 'y', field: 'y0' },
297
+ fill: { scale: 'color', field: 'category' },
298
+ tooltip: {
299
+ signal: `datum.category + ': ${currencyPrefix}' + format(datum.value, ',${formatNumber}') + '\\nTotal: ${currencyPrefix}' + format(datum.total, ',${formatNumber}')`,
300
+ },
301
+ },
302
+ update: {
303
+ opacity: [{ test: 'hoveredPeriod && datum.period !== hoveredPeriod', value: 0.2 }, { value: 1 }],
304
+ },
305
+ },
306
+ },
307
+ ],
308
+ };
309
+ }
310
+ render() {
311
+ return (index.h(index.Host, { key: 'a0aebbff4fb177de35eb90329de81a1098663620' }, index.h("div", { key: '9e753e876df877d46254a02349850414914d9231', id: "container", style: { width: '100%', height: '100%' } })));
312
+ }
313
+ };
314
+
315
+ exports.apollo_data_bar_chart = ApolloDataBarChart;