@xplortech/apollo-data 0.0.5 → 0.0.7
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.
- package/README.md +15 -91
- package/dist/apollo-data/apollo-data.esm.js +1 -1
- package/dist/apollo-data/p-4d3f0792.entry.js +1 -0
- package/dist/apollo-data/p-C2k3WBpi.js +11 -0
- package/dist/apollo-data/p-D64asVrg.js +2 -0
- package/dist/apollo-data/{p-b7471c12.entry.js → p-e2c3a317.entry.js} +1 -1
- package/dist/cjs/apollo-data-bar-chart_5.cjs.entry.js +1193 -0
- package/dist/cjs/{apollo-data-base-CxVQ-WVP.js → apollo-data-base-COGMOEqL.js} +7 -11
- package/dist/cjs/apollo-data-donut-chart.cjs.entry.js +3 -3
- package/dist/cjs/apollo-data.cjs.js +3 -3
- package/dist/cjs/{index-Cl7HgRm0.js → index-Bd5risOy.js} +116 -63
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/apollo-data-base.js +4 -8
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/apollo-data-bar/apollo-data-bar.js +10 -9
- package/dist/collection/components/apollo-data-bar/apollo-data-bar.stories.js +122 -0
- package/dist/collection/components/apollo-data-donut/apollo-data-donut.js +1 -1
- package/dist/collection/components/apollo-data-donut/apollo-data-donut.stories.js +132 -0
- package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.js +208 -0
- package/dist/collection/components/apollo-data-heat-map/apollo-data-heat-map.stories.js +137 -0
- package/dist/collection/components/apollo-data-line/apollo-data-line.js +8 -6
- package/dist/collection/components/apollo-data-line/apollo-data-line.stories.js +122 -0
- package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.js +1 -1
- package/dist/collection/components/apollo-data-scatter/apollo-data-scatter.stories.js +147 -0
- package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.js +294 -0
- package/dist/collection/components/apollo-data-world-map/apollo-data-world-map.stories.js +126 -0
- package/dist/collection/examples/apollo-data-heat-map.examples.js +131 -0
- package/dist/collection/examples/apollo-data-world-map.examples.js +45 -0
- package/dist/collection/examples/index.js +2 -0
- package/dist/collection/utils/code-generator.js +1 -1
- package/dist/components/apollo-data-bar-chart.js +1 -1
- package/dist/components/apollo-data-donut-chart.js +1 -1
- package/dist/components/apollo-data-heat-map.d.ts +11 -0
- package/dist/components/apollo-data-heat-map.js +1 -0
- package/dist/components/apollo-data-line-chart.js +1 -1
- package/dist/components/apollo-data-scatter-chart.js +1 -1
- package/dist/components/apollo-data-world-map-chart.d.ts +11 -0
- package/dist/components/apollo-data-world-map-chart.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-CfbMSXKd.js +11 -0
- package/dist/components/p-gcjU8DVr.js +1 -0
- package/dist/esm/apollo-data-bar-chart_5.entry.js +1187 -0
- package/dist/esm/{apollo-data-base-BWkrM8dc.js → apollo-data-base-C2k3WBpi.js} +7 -11
- package/dist/esm/apollo-data-donut-chart.entry.js +3 -3
- package/dist/esm/apollo-data.js +4 -4
- package/dist/esm/{index-Bb2nY-Tf.js → index-D64asVrg.js} +116 -63
- package/dist/esm/loader.js +3 -3
- package/dist/types/apollo-data-base.d.ts +2 -2
- package/dist/types/components/apollo-data-bar/apollo-data-bar.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-donut/apollo-data-donut.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.d.ts +140 -0
- package/dist/types/components/apollo-data-heat-map/apollo-data-heat-map.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-line/apollo-data-line.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-scatter/apollo-data-scatter.d.ts +1 -3
- package/dist/types/components/apollo-data-scatter/apollo-data-scatter.stories.d.ts +5 -0
- package/dist/types/components/apollo-data-world-map/apollo-data-world-map.d.ts +281 -0
- package/dist/types/components/apollo-data-world-map/apollo-data-world-map.stories.d.ts +5 -0
- package/dist/types/components.d.ts +128 -8
- package/dist/types/examples/apollo-data-heat-map.examples.d.ts +11 -0
- package/dist/types/examples/apollo-data-scatter.examples.d.ts +1 -1
- package/dist/types/examples/apollo-data-world-map.examples.d.ts +11 -0
- package/dist/types/examples/index.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +23 -2
- package/dist/types/utils/code-generator.d.ts +1 -3
- package/package.json +8 -8
- package/src/examples/apollo-data-bar.examples.ts +157 -157
- package/src/examples/apollo-data-heat-map.examples.ts +147 -0
- package/src/examples/apollo-data-line.examples.ts +91 -91
- package/src/examples/apollo-data-scatter.examples.ts +1 -1
- package/src/examples/apollo-data-world-map.examples.ts +57 -0
- package/src/examples/index.ts +3 -1
- package/dist/apollo-data/p-2nuV5Vny.js +0 -1
- package/dist/apollo-data/p-4ac3c97c.entry.js +0 -1
- package/dist/apollo-data/p-BWkrM8dc.js +0 -11
- package/dist/apollo-data/p-Bb2nY-Tf.js +0 -2
- package/dist/apollo-data/p-e518baac.entry.js +0 -1
- package/dist/cjs/apollo-data-bar-chart.cjs.entry.js +0 -314
- package/dist/cjs/apollo-data-line-chart_2.cjs.entry.js +0 -534
- package/dist/cjs/constants-B3weDEpc.js +0 -5
- package/dist/components/p-7XF5Cax8.js +0 -11
- package/dist/components/p-Dws5s-Xe.js +0 -1
- package/dist/esm/apollo-data-bar-chart.entry.js +0 -312
- package/dist/esm/apollo-data-line-chart_2.entry.js +0 -531
- package/dist/esm/constants-2nuV5Vny.js +0 -3
|
@@ -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-
|
|
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}
|