UNPKG

react-jsx-highcharts

Version:

Highcharts charts built using React components

1 lines 20.4 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactHighcharts=t(require("react")):e.ReactHighcharts=t(e.React)}("undefined"!=typeof self?self:this,(e=>(()=>{"use strict";var t={12:t=>{t.exports=e}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};r.r(i),r.d(i,{Annotation:()=>Ae,AreaRangeSeries:()=>At,AreaSeries:()=>jt,AreaSplineRangeSeries:()=>Lt,AreaSplineSeries:()=>Tt,Axis:()=>ne,BarSeries:()=>Pt,BaseChart:()=>X,BellCurveSeries:()=>Rt,BoxPlotSeries:()=>Bt,BubbleSeries:()=>Nt,BulletSeries:()=>kt,Caption:()=>Be,Chart:()=>J,ColorAxis:()=>Ne,ColumnPyramidSeries:()=>Dt,ColumnRangeSeries:()=>Ht,ColumnSeries:()=>Vt,Credits:()=>De,CylinderSeries:()=>Ut,Debug:()=>wt,DependencyWheelSeries:()=>It,ErrorBarSeries:()=>zt,Funnel3dSeries:()=>Mt,FunnelSeries:()=>Ft,GaugeSeries:()=>Wt,HeatmapSeries:()=>Gt,Highcharts3dChart:()=>we,HighchartsChart:()=>_,HighchartsProvider:()=>F,HighchartsSparkline:()=>he,HistogramSeries:()=>Xt,ItemSeries:()=>qt,Legend:()=>qe,LineSeries:()=>_t,Loading:()=>Ue,NetworkGraphSeries:()=>$t,OrganizationSeries:()=>nn,PackedBubbleSeries:()=>Yt,Pane:()=>Ye,ParetoSeries:()=>Zt,PieSeries:()=>Jt,PlotBand:()=>lt,PlotLine:()=>ct,PolygonSeries:()=>Kt,Pyramid3dSeries:()=>en,PyramidSeries:()=>Qt,SankeySeries:()=>tn,Scatter3dSeries:()=>an,ScatterSeries:()=>rn,Series:()=>V,SolidGaugeSeries:()=>on,SplineSeries:()=>sn,StreamGraphSeries:()=>ln,Subtitle:()=>ft,SunburstSeries:()=>cn,TilemapSeries:()=>un,TimelineSeries:()=>dn,Title:()=>bt,Tooltip:()=>gt,TreemapSeries:()=>fn,VariablePieSeries:()=>pn,VariwideSeries:()=>mn,VectorSeries:()=>hn,VennSeries:()=>bn,WaterfallSeries:()=>yn,WindBarbSeries:()=>gn,XAxis:()=>ae,XRangeSeries:()=>vn,YAxis:()=>le,ZAxis:()=>xt,getEventsConfig:()=>h,getNonEventHandlerProps:()=>b,useAxis:()=>L,useChart:()=>w,useHighcharts:()=>E,useModifiedProps:()=>$,usePlotBandLine:()=>rt,useSeries:()=>Ot,withHighcharts:()=>z,withSeriesType:()=>I});var a=r(12);const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s;const l=new Uint8Array(16);function c(){if(!s){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");s=crypto.getRandomValues.bind(crypto)}return s(l)}const u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));const d=function(e,t,n){if(o.randomUUID&&!t&&!e)return o.randomUUID();const r=(e=e||{}).random||(e.rng||c)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase()}(r)},f=(0,a.createContext)();f.displayName="SeriesContext";const p=f;function m(e,t){let n={};return e&&Object.keys(e).filter((n=>t(n,e[n]))).forEach((t=>{n[t]=e[t]})),n}const b=e=>m(e,((e,t)=>!y(e,t))),h=e=>{const t=(e=>m(e,y))(e),n={};return Object.keys(t).forEach((e=>{const r=e.slice(2)[0].toLowerCase()+e.slice(3);n[r]=t[e]})),n},y=(e,t)=>0===e.indexOf("on")&&e.length>2&&"function"==typeof t;function g(e,t,n=!1){let{children:r,...i}=t;const a=m(i,((t,n)=>!e||!1===Object.is(n,e[t])));return!n||e&&!1!==Object.is(e.children,r)||(a.text=r),Object.keys(a).length>0&&a}function v(e){const t=(0,a.useRef)();return(0,a.useEffect)((()=>{t.current=e})),t.current}const S=(0,a.createContext)();S.displayName="HighchartsContext";const x=S;function E(){return(0,a.useContext)(x)}const P=(0,a.createContext)();P.displayName="ChartContext";const O=P;function w(){return(0,a.useContext)(O)}const C=(0,a.createContext)();C.displayName="AxisContext";const A=C,j=e=>e?{object:e,id:e.userOptions&&e.userOptions.id,type:e.coll,update:e.update.bind(e),remove:e.remove.bind(e),addPlotBandOrLine:e.addPlotBandOrLine.bind(e),removePlotBandOrLine:e.removePlotBandOrLine.bind(e),getExtremes:e.getExtremes.bind(e),setExtremes:e.setExtremes.bind(e),setTitle:e.setTitle.bind(e)}:null;function L(e){const t=w(),n=(0,a.useContext)(A),r=()=>{if(n)return n;if(e){const n=t.get(e);return j(n)}return null},[i,o]=(0,a.useState)(r);return(0,a.useEffect)((()=>{i||o(r())}),[]),(0,a.useDebugValue)(i?i.id:null),i}const T=(0,a.createContext)();T.displayName="ColorAxisContext";const R=T,B=e=>e?{object:e,id:e.userOptions&&e.userOptions.id}:null;function N(e){return e?{object:e,id:e.userOptions&&e.userOptions.id,type:e.type,update:e.update.bind(e),remove:e.remove.bind(e),setData:e.setData.bind(e),setVisible:e.setVisible.bind(e)}:null}const k=[],D=(0,a.memo)((({id:e=d,data:t=k,isDataEqual:n=Object.is,type:r="line",visible:i=!0,children:o=null,axisId:s,requiresAxis:l=!0,jsxOptions:c,...u})=>{const f={id:e,data:t,type:r,visible:i,...u},m=E(),{addSeries:y,needsRedraw:S}=w(),x=(0,a.useRef)(null),[,P]=(0,a.useState)(!1),O=(0,a.useRef)(null),C=L(s),A=function(){w();const e=(0,a.useContext)(R),t=()=>e||null,[n,r]=(0,a.useState)(t);return(0,a.useEffect)((()=>{n||r(t())}),[]),(0,a.useDebugValue)(n?n.id:null),n}();(0,a.useEffect)((()=>{if(l&&!C)return;const e=H(f,C,A,l),t=y(e,!1);return x.current=t,O.current=N(x.current),P(!0),S(),()=>{if(t&&t.remove){try{t.remove.bind(t)(!1),x.current=null}catch{}S()}}}),[C]);const j=v(f);return(0,a.useEffect)((()=>{if(!j)return;if(!x.current)return;const e=x.current,{visible:t,data:r,...i}=f;let a=!1;if(!1===n(r,j.data)){const t=c&&c.animation,n=c&&c.updatePoints;e.setData(r,!1,t,n),a=!0}t!==j.visible&&(e.setVisible(t,!1),a=!0);const o=g(j,i);if(!1!==o){const t=b(o);e.update(t,!1);const n=h(o),r=h(j);Object.keys(n).forEach((t=>{const i=r[t];i&&m.removeEvent(e,t,i);const a=n[t];a&&m.addEvent(e,t,a)})),a=!0}a&&S()})),x.current?a.createElement(p.Provider,{value:O.current},o):null})),H=(e,t,n,r)=>{const{id:i,data:a,...o}=e,s="function"==typeof i?i():i,l=b(o),c={id:s,data:a,events:h(o),...l};return n&&(c.colorAxis=n.id),r&&(c[t.type]=t.id),c};D.displayName="Series";const V=D;function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(null,arguments)}function I(e,t={}){const n=n=>a.createElement(V,U({},n,t,{type:e.toLowerCase()}));return n.displayName=`${e}Series`,n}function z(e,t){return function(n){return a.createElement(F,{Highcharts:t},a.createElement(e,n))}}const F=({Highcharts:e,children:t})=>a.createElement(x.Provider,{value:e},t);function M(e){const t=window.cancelAnimationFrame,n=window.requestAnimationFrame;var r;return function(...i){r&&t(r),r=n(e.bind(e,...i))}}function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W.apply(null,arguments)}const G=e=>e,X=({children:e=null,callback:t=G,className:n="",containerProps:r=null,...i})=>{const[o,s]=(0,a.useState)(!1),l=(0,a.useRef)(null),c=(0,a.useRef)(null),u=(0,a.useRef)(null);(0,a.useLayoutEffect)((()=>{const e=((e,t)=>{if(!t)return;const{chartCreationFunc:n,callback:r,chart:i,polar:a,gauge:o,styledMode:s=!1,children:l,...c}=e,u=n(t,{chart:{styledMode:s,...i},title:{text:null},subtitle:{text:null},legend:{enabled:!1},rangeSelector:{enabled:!1},navigator:{enabled:!1},scrollbar:{enabled:!1},tooltip:{enabled:!1},credits:{enabled:!1},series:[],xAxis:[],yAxis:[],...c});return u.polar=a,u.angular=o,u})(i,l.current);var n,r;c.current=e,u.current=(n=e,r=i.chartType,{object:n,type:r,get:n.get.bind(n),setSize:n.setSize.bind(n),update:n.update.bind(n),addAxis:n.addAxis.bind(n),addColorAxis:n.addColorAxis.bind(n),addSeries:n.addSeries.bind(n),setTitle:n.setTitle.bind(n),setCaption:n.setCaption.bind(n),showLoading:n.showLoading.bind(n),hideLoading:n.hideLoading.bind(n),addCredits:n.addCredits.bind(n),addAnnotation:n.addAnnotation?n.addAnnotation.bind(n):null,removeAnnotation:n.removeAnnotation?n.removeAnnotation.bind(n):null,needsRedraw:M((()=>{if(!n.__destroyed)try{n.redraw.bind(n)()}catch{}}))}),t(e),s(!0)}),[]),(0,a.useEffect)((()=>{const e=c.current;return()=>{e&&(e.destroy.bind(e)(),e.__destroyed=!0)}}),[]);const d=v(i);return(0,a.useEffect)((()=>{if(!o)return;const{plotOptions:e}=i,t=c.current;!1===Object.is(d.plotOptions,e)&&t&&(t.update({plotOptions:e},!1),u.current.needsRedraw())})),a.createElement("div",W({},r,{className:`chart ${n}`,ref:l}),o&&a.createElement(O.Provider,{value:u.current},e))};function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}const _=e=>{const t=E();return a.createElement(X,q({},e,{chartCreationFunc:t.chart,chartType:"chart"}))};function $(e,t=!1){const n=(0,a.useRef)();(0,a.useEffect)((()=>{n.current=e}));const r=g(n.current,e,t);return(0,a.useDebugValue)(r?"Modified":"Not modified"),r}const Y=(0,a.memo)((({type:e="line",width:t,height:n,...r})=>{const i=w(),o=(0,a.useRef)(!1),s=$({type:e,...r});return(0,a.useEffect)((()=>{void 0===t&&void 0===n||i.setSize(t,n)}),[t,n]),(0,a.useEffect)((()=>{if(!1!==s&&o.current){const e=b(s);Object.getOwnPropertyNames(e).length>0&&Z(s,i,i.needsRedraw)}})),(0,a.useEffect)((()=>{const t=b({type:e,...r});Z(t,i),o.current=!0}),[]),function(e,t){const n=E(),r=h(e),i=v(r),a=g(i,r);!1!==a&&Object.keys(a).forEach((e=>{if(i){const r=i[e];r&&n.removeEvent(t,e,r)}const r=a[e];r&&n.addEvent(t,e,r)}))}(r,i.object),null})),Z=(e,t)=>{t.update({chart:e},!1),t.needsRedraw()};Y.displayName="Chart";const J=Y,K=(0,a.memo)((({children:e,axisId:t,...n})=>{const r=L(t);return(0,a.useEffect)((()=>{r&&Q({text:e,...n},r)})),(0,a.useEffect)((()=>()=>{if(r)try{Q({text:null},r)}catch{}}),[r]),null})),Q=(e,t)=>{t.setTitle(e,!0)};K.displayName="AxisTitle";const ee=K,te=({children:e=null,dynamicAxis:t=!0,...n})=>{const r=w(),i=(0,a.useRef)(null),o=(0,a.useRef)(null),[s,l]=(0,a.useState)(!1);(0,a.useEffect)((()=>{const e=((e,t,n)=>{const{id:r=d,isX:i}=t,a=(e=>{const{id:t=d,...n}=e,r="function"==typeof t?t():t,i=b(n);return{id:r,title:{text:null},events:h(n),...i}})(t);let o;if(n)o=e.addAxis(a,i,!1);else{const t="function"==typeof r?r():r;o=e.get(t),o.update.call(o,a,!1)}return o})(r,n,t);return i.current=e,o.current=j(i.current),l(!0),r.needsRedraw(),()=>{if(e.remove&&t){try{e.remove.bind(e)(!1)}catch{}r.needsRedraw()}}}),[]);const c=$(n);return(0,a.useEffect)((()=>{if(s&&!1!==c){const e=i.current,t=b(c),a={events:h(n),...t};e.plotLinesAndBands&&e.plotLinesAndBands.length>0?e.update(a,!0):(e.update(a,!1),r.needsRedraw())}})),s?a.createElement(A.Provider,{value:o.current},e):null};te.Title=ee;const ne=te;function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},re.apply(null,arguments)}const ie=({id:e,...t})=>{const n="stockChart"===w().type,r=n?"datetime":"linear",i=n?"xAxis":e;return a.createElement(ne,re({type:r},t,{id:i,isX:!0}))};ie.Title=ne.Title;const ae=ie;function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oe.apply(null,arguments)}const se=({type:e="linear",...t})=>a.createElement(ne,oe({type:e},t,{isX:!1}));se.displayName="YAxis",se.Title=ne.Title;const le=se;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(null,arguments)}const ue={series:{animation:!1,lineWidth:1,shadow:!1,states:{hover:{lineWidth:1}},marker:{radius:1,states:{hover:{radius:2}}},fillOpacity:.25}},de=[],fe={},pe=[0],me={enabled:!1},be=[2,0,2,0],he=({height:e=20,width:t=120,margin:n=be,style:r=fe,series:i,children:o,plotOptions:s=ue,...l})=>{const c=(0,a.useMemo)((()=>({overflow:"visible",...r})),[r]),u=!!i,d=u?i:o;return a.createElement(_,ce({plotOptions:s},l),a.createElement(J,{height:e,width:t,animation:!1,backgroundColor:null,borderWidth:0,margin:n,style:c,skipClone:!0}),a.createElement(ae,{labels:me,startOnTick:!1,endOnTick:!1,tickPositions:de}),a.createElement(le,{id:"sparkline",labels:me,startOnTick:!1,endOnTick:!1,tickPositions:pe},d),u&&a.createElement(a.Fragment,null,o))},ye={visible:"default",size:1,bottom:{},top:{},left:{},right:{},back:{},front:{}},ge=(0,a.memo)((({enabled:e=!1,alpha:t=0,beta:n=0,depth:r=100,fitToPlot:i=!0,viewDistance:o=25,axisLabelPosition:s="default",frame:l=ye,...c})=>{const u={enabled:e,alpha:t,beta:n,depth:r,fitToPlot:i,viewDistance:o,axisLabelPosition:s,frame:l,...c},d=(E(),w());return(0,a.useEffect)((()=>{ve(d,u)})),null})),ve=(e,t)=>{const{alpha:n,axisLabelPosition:r,beta:i,depth:a,fitToPlot:o,frame:s,viewDistance:l}=t,c={chart:{options3d:{enabled:!0,alpha:n,axisLabelPosition:r,beta:i,depth:a,fitToPlot:o,frame:s,viewDistance:l}}};e.update(c,!0)};ge.displayName="Options3d";const Se=ge;function xe(){return xe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xe.apply(null,arguments)}const Ee={options3d:{enabled:!0}},Pe={id:"zAxis"},Oe=({children:e,alpha:t,axisLabelPosition:n,beta:r,depth:i,fitToPlot:o,frame:s,viewDistance:l,...c})=>a.createElement(_,xe({chart:Ee,zAxis:Pe},c),a.createElement(Se,{alpha:t,axisLabelPosition:n,beta:r,depth:i,fitToPlot:o,frame:s,viewDistance:l}),e);Oe.propTypes=Se.propTypes;const we=Oe,Ce=(0,a.memo)((e=>{const{id:t=d,children:n,...r}=e,{addAnnotation:i,removeAnnotation:o}=w(),s=(0,a.useRef)();return(0,a.useEffect)((()=>{s.current="function"==typeof t?t():t;const e=s.current,n={id:e,...r};return i(n),()=>{try{o(e)}catch{}}})),null}));Ce.displayName="Annotation";const Ae=Ce,je=e=>e,Le=(e,t=je,n=je,r=!0)=>{const i=w(),o=$(e,r);(0,a.useEffect)((()=>{!1!==o&&(t(i,o),i.needsRedraw())})),(0,a.useEffect)((()=>()=>{try{n(i)}catch{}i.needsRedraw()}),[])},Te=(0,a.memo)((e=>(Le(e,Re,(e=>Re(e,{text:null}))),null))),Re=(e,t)=>{e.setCaption(t)};Te.displayName="Caption";const Be=Te,Ne=({children:e=null,...t})=>{const n=w(),r=(0,a.useRef)(null),i=(0,a.useRef)(null),[o,s]=(0,a.useState)(!1);(0,a.useEffect)((()=>{const e=((e,t)=>{const n=(e=>{const{id:t=d,...n}=e,r="function"==typeof t?t():t,i=b(n);return{id:r,events:h(n),...i}})(t);return e.addColorAxis(n,!1)})(n,t);return r.current=e,i.current=B(r.current),s(!0),n.needsRedraw(),()=>{if(e&&e.remove){try{e.remove.bind(e)(!1)}catch{}n.needsRedraw()}}}),[]);const l=$(t);return(0,a.useEffect)((()=>{null!==r.current&&!1!==l&&(r.current.update(l,!1),n.needsRedraw())})),o?a.createElement(R.Provider,{value:i.current},e):null},ke=(e,t)=>{"text"in t&&!t.text&&delete t.text,e.addCredits(t,!0)},De=({enabled:e=!0,...t})=>(Le({enabled:e,...t},ke,(e=>ke(e,{enabled:!1}))),null),He=(0,a.memo)((({children:e,isLoading:t=!0,...n})=>{const r=w(),i=$(n);return(0,a.useEffect)((()=>{!1!==i&&Ve(i,r),t?r.showLoading(e):r.hideLoading()})),(0,a.useEffect)((()=>()=>{try{r.hideLoading()}catch{}}),[]),null})),Ve=(e,t)=>{t.update({loading:e},!0)};He.displayName="Loading";const Ue=He,Ie=(0,a.memo)((({children:e=null,enabled:t=!0,...n})=>(Le({enabled:t,...n},ze,(e=>ze(e,{enabled:!1})),!1),e))),ze=(e,t)=>{e.update({legend:t},!1)};Ie.displayName="Legend";const Fe=Ie,Me=(0,a.memo)((e=>(Le(e,We,(e=>We(e,{text:null}))),null))),We=(e,t)=>{e.update({legend:{title:t}},!1)};Me.displayName="LegendTitle";const Ge=Me,Xe=Fe;Xe.Title=Ge;const qe=Xe,_e=(0,a.memo)((({children:e,...t})=>(Le(t,$e,(e=>$e(e,{})),!1),null))),$e=(e,t)=>{e.update({pane:t},!1)};_e.displayName="Pane";const Ye=_e,Ze=(0,a.createContext)();Ze.displayName="PlotBandLineContext";const Je=Ze;function Ke(e,t){const{id:n=d,axisId:r,children:i,...o}=e,s=L(r),l=(0,a.useRef)(),[c,u]=(0,a.useState)(null),f=$(o);return(0,a.useEffect)((()=>{if(s&&(!c||!1!==f)){c||(l.current="function"==typeof n?n():n);const e=l.current,r={id:e,...o};c&&s.removePlotBandOrLine(l.current),s.addPlotBandOrLine(r,t),u({id:e,get object(){return s&&s.object&&s.object.plotLinesAndBands?s.object.plotLinesAndBands.find((t=>t.id===e)):null}})}})),(0,a.useEffect)((()=>()=>{try{s.removePlotBandOrLine(l.current)}catch{}}),[]),c}const Qe=(0,a.memo)((e=>{const t=Ke(e,"plotBands"),{children:n}=e;return n||t?a.createElement(Je.Provider,{value:t},n):null}));Qe.displayName="PlotBand";const et=Qe,tt=(0,a.memo)((e=>{const t=Ke(e,"plotLines"),{children:n}=e;return n||t?a.createElement(Je.Provider,{value:t},n):null}));tt.displayName="PlotLine";const nt=tt;function rt(){return(0,a.useContext)(Je)}const it=(0,a.memo)((e=>{const t=rt();return(0,a.useEffect)((()=>{if(!t)return;const{children:n,id:r,...i}=e;at(t.object,{text:n,...i})})),(0,a.useEffect)((()=>()=>{if(t)try{at(t.object,{text:null})}catch{}}),[]),null})),at=(e,t)=>{e&&(e.options.label=ot(t),e.render())},ot=e=>{const{text:t,formatter:n,align:r,rotation:i,style:a,textAlign:o,useHTML:s,verticalAlign:l,x:c,y:u}=e;return{text:t,formatter:n,align:r,rotation:i,style:a,textAlign:o,useHTML:s,verticalAlign:l,x:c,y:u}};it.displayName="PlotBandLineLabel";const st=it,lt=et;lt.Label=st;const ct=nt;ct.Label=st;const ut=(0,a.memo)((e=>(Le(e,dt,(e=>dt(e,{text:null}))),null))),dt=(e,t)=>{e.setTitle(void 0,t,!1)};ut.displayName="Subtitle";const ft=ut,pt=(0,a.memo)((e=>(Le(e,mt,(e=>mt(e,{text:null}))),null))),mt=(e,t)=>{e.setTitle(t,null,!1)};pt.displayName="Title";const bt=pt,ht=(0,a.memo)((e=>{var t;const{children:n=null,...r}=e,i=w(),o=E();r.enabled=null===(t=e.enabled)||void 0===t||t,(0,a.useEffect)((()=>(yt(i,{...o.defaultOptions&&o.defaultOptions.tooltip,...r}),()=>{try{yt(i,{enabled:!1})}catch{}})),[]);const s=$(r);return(0,a.useEffect)((()=>{!1!==s&&yt(i,s)})),null})),yt=(e,t)=>{e.update({tooltip:t})};ht.displayName="Tooltip";const gt=ht;function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vt.apply(null,arguments)}const St=({type:e="linear",...t})=>a.createElement(ne,vt({type:e},t,{id:"zAxis",isX:!1,dynamicAxis:!1}));St.displayName="ZAxis",St.Title=ne.Title;const xt=St;function Et(){return Et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Et.apply(null,arguments)}const Pt=e=>{const t=w();return(0,a.useEffect)((()=>{t.update({chart:{inverted:!0}})}),[]),a.createElement(V,Et({},e,{type:"bar"}))};function Ot(e){const t=(0,a.useContext)(p),n=w(),r=()=>t||(e?N(n.get(e)):null),[i,o]=(0,a.useState)(r);return(0,a.useEffect)((()=>{i||o(r())}),[]),(0,a.useDebugValue)(i?i.id:null),i}const wt=({varName:e="chart"})=>{const t=w();return(0,a.useEffect)((()=>(window[e]=t.object,console.log(`Chart instance available as global variable as window.${e}`),()=>{window[e]=void 0})),[e]),null},Ct={requiresAxis:!1},At=I("AreaRange"),jt=I("Area"),Lt=I("AreaSplineRange"),Tt=I("AreaSpline"),Rt=I("BellCurve",{}),Bt=I("BoxPlot"),Nt=I("Bubble"),kt=I("Bullet"),Dt=I("ColumnPyramid"),Ht=I("ColumnRange"),Vt=I("Column"),Ut=I("Cylinder"),It=I("DependencyWheel"),zt=I("ErrorBar"),Ft=I("Funnel",Ct),Mt=I("Funnel3d"),Wt=I("Gauge"),Gt=I("Heatmap"),Xt=I("Histogram",{}),qt=I("Item"),_t=I("Line"),$t=I("NetworkGraph"),Yt=I("PackedBubble",Ct),Zt=I("Pareto",{}),Jt=I("Pie",Ct),Kt=I("Polygon"),Qt=I("Pyramid",Ct),en=I("Pyramid3d"),tn=I("Sankey"),nn=I("Organization"),rn=I("Scatter"),an=I("Scatter3d"),on=I("SolidGauge"),sn=I("Spline"),ln=I("StreamGraph"),cn=I("Sunburst"),un=I("Tilemap"),dn=I("Timeline"),fn=I("Treemap"),pn=I("VariablePie",Ct),mn=I("Variwide"),bn=I("Venn",Ct),hn=I("Vector"),yn=I("Waterfall"),gn=I("WindBarb"),vn=I("XRange");return i})()));