@progress/kendo-react-charts 9.5.0-develop.6 → 10.0.0-develop.1
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/BaseChart.js +1 -1
- package/BaseChart.mjs +24 -24
- package/dist/cdn/js/kendo-react-charts.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +6 -6
- package/sankey/Sankey.js +1 -1
- package/sankey/Sankey.mjs +84 -85
package/BaseChart.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),I=require("prop-types"),w=require("@progress/kendo-react-intl"),u=require("@progress/kendo-charts"),m=require("@progress/kendo-react-common"),g=require("./utils/index.js"),C=require("./events/chart-event-builder.js"),y=require("./events/dom-event.js"),S=require("./store/store.js"),b=require("./store/reducer.js"),D=require("./tooltip/Series.js"),E=require("./tooltip/CrosshairContainer.js"),k=require("./ChartContext.js"),P=require("./package-metadata.js"),T=require("./events/drilldown-event.js");function q(p){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const e in p)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(p,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>p[e]})}}return t.default=p,Object.freeze(t)}const l=q(O),f=class f extends l.Component{constructor(t){super(t),this.chartInstance=null,this.surface=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.themeStore={},this.themeUnsubscriber=Function.prototype,this.observersStore={},this.suppressTransitions=!1,this.showLicenseWatermark=!1,this.onRender=e=>{this.chartInstance!==null&&(this.surface=e.sender.surface,this.trigger("render",e))},this.onDrilldown=e=>{var i;const{series:s}=this.optionsStore.getState(),r=s.find(n=>n.name===e.series.name);if(r.drilldownSeriesFactory){const n="onDrilldown";if(this.props.hasOwnProperty(n)){const o={seriesName:r.name,drilldownValue:e.value},c=[...((i=this.props.drilldownState)==null?void 0:i.steps)||[],o],h=this.props.getTarget(),d={...e,currentState:this.props.drilldownState,nextState:{steps:c}},a=new T.DrilldownEvent(d,h);this.props[n].call(void 0,a)}}return!0},this.onLegendItemClick=e=>{if(this.chartInstance!==null)if(this.props.onLegendItemClick)this.trigger("legendItemClick",e);else{const{series:s}=this.optionsStore.getState();if(!s)return;let r={};const{seriesIndex:i,pointIndex:n}=e,o=s[i];if(n===void 0)r=Object.assign({},o,{visible:g.toggle(o.visible)});else{const c=o.pointVisibility=o.pointVisibility||[];c[n]=g.toggle(c[n]),r=Object.assign({},o)}this.optionsStore.dispatch({chartCollectionIdxKey:`series_${i}`,payload:r}),this.suppressTransitions=!0}},this.onWindowResize=()=>{this.chartInstance!==null&&this.chartInstance.resize()},this.onChartMouseLeave=e=>{const s=y.toDomEvent(this,e);this.triggerDomEvent("onMouseLeave",s)?e.preventDefault():this.chartInstance!==null&&this.chartInstance.hideElements()},this.onChildMouseLeave=e=>{const{syntheticEvent:s}=e;return this.chartInstance&&!g.hasParent(s.relatedTarget,this.element)&&this.chartInstance.hideElements(),!1},this.showLicenseWatermark=!m.validatePackage(P.packageMetadata,{component:"Chart"}),this.optionsStore=S.createStore(b.optionsReducer),this.observersStore=S.createStore(b.observersReducer),this.childrenObserver=new u.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.state={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver,drilldownState:{steps:[]}},this.themeStore=S.createStore(b.themeReducer),this.chartObserver=new u.InstanceObserver(this,{render:"onRender",legendItemClick:"onLegendItemClick",drilldown:"onDrilldown"})}get element(){return this._element}static getDerivedStateFromProps(t,e){return{...e,drilldownState:t.drilldownState||[]}}componentDidMount(){if(this._element){let t={};try{t=u.chartTheme(this._element)}catch{}const e=u.deepExtend(u.chartBaseTheme(),t);this.themeStore.dispatch({type:"push",payload:e}),this.instantiateCoreChart()}this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this)),this.themeUnsubscriber=this.themeStore.subscribe(this.refresh.bind(this)),window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){this.optionsUnsubscriber(),this.themeUnsubscriber(),this.chartInstance!==null&&(this.chartInstance.destroy(),this.chartInstance=null),window.removeEventListener("resize",this.onWindowResize)}componentDidUpdate(t){const{dir:e,children:s,...r}=this.props;if(this.chartInstance!==null){const i=w.provideIntlService(this),n=this.chartInstance.chartService,o=i.locale!==n._intlService.locale,c=Object.entries(t).filter(h=>h[0]!=="dir"&&h[0]!=="children").some(h=>{const[d,a]=h;return!(r.hasOwnProperty(d)&&r[d]===a)});o&&(this.chartInstance.chartService._intlService=i,this.chartInstance.chartService.format._intlService=i,c||this.chartInstance.noTransitionsRedraw()),c&&this.refresh(),t.dir!==e&&this.chartInstance.setDirection(this.getDirection(e))}}render(){const{style:t={},className:e,wrapper:s,children:r}=this.props,i=Object.assign({},t,{position:"relative"}),n=l.createElement(s,{className:e,style:i,key:"chartElement"},l.createElement("div",{onMouseLeave:this.onChartMouseLeave,ref:o=>this._element=o,className:"k-chart-surface"},r),l.createElement(l.Fragment,null,this.showLicenseWatermark&&l.createElement(m.WatermarkOverlay,null)));return l.createElement(k.ChartContext.Provider,{value:this.state},l.createElement(D.SeriesTooltip,{key:"seriesTooltip"}),l.createElement(E.CrosshairTooltipContainer,{key:"crosshairTooltips"}),n)}getDirection(t){return(t!==void 0?t:m.canUseDOM&&window.getComputedStyle(this.element).direction||"ltr")==="rtl"}getChartOptions(){const{renderAs:t,pannable:e,zoomable:s,paneDefaults:r,panes:i,transitions:n,seriesColors:o,seriesDefaults:c,axisDefaults:h,deriveOptionsFromParent:d}=this.props;let a={};return t!==void 0&&(a.renderAs=t),e!==void 0&&(a.pannable=e),s!==void 0&&(a.zoomable=s),r!==void 0&&(a.paneDefaults=r),i!==void 0&&(a.panes=i),n!==void 0&&(a.transitions=n),o!==void 0&&(a.seriesColors=o),c!==void 0&&(a.seriesDefaults=c),h!==void 0&&(a.axisDefaults=h),a=Object.assign(a,this.optionsStore.getState()),d&&(a=d(a)),a}refresh(){if(this.chartInstance!==null){const t=this.themeStore.getState(),e=this.getChartOptions(),s=e.transitions;this.suppressTransitions&&(e.transitions=!1),this.props.onRefresh?this.props.onRefresh.call(void 0,e,t,this.chartInstance):this.chartInstance.setOptions(e,t),this.suppressTransitions&&(e.transitions=s,this.suppressTransitions=!1)}}instantiateCoreChart(){const{dir:t,chartConstructor:e}=this.props,s=this.getChartOptions();this.chartInstance=new e(this.element,s,this.themeStore.getState(),{rtl:this.getDirection(t),intlService:w.provideIntlService(this),observer:this.chartObserver,sender:this})}trigger(t,e){const s=this.props.getTarget(),r=C.create(t,e,s),i="on"+t.charAt(0).toUpperCase()+t.slice(1),n=this.observersStore.getState();let o=!1;for(let c=0;c<n.length;c++)n[c].trigger(t,e)&&(o=!0);return o===!1&&r&&this.props.hasOwnProperty(i)?(this.props[i].call(void 0,r),r.isDefaultPrevented&&r.isDefaultPrevented()):o}requiresHandlers(t){for(let e=0;e<t.length;e++){const s=t[e],r="on"+s.charAt(0).toUpperCase()+s.slice(1);if(this.props.hasOwnProperty(r))return!0}return!1}triggerDomEvent(t,e){const s=this.observersStore.getState();let r=!1;for(let i=0;i<s.length;i++)s[i].trigger(t,e)&&(r=!0);return r}};f.propTypes={dir:I.string,renderAs:I.oneOf(["svg","canvas"])},f.defaultProps={renderAs:"svg"};let v=f;w.registerForIntl(v);exports.BaseChart=v;
|
package/BaseChart.mjs
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as l from "react";
|
|
9
9
|
import u from "prop-types";
|
|
10
|
-
import { provideIntlService as v, registerForIntl as
|
|
11
|
-
import { InstanceObserver as g, chartTheme as
|
|
12
|
-
import { validatePackage as
|
|
13
|
-
import { toggle as S, hasParent as
|
|
14
|
-
import { create as
|
|
15
|
-
import { toDomEvent as
|
|
10
|
+
import { provideIntlService as v, registerForIntl as b } from "@progress/kendo-react-intl";
|
|
11
|
+
import { InstanceObserver as g, chartTheme as w, deepExtend as I, chartBaseTheme as O } from "@progress/kendo-charts";
|
|
12
|
+
import { validatePackage as C, WatermarkOverlay as D, canUseDOM as y } from "@progress/kendo-react-common";
|
|
13
|
+
import { toggle as S, hasParent as E } from "./utils/index.mjs";
|
|
14
|
+
import { create as T } from "./events/chart-event-builder.mjs";
|
|
15
|
+
import { toDomEvent as P } from "./events/dom-event.mjs";
|
|
16
16
|
import { createStore as m } from "./store/store.mjs";
|
|
17
|
-
import { optionsReducer as
|
|
18
|
-
import { SeriesTooltip as
|
|
19
|
-
import { CrosshairTooltipContainer as
|
|
20
|
-
import { ChartContext as
|
|
21
|
-
import { packageMetadata as
|
|
22
|
-
import { DrilldownEvent as
|
|
17
|
+
import { optionsReducer as k, observersReducer as x, themeReducer as L } from "./store/reducer.mjs";
|
|
18
|
+
import { SeriesTooltip as R } from "./tooltip/Series.mjs";
|
|
19
|
+
import { CrosshairTooltipContainer as U } from "./tooltip/CrosshairContainer.mjs";
|
|
20
|
+
import { ChartContext as M } from "./ChartContext.mjs";
|
|
21
|
+
import { packageMetadata as W } from "./package-metadata.mjs";
|
|
22
|
+
import { DrilldownEvent as F } from "./events/drilldown-event.mjs";
|
|
23
23
|
const d = class d extends l.Component {
|
|
24
24
|
constructor(t) {
|
|
25
25
|
super(t), this.chartInstance = null, this.surface = null, this._element = null, this.optionsStore = {}, this.optionsUnsubscriber = Function.prototype, this.themeStore = {}, this.themeUnsubscriber = Function.prototype, this.observersStore = {}, this.suppressTransitions = !1, this.showLicenseWatermark = !1, this.onRender = (e) => {
|
|
@@ -34,7 +34,7 @@ const d = class d extends l.Component {
|
|
|
34
34
|
...e,
|
|
35
35
|
currentState: this.props.drilldownState,
|
|
36
36
|
nextState: { steps: h }
|
|
37
|
-
}, a = new
|
|
37
|
+
}, a = new F(p, c);
|
|
38
38
|
this.props[n].call(void 0, a);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -63,17 +63,17 @@ const d = class d extends l.Component {
|
|
|
63
63
|
}, this.onWindowResize = () => {
|
|
64
64
|
this.chartInstance !== null && this.chartInstance.resize();
|
|
65
65
|
}, this.onChartMouseLeave = (e) => {
|
|
66
|
-
const s =
|
|
66
|
+
const s = P(this, e);
|
|
67
67
|
this.triggerDomEvent("onMouseLeave", s) ? e.preventDefault() : this.chartInstance !== null && this.chartInstance.hideElements();
|
|
68
68
|
}, this.onChildMouseLeave = (e) => {
|
|
69
69
|
const { syntheticEvent: s } = e;
|
|
70
|
-
return this.chartInstance && !
|
|
71
|
-
},
|
|
70
|
+
return this.chartInstance && !E(s.relatedTarget, this.element) && this.chartInstance.hideElements(), !1;
|
|
71
|
+
}, this.showLicenseWatermark = !C(W, { component: "Chart" }), this.optionsStore = m(k), this.observersStore = m(x), this.childrenObserver = new g(this, { onMouseLeave: "onChildMouseLeave" }), this.state = {
|
|
72
72
|
optionsStore: this.optionsStore,
|
|
73
73
|
observersStore: this.observersStore,
|
|
74
74
|
childrenObserver: this.childrenObserver,
|
|
75
75
|
drilldownState: { steps: [] }
|
|
76
|
-
}, this.themeStore = m(
|
|
76
|
+
}, this.themeStore = m(L), this.chartObserver = new g(this, {
|
|
77
77
|
render: "onRender",
|
|
78
78
|
legendItemClick: "onLegendItemClick",
|
|
79
79
|
drilldown: "onDrilldown"
|
|
@@ -101,10 +101,10 @@ const d = class d extends l.Component {
|
|
|
101
101
|
if (this._element) {
|
|
102
102
|
let t = {};
|
|
103
103
|
try {
|
|
104
|
-
t =
|
|
104
|
+
t = w(this._element);
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
|
-
const e = O(
|
|
107
|
+
const e = I(O(), t);
|
|
108
108
|
this.themeStore.dispatch({ type: "push", payload: e }), this.instantiateCoreChart();
|
|
109
109
|
}
|
|
110
110
|
this.optionsUnsubscriber = this.optionsStore.subscribe(this.refresh.bind(this)), this.themeUnsubscriber = this.themeStore.subscribe(this.refresh.bind(this)), window.addEventListener("resize", this.onWindowResize);
|
|
@@ -140,15 +140,15 @@ const d = class d extends l.Component {
|
|
|
140
140
|
key: "chartElement"
|
|
141
141
|
},
|
|
142
142
|
/* @__PURE__ */ l.createElement("div", { onMouseLeave: this.onChartMouseLeave, ref: (o) => this._element = o, className: "k-chart-surface" }, r),
|
|
143
|
-
/* @__PURE__ */ l.createElement(l.Fragment, null, this.showLicenseWatermark && /* @__PURE__ */ l.createElement(
|
|
143
|
+
/* @__PURE__ */ l.createElement(l.Fragment, null, this.showLicenseWatermark && /* @__PURE__ */ l.createElement(D, null))
|
|
144
144
|
);
|
|
145
|
-
return /* @__PURE__ */ l.createElement(
|
|
145
|
+
return /* @__PURE__ */ l.createElement(M.Provider, { value: this.state }, /* @__PURE__ */ l.createElement(R, { key: "seriesTooltip" }), /* @__PURE__ */ l.createElement(U, { key: "crosshairTooltips" }), n);
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* @hidden
|
|
149
149
|
*/
|
|
150
150
|
getDirection(t) {
|
|
151
|
-
return (t !== void 0 ? t :
|
|
151
|
+
return (t !== void 0 ? t : y && window.getComputedStyle(this.element).direction || "ltr") === "rtl";
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* @hidden
|
|
@@ -195,7 +195,7 @@ const d = class d extends l.Component {
|
|
|
195
195
|
* @hidden
|
|
196
196
|
*/
|
|
197
197
|
trigger(t, e) {
|
|
198
|
-
const s = this.props.getTarget(), r =
|
|
198
|
+
const s = this.props.getTarget(), r = T(t, e, s), i = "on" + t.charAt(0).toUpperCase() + t.slice(1), n = this.observersStore.getState();
|
|
199
199
|
let o = !1;
|
|
200
200
|
for (let h = 0; h < n.length; h++)
|
|
201
201
|
n[h].trigger(t, e) && (o = !0);
|
|
@@ -232,7 +232,7 @@ d.propTypes = {
|
|
|
232
232
|
renderAs: "svg"
|
|
233
233
|
};
|
|
234
234
|
let f = d;
|
|
235
|
-
|
|
235
|
+
b(f);
|
|
236
236
|
export {
|
|
237
237
|
f as BaseChart
|
|
238
238
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-intl"),require("@progress/kendo-charts"),require("@progress/kendo-react-common"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-intl","@progress/kendo-charts","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-react-layout","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactCharts={},e.React,e.PropTypes,e.KendoReactIntl,e.KendoCharts,e.KendoReactCommon,e.KendoReactPopup,e.KendoReactLayout,e.KendoSvgIcons)}(this,(function(e,t,r,s,n,a,i,o,l){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var h=c(t);function p(e,t){let r=e;for(;r&&r!==t;)r=r.parentNode;return!!r}function d(e,t,r,s){const n=e[t];if(n&&Array.isArray(n))for(const e of n)if(!e.type||e.type!==s)return new Error(`${r} children should be Array of type ${s.displayName}.`);return null}const u=e=>void 0!==e&&!e;let m=class{constructor(e){this.target=e}},y=class extends m{constructor(e,t){super(t),this.axis=e.axis,this.dataItem=e.dataItem,this.index=e.index,this.text=e.text,this.value=e.value}},g=class extends m{constructor(){super(...arguments),this.prevented=!1}preventDefault(){this.prevented=!0}isDefaultPrevented(){return this.prevented}},v=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},C=class extends m{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},b=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},f=class extends m{constructor(e,t){super(t),this.value=e.value,this.point=e.point,this.series=e.series,this.currentState=e.currentState,this.nextState=e.nextState}},x=class extends g{constructor(e,t){super(t),this.series=e.series,this.seriesIndex=e.seriesIndex,this.pointIndex=e.pointIndex,this.text=e.text}preventDefault(){super.preventDefault()}},E=class extends g{constructor(e,t){super(t),this.series=e.series,this.seriesIndex=e.seriesIndex,this.pointIndex=e.pointIndex,this.text=e.text}preventDefault(){super.preventDefault()}},S=class extends m{constructor(e,t){super(t),this.from=e.from,this.to=e.to}},I=class extends m{constructor(e,t){super(t),this.category=e.category,this.dataItem=e.dataItem,this.series=e.series,this.value=e.value,this.visual=e.visual}},N=class extends m{constructor(e,t){super(t),this.category=e.category,this.dataItem=e.dataItem,this.series=e.series,this.value=e.value,this.visual=e.visual}},k=class extends m{constructor(e,t){super(t),this.category=e.category,this.nativeEvent=e.originalEvent,this.value=e.value,this.x=e.x,this.y=e.y}},_=class extends m{constructor(e,t){super(t),this.category=e.category,this.nativeEvent=e.originalEvent,this.value=e.value,this.x=e.x,this.y=e.y}},w=class extends m{constructor(e,t){super(t)}},T=class extends g{constructor(e,t){super(t),this.axis=e.axis,this.from=e.from,this.to=e.to}},A=class extends m{constructor(e,t){super(t),this.axis=e.axis,this.from=e.from,this.to=e.to}},K=class extends g{constructor(e,t){super(t),this.axis=e.axis,this.from=e.from,this.to=e.to}},O=class extends m{constructor(e,t){super(t),this.category=e.category,this.dataItem=e.dataItem,this.nativeEvent=e.originalEvent,this.percentage=e.percentage,this.point=e.point,this.series=e.series,this.stackValue=e.stackValue,this.value=e.value}},L=class extends g{constructor(e,t){super(t),this.category=e.category,this.categoryPoints=e.categoryPoints,this.dataItem=e.dataItem,this.nativeEvent=e.originalEvent,this.percentage=e.percentage,this.point=e.point,this.series=e.series,this.stackValue=e.stackValue,this.value=e.value}},D=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.delta=e.delta,this.nativeEvent=e.originalEvent}},R=class extends m{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},P=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}};const F={axisLabelClick:y,drag:v,dragEnd:C,dragStart:b,drilldownEvent:f,legendItemHover:x,legendItemClick:E,legendItemLeave:class extends g{constructor(e,t){super(t),this.series=e.series,this.seriesIndex=e.seriesIndex,this.pointIndex=e.pointIndex,this.text=e.text}preventDefault(){super.preventDefault()}},navigatorFilter:S,noteClick:I,noteHover:N,plotAreaClick:k,plotAreaHover:_,render:w,select:T,selectEnd:A,selectStart:K,seriesClick:O,seriesHover:L,zoom:D,zoomEnd:R,zoomStart:P};let V=class{constructor(e,t){this.sender=e,this.syntheticEvent=t}};function H(e,t){return new V(e,t)}const j=e=>{let t,r,s=[];const n=n=>{t=e(t,n),a.canUseDOM&&(window.clearTimeout(r),r=window.setTimeout((()=>s.forEach((e=>e()))),16.666666666666668))};return n({}),{getState:()=>t,dispatch:n,subscribe:e=>(s.push(e),()=>s=s.filter((t=>t!==e)))}},M=(e,t)=>t.chartCollectionIdxKey?q.collectionConfigurationItem(e,t):t.chartKey?q.configurationItem(e,t):{},U=(e,t)=>{if(!t.type)return{};switch(t.type){case"set":return q.themeItem(e,t);case"push":return Object.assign(e,t.payload);default:return e}},z=(e,t)=>{if(!t.type)return[];switch(t.type){case"add":return[...e,t.payload];case"remove":return e.filter((e=>e!==t.payload));default:return e}},q={configurationItem:(e,t)=>Object.assign(e,{[t.chartKey]:t.payload}),collectionConfigurationItem(e,t){let r=!1;const[s,n]=t.chartCollectionIdxKey.split("_"),a=e[s].map(((e,s)=>parseInt(n,10)===s?(r=!0,t.payload):e));return!1===r&&a.splice(parseInt(n,10),0,t.payload),Object.assign(e,{[s]:a})},themeItem(e,t){let r={};const s=Object.assign(r,e),{field:n,value:a}=t.payload,i=n.split(".");let o=i.shift();for(;i.length>0;)r=r[o]=r[o]||{},o=i.shift();return r[o]=a,s}};let B=class{constructor(e,t){this.value=e.value,this.category=e.category,this.categoryIndex=e.categoryIx,this.series=e.series,this.dataItem=e.dataItem,this.percentage=e.percentage,this.runningTotal=e.runningTotal,this.total=e.total,this.low=e.low,this.high=e.high,this.xLow=e.xLow,this.xHigh=e.xHigh,this.yLow=e.yLow,this.yHigh=e.yHigh,this.point=e,this.format=((e.options||{}).tooltip||{}).format||t}get formattedValue(){return this.format?this.point.formatValue(this.format):String(this.value)}};const W=e=>{const{categoryText:t,colorMarker:r,colspan:s,nameColumn:n,points:a}=e;return h.createElement("table",null,h.createElement("thead",null,h.createElement("tr",null,h.createElement("th",{colSpan:s},t))),h.createElement("tbody",null,a.map(((e,t)=>h.createElement("tr",{key:t},r&&h.createElement("td",null,h.createElement("span",{className:"k-chart-shared-tooltip-marker",style:{backgroundColor:e.series.color}})),n&&h.createElement("td",null,e.series.name),h.createElement("td",{dangerouslySetInnerHTML:{__html:e.formattedValue}}))))))},X=h.createContext(null);X.displayName="ChartContext";const Y={horizontal:"fit",vertical:"fit"},$="k-chart-tooltip",Z=class extends h.Component{constructor(e,t){super(e,t),this.context=null,this.element=null,this.onChartMouseLeave=e=>{const{syntheticEvent:t}=e;return!!p(t.relatedTarget,this.element)},this.onMouseLeave=e=>{const t=H(this,e);this.context.childrenObserver.trigger("onMouseLeave",t)&&e.preventDefault()},this.popupRef=e=>{this.element=e;const t=e&&e.closest(".k-animation-container");t&&(t.style.transition="initial")},this.chartObserver=new n.InstanceObserver(this,{onMouseLeave:"onChartMouseLeave"}),t.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupShown:e,popupAlign:t,popupOffset:r,popupStyles:s,popupContent:n,className:a}=this.props,o=[$,a].join(" ").trim();return h.createElement(i.Popup,{animate:!1,popupAlign:t,offset:r,show:e,collision:Y,className:"k-chart-tooltip-wrapper"},h.createElement("div",{className:o,style:s,onMouseLeave:this.onMouseLeave,ref:this.popupRef},n()))}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.chartObserver})}};Z.contextType=X;let G=Z;const J=class extends h.Component{constructor(){super(...arguments),this.context=null,this.state={popupShown:!1},this.chartObserver=null}componentDidMount(){this.chartObserver=new n.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),this.context.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupContext:e,shared:t,className:r,...s}=this.state,n=this.state.popupShown?()=>{const r=this.findRenderFunction();if(t)return null!==r?r(e):h.createElement(W,{...e});const s=e.point,n=this.findRenderFunctionByIndex(s.series.index);return null!==n?n(e):null!==r?r(e):h.createElement("span",{dangerouslySetInnerHTML:{__html:e.point.formattedValue}})}:Function.prototype,i=a.classNames({"k-chart-shared-tooltip":t,"k-chart-tooltip-inverse":!!r});return h.createElement(G,{...s,popupContent:n,className:i})}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.chartObserver})}onShowTooltip(e){const{anchor:t,style:r,shared:s,className:n,crosshair:a}=e;let i;a||(i=s?this.createSharedTooltipContext(e):this.createTooltipContext(e),this.setState({popupShown:!0,popupAlign:t.align,popupOffset:t.point,popupContext:i,popupStyles:r,className:n,shared:s}))}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}createSharedTooltipContext(e){const{points:t,categoryText:r}=e,s=t.filter((e=>void 0!==e.series.name)).length>0,n=e.series.length>1;let a=1;return s&&a++,n&&a++,{categoryText:r,colorMarker:n,colspan:a,nameColumn:s,points:e.points.map((t=>new B(t,e.format)))}}createTooltipContext(e){const{point:t,format:r}=e;return{point:new B(t,r)}}findRenderFunctionByIndex(e){const t=this.context.optionsStore.getState().series;return void 0!==t&&Array.isArray(t)&&void 0!==t[e]&&t[e].hasOwnProperty("tooltip")&&t[e].tooltip.hasOwnProperty("render")?t[e].tooltip.render:null}findRenderFunction(){const e=this.context.optionsStore.getState().tooltip;return void 0!==e&&e.hasOwnProperty("render")?e.render:null}};J.contextType=X;let Q=J;const ee=e=>e.children;ee.displayName="Container";const te=class extends h.Component{constructor(e,t){super(e,t),this.context=null,this.state={popupShown:!1},this.chartObserver=new n.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),t.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupContend:e,className:t,...r}=this.state,s=this.state.popupShown?()=>e:Function.prototype,n=a.classNames({"k-chart-crosshair-tooltip":!0,"k-chart-tooltip-inverse":!!t});return h.createElement(G,{...r,popupContent:s,className:n})}componentWillUnmount(){var e;null==(e=this.context)||e.observersStore.dispatch({type:"remove",payload:this.chartObserver})}onShowTooltip(e){const{anchor:t,style:r,className:s,crosshair:n,axisName:a,axisIndex:i,value:o}=e,{name:l,index:c}=this.props;n&&a===l&&i===c&&this.setState({popupShown:!0,popupAlign:t.align,popupOffset:t.point,popupContend:o,popupStyles:r,className:s})}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}};te.contextType=X;let re=te;const se=["categoryAxis","valueAxis","xAxis","yAxis"];function ne(e){const t={};for(let r=0;r<se.length;r++){const s=ae(e,se[r]);for(let e=0;e<s.length;e++){const r=s[e];t[r.name+r.index]=r}}return t}function ae(e,t){const r=[];if(e[t]){const s=[].concat(e[t]);for(let e=0;e<s.length;e++){const n=(s[e].crosshair||{}).tooltip;n&&n.visible&&r.push({index:e,name:t})}}return r}const ie=class extends h.Component{constructor(){super(...arguments),this.context=null,this.state={tooltips:{}},this.storeUnsubscriber=Function.prototype,this.subscriber=()=>{var e;this.setState({tooltips:ne(null==(e=this.context)?void 0:e.optionsStore.getState())})}}componentDidMount(){this.storeUnsubscriber=this.context.optionsStore.subscribe(this.subscriber)}render(){const{tooltips:e}=this.state,t=Object.keys(e).map((t=>h.createElement(re,{...e[t],key:t})));return h.createElement(ee,null,t)}componentWillUnmount(){this.storeUnsubscriber()}};ie.contextType=X;let oe=ie;const le={name:"@progress/kendo-react-charts",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},ce=class extends h.Component{constructor(e){super(e),this.chartInstance=null,this.surface=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.themeStore={},this.themeUnsubscriber=Function.prototype,this.observersStore={},this.suppressTransitions=!1,this.showLicenseWatermark=!1,this.onRender=e=>{null!==this.chartInstance&&(this.surface=e.sender.surface,this.trigger("render",e))},this.onDrilldown=e=>{var t;const{series:r}=this.optionsStore.getState(),s=r.find((t=>t.name===e.series.name));if(s.drilldownSeriesFactory){const r="onDrilldown";if(this.props.hasOwnProperty(r)){const n={seriesName:s.name,drilldownValue:e.value},a=[...(null==(t=this.props.drilldownState)?void 0:t.steps)||[],n],i=this.props.getTarget(),o={...e,currentState:this.props.drilldownState,nextState:{steps:a}},l=new f(o,i);this.props[r].call(void 0,l)}}return!0},this.onLegendItemClick=e=>{if(null!==this.chartInstance)if(this.props.onLegendItemClick)this.trigger("legendItemClick",e);else{const{series:t}=this.optionsStore.getState();if(!t)return;let r={};const{seriesIndex:s,pointIndex:n}=e,a=t[s];if(void 0===n)r=Object.assign({},a,{visible:u(a.visible)});else{const e=a.pointVisibility=a.pointVisibility||[];e[n]=u(e[n]),r=Object.assign({},a)}this.optionsStore.dispatch({chartCollectionIdxKey:`series_${s}`,payload:r}),this.suppressTransitions=!0}},this.onWindowResize=()=>{null!==this.chartInstance&&this.chartInstance.resize()},this.onChartMouseLeave=e=>{const t=H(this,e);this.triggerDomEvent("onMouseLeave",t)?e.preventDefault():null!==this.chartInstance&&this.chartInstance.hideElements()},this.onChildMouseLeave=e=>{const{syntheticEvent:t}=e;return this.chartInstance&&!p(t.relatedTarget,this.element)&&this.chartInstance.hideElements(),!1},a.validatePackage(le),this.showLicenseWatermark=a.shouldShowValidationUI(le),this.optionsStore=j(M),this.observersStore=j(z),this.childrenObserver=new n.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.state={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver,drilldownState:{steps:[]}},this.themeStore=j(U),this.chartObserver=new n.InstanceObserver(this,{render:"onRender",legendItemClick:"onLegendItemClick",drilldown:"onDrilldown"})}get element(){return this._element}static getDerivedStateFromProps(e,t){return{...t,drilldownState:e.drilldownState||[]}}componentDidMount(){if(this._element){let e={};try{e=n.chartTheme(this._element)}catch{}const t=n.deepExtend(n.chartBaseTheme(),e);this.themeStore.dispatch({type:"push",payload:t}),this.instantiateCoreChart()}this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this)),this.themeUnsubscriber=this.themeStore.subscribe(this.refresh.bind(this)),window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){this.optionsUnsubscriber(),this.themeUnsubscriber(),null!==this.chartInstance&&(this.chartInstance.destroy(),this.chartInstance=null),window.removeEventListener("resize",this.onWindowResize)}componentDidUpdate(e){const{dir:t,children:r,...n}=this.props;if(null!==this.chartInstance){const r=s.provideIntlService(this),a=this.chartInstance.chartService,i=r.locale!==a._intlService.locale,o=Object.entries(e).filter((e=>"dir"!==e[0]&&"children"!==e[0])).some((e=>{const[t,r]=e;return!(n.hasOwnProperty(t)&&n[t]===r)}));i&&(this.chartInstance.chartService._intlService=r,this.chartInstance.chartService.format._intlService=r,o||this.chartInstance.noTransitionsRedraw()),o&&this.refresh(),e.dir!==t&&this.chartInstance.setDirection(this.getDirection(t))}}render(){const{style:e={},className:t,wrapper:r,children:s}=this.props,n=Object.assign({},e,{position:"relative"}),i=h.createElement(r,{className:t,style:n,key:"chartElement"},h.createElement("div",{onMouseLeave:this.onChartMouseLeave,ref:e=>this._element=e,className:"k-chart-surface"},s),h.createElement(h.Fragment,null,this.showLicenseWatermark&&h.createElement(a.WatermarkOverlay,null)));return h.createElement(X.Provider,{value:this.state},h.createElement(Q,{key:"seriesTooltip"}),h.createElement(oe,{key:"crosshairTooltips"}),i)}getDirection(e){return"rtl"===(void 0!==e?e:a.canUseDOM&&window.getComputedStyle(this.element).direction||"ltr")}getChartOptions(){const{renderAs:e,pannable:t,zoomable:r,paneDefaults:s,panes:n,transitions:a,seriesColors:i,seriesDefaults:o,axisDefaults:l,deriveOptionsFromParent:c}=this.props;let h={};return void 0!==e&&(h.renderAs=e),void 0!==t&&(h.pannable=t),void 0!==r&&(h.zoomable=r),void 0!==s&&(h.paneDefaults=s),void 0!==n&&(h.panes=n),void 0!==a&&(h.transitions=a),void 0!==i&&(h.seriesColors=i),void 0!==o&&(h.seriesDefaults=o),void 0!==l&&(h.axisDefaults=l),h=Object.assign(h,this.optionsStore.getState()),c&&(h=c(h)),h}refresh(){if(null!==this.chartInstance){const e=this.themeStore.getState(),t=this.getChartOptions(),r=t.transitions;this.suppressTransitions&&(t.transitions=!1),this.props.onRefresh?this.props.onRefresh.call(void 0,t,e,this.chartInstance):this.chartInstance.setOptions(t,e),this.suppressTransitions&&(t.transitions=r,this.suppressTransitions=!1)}}instantiateCoreChart(){const{dir:e,chartConstructor:t}=this.props,r=this.getChartOptions();this.chartInstance=new t(this.element,r,this.themeStore.getState(),{rtl:this.getDirection(e),intlService:s.provideIntlService(this),observer:this.chartObserver,sender:this})}trigger(e,t){const r=function(e,t,r){if(F[e])return new F[e](t,r)}(e,t,this.props.getTarget()),s="on"+e.charAt(0).toUpperCase()+e.slice(1),n=this.observersStore.getState();let a=!1;for(let r=0;r<n.length;r++)n[r].trigger(e,t)&&(a=!0);return!1===a&&r&&this.props.hasOwnProperty(s)?(this.props[s].call(void 0,r),r.isDefaultPrevented&&r.isDefaultPrevented()):a}requiresHandlers(e){for(let t=0;t<e.length;t++){const r=e[t],s="on"+r.charAt(0).toUpperCase()+r.slice(1);if(this.props.hasOwnProperty(s))return!0}return!1}triggerDomEvent(e,t){const r=this.observersStore.getState();let s=!1;for(let n=0;n<r.length;n++)r[n].trigger(e,t)&&(s=!0);return s}};ce.propTypes={dir:r.string,renderAs:r.oneOf(["svg","canvas"])},ce.defaultProps={renderAs:"svg"};let he=ce;s.registerForIntl(he);const pe=class extends h.Component{constructor(e,t){super(e,t),this.context=null,this.state={donutCenterStyles:null},this.chartObserver=new n.InstanceObserver(this,{render:"onRender"}),t.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{render:e}=this.props,{donutCenterStyles:t}=this.state;let r=null;return e&&t&&(r=h.createElement("div",{className:"k-chart-donut-center",style:t},h.createElement(e,null))),r}onRender(e){var t;const r=null==(t=this.context)?void 0:t.optionsStore.getState().series,s=Array.isArray(r)?r[0]:null,n=e.sender._plotArea.charts;if(!s||"donut"!==s.type||0===n[0].points.length)return;const a=n[0].points[0].sector,i=a.innerRadius,o=a.center.y-i,l=a.center.x-i,c=2*i;this.setState({donutCenterStyles:{height:c,left:l,top:o,width:c}})}};pe.contextType=X;let de=pe,ue=class extends h.Component{constructor(){super(...arguments),this._baseChart=null,this.getTarget=()=>this}get chartInstance(){return null!==this._baseChart?this._baseChart.chartInstance:null}get surface(){return null!==this._baseChart?this._baseChart.surface:null}get element(){return null!==this._baseChart?this._baseChart.element:null}render(){const{donutCenterRender:e,children:t,className:r,...s}=this.props;return h.createElement(he,{...s,ref:e=>this._baseChart=e,chartConstructor:n.Chart,getTarget:this.getTarget,wrapper:"div",className:a.classNames("k-chart k-widget",r)},t,h.createElement(de,{render:e}))}},me=class extends h.Component{constructor(){super(...arguments),this._baseChart=null,this.deriveOptionsFromParent=e=>{const{type:t,data:r}=this.props,s=Object.assign({},e,{type:t,data:r});return n.Sparkline.normalizeOptions(s)},this.getTarget=()=>this}get chartInstance(){return null!==this._baseChart?this._baseChart.chartInstance:null}get surface(){return null!==this._baseChart?this._baseChart.surface:null}get element(){return null!==this._baseChart?this._baseChart.element:null}render(){const{children:e,type:t,className:r,...s}=this.props;return h.createElement(he,{...s,ref:e=>this._baseChart=e,chartConstructor:n.Sparkline,getTarget:this.getTarget,wrapper:"span",deriveOptionsFromParent:this.deriveOptionsFromParent,className:a.classNames("k-sparkline k-widget",r)},e)}};const ye={autoBindElements:!0,liveDrag:!1,partialRedraw:!0};let ge=class extends h.Component{constructor(){super(...arguments),this._baseChart=null,this.deriveOptionsFromParent=e=>{const t=Object.assign({},e.navigator||{},ye);return Object.assign({},e,{navigator:t})},this.onRefresh=(e,t,r)=>{this.props.partialRedraw?(r.applyOptions(e),r.bindCategories(),r.navigator.redrawSlaves()):r.setOptions(e,t)},this.getTarget=()=>this}get chartInstance(){return null!==this._baseChart?this._baseChart.chartInstance:null}get surface(){return null!==this._baseChart?this._baseChart.surface:null}get element(){return null!==this._baseChart?this._baseChart.element:null}render(){const{children:e,className:t,...r}=this.props;return h.createElement(he,{...r,ref:e=>this._baseChart=e,chartConstructor:n.StockChart,getTarget:this.getTarget,wrapper:"div",deriveOptionsFromParent:this.deriveOptionsFromParent,onRefresh:this.onRefresh,className:a.classNames("k-stockchart k-widget",t)},e)}};const ve=class extends h.Component{constructor(e,t){super(e,t),this.optionsStore=t.optionsStore}renderChildren(e,t){const{children:r}=e.props,{_chartKey:s,_parentStore:n}=this.props,a={...e.props,_chartCollectionIdxKey:`${s}_${t}`,_parentStore:n};return h.cloneElement(e,a,r)}render(){const{_chartKey:e,_parentStore:t,children:r}=this.props;return(t||this.optionsStore).dispatch({chartKey:e,payload:[]}),h.Children.map(r,((e,t)=>h.isValidElement(e)?this.renderChildren(e,t):e))}};ve.contextType=X;let Ce=ve;const be=class extends h.Component{constructor(e,t){super(e,t),this.optionsStore=t.optionsStore,this.childStore=j(M)}render(){const{children:e}=this.props;return void 0!==e?h.Children.map(e,(e=>h.isValidElement(e)?this.renderChildren(e):e)):null}componentDidMount(){this.dispatch()}componentDidUpdate(){this.dispatch()}dispatch(){const{_chartKey:e,_chartCollectionIdxKey:t,_parentStore:r,children:s,...n}=this.props;(r||this.optionsStore).dispatch({chartKey:e,chartCollectionIdxKey:t,payload:Object.assign({},n,this.childStore.getState())})}renderChildren(e){const{children:t}=e.props,r={...e.props,_parentStore:this.childStore};return h.cloneElement(e,r,t)}};be.contextType=X;let fe=be,xe=class{constructor(e){this.currentState=e.currentState,this.nextState=e.nextState}};const Ee=h.forwardRef(((e,t)=>{const r=h.useRef(null),s=h.useRef(null),n={valueField:Ie.valueField,textField:Ie.textField,iconField:Ie.iconField,iconClassField:Ie.iconClassField,...e};h.useImperativeHandle(r,(()=>({element:s.current,props:n}))),h.useImperativeHandle(t,(()=>r.current));let i=[{id:"0",...e.rootItem||{text:"Home",icon:h.createElement(a.SvgIcon,{icon:l.homeIcon,style:{marginInlineEnd:"4px"}})}}];e.drilldownState&&(i=[...i,...e.drilldownState.steps.map(((e,t)=>({id:(t+1).toString(),text:e.drilldownValue})))]);const c={...n,data:i};return h.createElement("div",null,h.createElement(o.Breadcrumb,{...c,onItemSelect:t=>{var r;const s="onDrilldownStateChange";if(e.hasOwnProperty(s)){const n=i.findIndex((e=>e.id===t.id)),a={steps:((null==(r=e.drilldownState)?void 0:r.steps)||[]).slice(0,n)},o=new xe({currentState:e.drilldownState,nextState:a});e[s].call(void 0,o)}}}))})),Se={id:r.string,style:r.object,className:r.string,breadcrumbOrderedList:r.elementType,breadcrumbListItem:r.elementType,breadcrumbDelimiter:r.elementType,breadcrumbLink:r.elementType,dir:r.oneOf(["ltr","rtl"]),disabled:r.bool,valueField:r.string,textField:r.string,iconField:r.string,iconClassField:r.string,onItemSelect:r.func,ariaLabel:r.string,onDrilldownStateChange:r.func,drilldownState:r.shape({steps:r.array}),rootItem:r.object},Ie={valueField:"id",textField:"text",iconField:"icon",iconClassField:"iconClass",data:[]};Ee.displayName="KendoReactChartBreadcrumb",Ee.propTypes=Se;const Ne="charts.nodata",ke={[Ne]:"No data available."},_e=e=>{const t=s.useLocalization();return h.createElement("div",{className:a.classNames("k-chart-overlay",e.className),style:{display:"none",...e.style}},h.createElement("div",{className:"k-no-data"},void 0===e.children?t.toLanguageString(Ne,ke[Ne]):e.children))};_e.displayName="ChartNoDataOverlay";const we=e=>h.createElement(fe,{...e,_chartKey:"title"});we.displayName="ChartAxisDefaultsTitle";const Te=e=>h.createElement(fe,{...e,_chartKey:"labels"});Te.displayName="ChartAxisDefaultsLabels";const Ae=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"});Ae.displayName="ChartAxisDefaultsCrosshair";const Ke=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"});Ke.displayName="ChartAxisDefaultsCrosshairTooltip";const Oe=e=>h.createElement(fe,{...e,_chartKey:"title"});Oe.displayName="ChartCategoryAxisTitle";const Le=e=>h.createElement(fe,{...e,_chartKey:"title"});Le.displayName="ChartPaneDefaultsTitle";const De=e=>h.createElement(fe,{...e,_chartKey:"item"});De.displayName="ChartLegendItem";const Re=e=>h.createElement(fe,{...e,_chartKey:"title"});Re.displayName="ChartLegendTitle";const Pe=e=>h.createElement(fe,{...e,_chartKey:"inactiveItems"});Pe.displayName="ChartLegendInactiveItems";const Fe=e=>h.createElement(fe,{...e,_chartKey:"title"});Fe.displayName="ChartValueAxisTitle";const Ve=e=>h.createElement(fe,{...e,_chartKey:"title"});Ve.displayName="ChartXAxisTitle";const He=e=>h.createElement(fe,{...e,_chartKey:"title"});He.displayName="ChartYAxisTitle";const je=e=>h.createElement(fe,{...e,_chartKey:"categoryAxis"});je.displayName="ChartNavigatorCategoryAxis";const Me=e=>h.createElement(fe,{...e,_chartKey:"pane"});Me.displayName="ChartNavigatorPane";const Ue=e=>h.createElement(fe,{...e});Ue.displayName="ChartNavigatorSeriesItem";const ze=e=>h.createElement(Ce,{...e,_chartKey:"series"});ze.propTypes={children:function(e,t,r){return d(e,t,r,Ue)}};const qe=e=>h.createElement(fe,{...e,_chartKey:"chartArea"});qe.displayName="ChartArea";const Be=e=>h.createElement(fe,{...e});Be.displayName="ChartCategoryAxisItem";const We=e=>h.createElement(Ce,{...e,_chartKey:"categoryAxis"});We.propTypes={children:function(e,t,r){return d(e,t,r,Be)}},We.displayName="ChartCategoryAxis";const Xe=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"legend"});Xe.displayName="ChartLegend";const Ye=e=>h.createElement(fe,{visible:!0,position:"bottom",...e,_chartKey:"navigator"});Ye.displayName="ChartNavigator";const $e=e=>h.createElement(fe,{...e});$e.displayName="ChartPane";const Ze=e=>h.createElement(fe,{...e,_chartKey:"paneDefaults"});Ze.displayName="ChartPaneDefaults";const Ge=e=>h.createElement(Ce,{...e,_chartKey:"panes"});Ge.propTypes={children:function(e,t,r){return d(e,t,r,$e)}};const Je=e=>{let t=e=>h.createElement(h.Fragment,null);e.drilldownSeriesFactory&&(t=e.drilldownSeriesFactory);const r=t=>{var r,s;return t&&(null==(s=null==(r=t.drilldownState)?void 0:r.steps)?void 0:s.find((({seriesName:t})=>t===e.name)))};return h.createElement(X.Consumer,null,(s=>r(s)?h.createElement(t,{_chartCollectionIdxKey:e._chartCollectionIdxKey,drilldownValue:r(s).drilldownValue}):h.createElement(fe,{...e})))};Je.displayName="ChartSeriesItem";const Qe=e=>h.createElement(Ce,{...e,_chartKey:"series"});Qe.propTypes={children:function(e,t,r){return d(e,t,r,Je)}},Qe.displayName="ChartSeries";const et=e=>h.createElement(fe,{...e,_chartKey:"subtitle"});et.displayName="ChartSubtitle";const tt=e=>h.createElement(fe,{...e,_chartKey:"title"});tt.displayName="ChartTitle";const rt=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"});rt.displayName="ChartTooltip";const st=e=>h.createElement(fe,{...e});st.displayName="ChartValueAxisItem";const nt=e=>h.createElement(Ce,{...e,_chartKey:"valueAxis"});nt.propTypes={children:function(e,t,r){return d(e,t,r,st)}},nt.displayName="ChartValueAxis";const at=e=>h.createElement(fe,{...e});at.displayName="ChartXAxisItem";const it=e=>h.createElement(Ce,{...e,_chartKey:"xAxis"});it.prototype={children:function(e,t,r){return d(e,t,r,at)}},it.displayName="ChartXAxis";const ot=e=>h.createElement(fe,{...e});ot.displayName="ChartYAxisItem";const lt=e=>h.createElement(Ce,{...e,_chartKey:"yAxis"});lt.propTypes={children:function(e,t,r){return d(e,t,r,ot)}},lt.displayName="ChartYAxis";const ct=r.exact({left:r.number,top:r.number}),ht={left:r.number,right:r.number},pt={...ht,top:r.number,bottom:r.number},dt=r.oneOfType([r.number,r.exact(pt)]),ut=dt,mt=r.exact({width:r.number,color:r.string,opacity:r.number,dashType:r.string}),yt={visible:r.bool,font:r.string,color:r.string,opacity:r.number,align:r.oneOf(["left","right","center"]),position:r.oneOf(["inside","before","after"]),padding:ut,margin:r.exact(ht),border:mt,offset:ct},gt={color:r.string,opacity:r.number,offset:ct,padding:r.number,width:r.number,focusHighlight:r.exact({border:mt})},vt={colorType:r.oneOf(["static","source","target"]),color:r.string,opacity:r.number,highlight:r.exact({opacity:r.number,inactiveOpacity:r.number}),focusHighlight:r.exact({border:mt})},Ct=r.exact({text:r.string,...yt}),bt=r.exact({id:r.oneOfType([r.string,r.number]).isRequired,label:Ct.isRequired,...gt}),ft=r.exact({sourceId:r.oneOfType([r.string,r.number]).isRequired,targetId:r.oneOfType([r.string,r.number]).isRequired,value:r.number.isRequired,...vt}),xt={data:r.exact({nodes:r.arrayOf(bt.isRequired).isRequired,links:r.arrayOf(ft.isRequired).isRequired}).isRequired,links:r.exact(vt),nodes:r.exact(gt),labels:r.exact(yt),legend:r.exact({align:r.oneOf(["start","center","end"]),background:r.string,border:mt,height:r.number,labels:r.object,margin:dt,offsetX:r.number,offsetY:r.number,orientation:r.oneOf(["vertical","horizontal"]),padding:ut,position:r.oneOf(["top","bottom","left","right","custom"]),reverse:r.bool,visible:r.bool,width:r.number,item:r.object,title:r.object}),title:r.exact({align:r.oneOf(["center","left","right"]),background:r.string,border:mt,color:r.string,font:r.string,margin:dt,padding:ut,position:r.oneOf(["top","bottom"]),text:r.string,visible:r.bool}),tooltip:r.exact({visible:r.bool,offset:r.number,followPointer:r.bool,delay:r.number,linkComponent:r.any,nodeComponent:r.any}),className:r.string,style:r.object,dir:r.string,disableAutoLayout:r.bool,disableKeyboardNavigation:r.bool,onNodeEnter:r.func,onNodeLeave:r.func,onLinkEnter:r.func,onLinkLeave:r.func,onNodeClick:r.func,onLinkClick:r.func},Et="sankey.tooltipUnitFormat",St={[Et]:"({0} units)"},It=e=>{const{Content:t,dir:r,offset:s,event:{tooltipData:n,dataItem:a,nodeValue:i}}=e,o=h.useRef(null);return h.useEffect((()=>{const e=o.current;if(!n||!e)return;const t=e.offsetWidth,r=e.offsetHeight,a={...n.popupOffset},i=n.popupAlign;a.left+="left"===i.horizontal?s:-1*s,"right"===i.horizontal&&(a.left-=t),"bottom"===i.vertical?a.top-=r+s:a.top+=s,e.style.left=`${a.left}px`,e.style.top=`${a.top}px`,e.style.visibility=""}),[n]),h.createElement("div",{ref:o,style:{visibility:"hidden"},dir:r,className:"k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"},h.createElement("div",{className:"k-tooltip-content"},h.createElement(t,{dir:r,dataItem:a,nodeValue:i})))},Nt={display:"flex",alignItems:"center"},kt=e=>h.createElement("div",{style:{width:15,height:15,backgroundColor:e.color,display:"inline-flex",marginLeft:3}}),_t=e=>h.createElement("span",{style:{margin:"0 3px"}},e.children),wt=e=>s.useInternationalization().format(s.useLocalization().toLanguageString(Et,St[Et]),[e||0]),Tt=e=>{const{color:t,label:r}=e.dataItem;return h.createElement("div",{style:Nt,className:"k-tooltip-content"},h.createElement(kt,{color:t}),h.createElement(_t,null,r.text),h.createElement(_t,null,wt(e.nodeValue)))},At=e=>{const{source:t,target:r,value:s}=e.dataItem,n="rtl"===e.dir?l.arrowLeftIcon:l.arrowRightIcon;return h.createElement("div",{style:Nt},h.createElement(kt,{color:t.color}),h.createElement(_t,null,t.label.text),h.createElement(a.IconWrap,{icon:n,name:n.name}),h.createElement(kt,{color:r.color}),h.createElement(_t,null,r.label.text),h.createElement(_t,null,wt(s)))},Kt=12,Ot={offset:Kt,visible:!0},Lt=["nodeEnter","nodeLeave","linkEnter","linkLeave","nodeClick","linkClick"],Dt=h.forwardRef(((e,t)=>{a.validatePackage(le);const r=h.useRef(null),s=h.useRef(null),i=a.useRtl(r,e.dir,[e.dir,r.current]),o=h.useRef(null),{data:l,links:c,nodes:p,labels:d,title:u,legend:m,tooltip:y=Ot,disableAutoLayout:g,disableKeyboardNavigation:v}=e,C=h.useRef();C.current=e;const[b,f]=h.useState(null),x=h.useCallback((e=>{const{visible:t,offset:r=Kt,nodeComponent:s=Tt,linkComponent:n=At}={...Ot,...y};if(t){const t={event:e,offset:r,dir:i,Content:"node"===e.targetType?s:n};f(t)}}),[y,i]),E=h.useCallback((()=>{f(null)}),[]),S=h.useCallback(((e,t)=>{const r=C.current[e];if(r){const e={...t,nativeEvent:t.originalEvent,target:o.current};r.call(void 0,e)}}),[]);return h.useEffect((()=>{const e={data:l,links:c,nodes:p,labels:d,title:u,legend:m,disableAutoLayout:g,disableKeyboardNavigation:v,rtl:"rtl"===i,tooltip:{...Ot,...y}};if(s.current)s.current.setOptions(e);else if(a.canUseDOM&&r.current){const t=n.sankeyTheme(r.current);s.current=new n.Sankey(r.current,e,t),((e,t)=>{e&&(e.unbind(),Lt.forEach((r=>{t[r]&&e.bind(r,t[r])})))})(s.current,{nodeEnter:e=>{S("onNodeEnter",e)},nodeLeave:e=>{S("onNodeLeave",e)},linkEnter:e=>{S("onLinkEnter",e)},linkLeave:e=>{S("onLinkLeave",e)},nodeClick:e=>{S("onNodeClick",e)},linkClick:e=>{S("onLinkClick",e)}}),s.current.bind("tooltipShow",x),s.current.bind("tooltipHide",E)}return()=>{s.current&&(s.current.destroy(),s.current=null)}}),[l,c,p,d,u,m,g,v,i,y,E,x,S]),h.useImperativeHandle(o,(()=>({get element(){return r.current},exportVisual:e=>s.current.exportVisual(e),props:e})),[]),h.useImperativeHandle(t,(()=>o.current)),h.createElement(h.Fragment,null,h.createElement("div",{ref:r,className:e.className,style:e.style,dir:i}),b&&h.createElement(It,{...b}))}));Dt.propTypes=xt,Dt.displayName="KendoReactSankey";const Rt=n.createSankeyData;e.AxisLabelClickEvent=y,e.Chart=ue,e.ChartArea=qe,e.ChartAxisDefaults=e=>h.createElement(fe,{...e,_chartKey:"axisDefaults"}),e.ChartAxisDefaultsCrosshair=Ae,e.ChartAxisDefaultsCrosshairTooltip=Ke,e.ChartAxisDefaultsLabels=Te,e.ChartAxisDefaultsTitle=we,e.ChartBreadcrumb=Ee,e.ChartCategoryAxis=We,e.ChartCategoryAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartCategoryAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartCategoryAxisItem=Be,e.ChartCategoryAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartCategoryAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartCategoryAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartCategoryAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartCategoryAxisRangeLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"rangeLabels"}),e.ChartCategoryAxisTitle=Oe,e.ChartLegend=Xe,e.ChartLegendInactiveItems=Pe,e.ChartLegendItem=De,e.ChartLegendTitle=Re,e.ChartNavigator=Ye,e.ChartNavigatorCategoryAxis=je,e.ChartNavigatorHint=e=>h.createElement(fe,{...e,_chartKey:"hint"}),e.ChartNavigatorPane=Me,e.ChartNavigatorSelect=e=>h.createElement(fe,{...e,_chartKey:"select"}),e.ChartNavigatorSeries=ze,e.ChartNavigatorSeriesItem=Ue,e.ChartNoDataOverlay=_e,e.ChartPane=$e,e.ChartPaneDefaults=Ze,e.ChartPaneDefaultsTitle=Le,e.ChartPanes=Ge,e.ChartPlotArea=e=>h.createElement(fe,{...e,_chartKey:"plotArea"}),e.ChartSeries=Qe,e.ChartSeriesDefaults=e=>h.createElement(fe,{...e,_chartKey:"seriesDefaults"}),e.ChartSeriesErrorBars=e=>h.createElement(fe,{...e,_chartKey:"errorBars"}),e.ChartSeriesExtremes=e=>h.createElement(fe,{...e,_chartKey:"extremes"}),e.ChartSeriesHighlight=e=>h.createElement(fe,{...e,_chartKey:"highlight"}),e.ChartSeriesItem=Je,e.ChartSeriesItemOutliers=e=>h.createElement(fe,{...e,_chartKey:"outliers"}),e.ChartSeriesItemTooltip=e=>h.createElement(fe,{...e,_chartKey:"tooltip"}),e.ChartSeriesLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartSeriesLabelsFrom=e=>h.createElement(fe,{...e,_chartKey:"from"}),e.ChartSeriesLabelsTo=e=>h.createElement(fe,{...e,_chartKey:"to"}),e.ChartSeriesMarkers=e=>h.createElement(fe,{...e,_chartKey:"markers"}),e.ChartSeriesNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartSeriesNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartSeriesNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartSubtitle=et,e.ChartTitle=tt,e.ChartTooltip=rt,e.ChartValueAxis=nt,e.ChartValueAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartValueAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartValueAxisItem=st,e.ChartValueAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartValueAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartValueAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartValueAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartValueAxisTitle=Fe,e.ChartXAxis=it,e.ChartXAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartXAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartXAxisItem=at,e.ChartXAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartXAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartXAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartXAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartXAxisTitle=Ve,e.ChartYAxis=lt,e.ChartYAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartYAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartYAxisItem=ot,e.ChartYAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartYAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartYAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartYAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartYAxisTitle=He,e.ChartZoomable=e=>h.createElement(fe,{...e,_chartKey:"zoomable"}),e.CollectionConfigurationComponent=Ce,e.ConfigurationComponent=fe,e.CrosshairTooltip=re,e.CrosshairTooltipContainer=oe,e.DonutCenter=de,e.DragEndEvent=C,e.DragEvent=v,e.DragStartEvent=b,e.DrilldownEvent=f,e.DrilldownStateChangeEvent=xe,e.LegendItemClickEvent=E,e.LegendItemHoverEvent=x,e.NavigatorFilterEvent=S,e.NoteClickEvent=I,e.NoteHoverEvent=N,e.PlotAreaClickEvent=k,e.PlotAreaHoverEvent=_,e.RenderEvent=w,e.Sankey=Dt,e.SelectEndEvent=A,e.SelectEvent=T,e.SelectStartEvent=K,e.SeriesClickEvent=O,e.SeriesHoverEvent=L,e.SeriesTooltip=Q,e.SharedTooltipContent=W,e.Sparkline=me,e.StockChart=ge,e.TooltipPoint=B,e.TooltipPopup=G,e.ZoomEndEvent=R,e.ZoomEvent=D,e.ZoomStartEvent=P,e.createSankeyData=Rt,e.exportVisual=(e,t={})=>{if(e&&null!==e.chartInstance)return e.chartInstance.exportVisual(t)},e.findAxisByName=(e,t)=>{if(e&&null!==e.chartInstance)return e.chartInstance.findAxisByName(t)},e.findPaneByIndex=(e,t)=>{if(e&&null!==e.chartInstance)return e.chartInstance.findPaneByIndex(t)},e.findPaneByName=(e,t)=>{if(e&&null!==e.chartInstance)return e.chartInstance.findPaneByName(t)}}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-intl"),require("@progress/kendo-charts"),require("@progress/kendo-react-common"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-layout"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-intl","@progress/kendo-charts","@progress/kendo-react-common","@progress/kendo-react-popup","@progress/kendo-react-layout","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactCharts={},e.React,e.PropTypes,e.KendoReactIntl,e.KendoCharts,e.KendoReactCommon,e.KendoReactPopup,e.KendoReactLayout,e.KendoSvgIcons)}(this,(function(e,t,r,s,n,a,i,o,l){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var h=c(t);function p(e,t){let r=e;for(;r&&r!==t;)r=r.parentNode;return!!r}function d(e,t,r,s){const n=e[t];if(n&&Array.isArray(n))for(const e of n)if(!e.type||e.type!==s)return new Error(`${r} children should be Array of type ${s.displayName}.`);return null}const u=e=>void 0!==e&&!e;let m=class{constructor(e){this.target=e}},y=class extends m{constructor(e,t){super(t),this.axis=e.axis,this.dataItem=e.dataItem,this.index=e.index,this.text=e.text,this.value=e.value}},g=class extends m{constructor(){super(...arguments),this.prevented=!1}preventDefault(){this.prevented=!0}isDefaultPrevented(){return this.prevented}},v=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},C=class extends m{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},b=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},f=class extends m{constructor(e,t){super(t),this.value=e.value,this.point=e.point,this.series=e.series,this.currentState=e.currentState,this.nextState=e.nextState}},x=class extends g{constructor(e,t){super(t),this.series=e.series,this.seriesIndex=e.seriesIndex,this.pointIndex=e.pointIndex,this.text=e.text}preventDefault(){super.preventDefault()}},E=class extends g{constructor(e,t){super(t),this.series=e.series,this.seriesIndex=e.seriesIndex,this.pointIndex=e.pointIndex,this.text=e.text}preventDefault(){super.preventDefault()}},S=class extends m{constructor(e,t){super(t),this.from=e.from,this.to=e.to}},I=class extends m{constructor(e,t){super(t),this.category=e.category,this.dataItem=e.dataItem,this.series=e.series,this.value=e.value,this.visual=e.visual}},N=class extends m{constructor(e,t){super(t),this.category=e.category,this.dataItem=e.dataItem,this.series=e.series,this.value=e.value,this.visual=e.visual}},k=class extends m{constructor(e,t){super(t),this.category=e.category,this.nativeEvent=e.originalEvent,this.value=e.value,this.x=e.x,this.y=e.y}},_=class extends m{constructor(e,t){super(t),this.category=e.category,this.nativeEvent=e.originalEvent,this.value=e.value,this.x=e.x,this.y=e.y}},w=class extends m{constructor(e,t){super(t)}},T=class extends g{constructor(e,t){super(t),this.axis=e.axis,this.from=e.from,this.to=e.to}},A=class extends m{constructor(e,t){super(t),this.axis=e.axis,this.from=e.from,this.to=e.to}},K=class extends g{constructor(e,t){super(t),this.axis=e.axis,this.from=e.from,this.to=e.to}},O=class extends m{constructor(e,t){super(t),this.category=e.category,this.dataItem=e.dataItem,this.nativeEvent=e.originalEvent,this.percentage=e.percentage,this.point=e.point,this.series=e.series,this.stackValue=e.stackValue,this.value=e.value}},L=class extends g{constructor(e,t){super(t),this.category=e.category,this.categoryPoints=e.categoryPoints,this.dataItem=e.dataItem,this.nativeEvent=e.originalEvent,this.percentage=e.percentage,this.point=e.point,this.series=e.series,this.stackValue=e.stackValue,this.value=e.value}},D=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.delta=e.delta,this.nativeEvent=e.originalEvent}},R=class extends m{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}},P=class extends g{constructor(e,t){super(t),this.axisRanges=e.axisRanges,this.nativeEvent=e.originalEvent}};const F={axisLabelClick:y,drag:v,dragEnd:C,dragStart:b,drilldownEvent:f,legendItemHover:x,legendItemClick:E,legendItemLeave:class extends g{constructor(e,t){super(t),this.series=e.series,this.seriesIndex=e.seriesIndex,this.pointIndex=e.pointIndex,this.text=e.text}preventDefault(){super.preventDefault()}},navigatorFilter:S,noteClick:I,noteHover:N,plotAreaClick:k,plotAreaHover:_,render:w,select:T,selectEnd:A,selectStart:K,seriesClick:O,seriesHover:L,zoom:D,zoomEnd:R,zoomStart:P};let V=class{constructor(e,t){this.sender=e,this.syntheticEvent=t}};function H(e,t){return new V(e,t)}const j=e=>{let t,r,s=[];const n=n=>{t=e(t,n),a.canUseDOM&&(window.clearTimeout(r),r=window.setTimeout((()=>s.forEach((e=>e()))),16.666666666666668))};return n({}),{getState:()=>t,dispatch:n,subscribe:e=>(s.push(e),()=>s=s.filter((t=>t!==e)))}},M=(e,t)=>t.chartCollectionIdxKey?q.collectionConfigurationItem(e,t):t.chartKey?q.configurationItem(e,t):{},U=(e,t)=>{if(!t.type)return{};switch(t.type){case"set":return q.themeItem(e,t);case"push":return Object.assign(e,t.payload);default:return e}},z=(e,t)=>{if(!t.type)return[];switch(t.type){case"add":return[...e,t.payload];case"remove":return e.filter((e=>e!==t.payload));default:return e}},q={configurationItem:(e,t)=>Object.assign(e,{[t.chartKey]:t.payload}),collectionConfigurationItem(e,t){let r=!1;const[s,n]=t.chartCollectionIdxKey.split("_"),a=e[s].map(((e,s)=>parseInt(n,10)===s?(r=!0,t.payload):e));return!1===r&&a.splice(parseInt(n,10),0,t.payload),Object.assign(e,{[s]:a})},themeItem(e,t){let r={};const s=Object.assign(r,e),{field:n,value:a}=t.payload,i=n.split(".");let o=i.shift();for(;i.length>0;)r=r[o]=r[o]||{},o=i.shift();return r[o]=a,s}};let B=class{constructor(e,t){this.value=e.value,this.category=e.category,this.categoryIndex=e.categoryIx,this.series=e.series,this.dataItem=e.dataItem,this.percentage=e.percentage,this.runningTotal=e.runningTotal,this.total=e.total,this.low=e.low,this.high=e.high,this.xLow=e.xLow,this.xHigh=e.xHigh,this.yLow=e.yLow,this.yHigh=e.yHigh,this.point=e,this.format=((e.options||{}).tooltip||{}).format||t}get formattedValue(){return this.format?this.point.formatValue(this.format):String(this.value)}};const W=e=>{const{categoryText:t,colorMarker:r,colspan:s,nameColumn:n,points:a}=e;return h.createElement("table",null,h.createElement("thead",null,h.createElement("tr",null,h.createElement("th",{colSpan:s},t))),h.createElement("tbody",null,a.map(((e,t)=>h.createElement("tr",{key:t},r&&h.createElement("td",null,h.createElement("span",{className:"k-chart-shared-tooltip-marker",style:{backgroundColor:e.series.color}})),n&&h.createElement("td",null,e.series.name),h.createElement("td",{dangerouslySetInnerHTML:{__html:e.formattedValue}}))))))},X=h.createContext(null);X.displayName="ChartContext";const Y={horizontal:"fit",vertical:"fit"},$="k-chart-tooltip",Z=class extends h.Component{constructor(e,t){super(e,t),this.context=null,this.element=null,this.onChartMouseLeave=e=>{const{syntheticEvent:t}=e;return!!p(t.relatedTarget,this.element)},this.onMouseLeave=e=>{const t=H(this,e);this.context.childrenObserver.trigger("onMouseLeave",t)&&e.preventDefault()},this.popupRef=e=>{this.element=e;const t=e&&e.closest(".k-animation-container");t&&(t.style.transition="initial")},this.chartObserver=new n.InstanceObserver(this,{onMouseLeave:"onChartMouseLeave"}),t.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupShown:e,popupAlign:t,popupOffset:r,popupStyles:s,popupContent:n,className:a}=this.props,o=[$,a].join(" ").trim();return h.createElement(i.Popup,{animate:!1,popupAlign:t,offset:r,show:e,collision:Y,className:"k-chart-tooltip-wrapper"},h.createElement("div",{className:o,style:s,onMouseLeave:this.onMouseLeave,ref:this.popupRef},n()))}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.chartObserver})}};Z.contextType=X;let G=Z;const J=class extends h.Component{constructor(){super(...arguments),this.context=null,this.state={popupShown:!1},this.chartObserver=null}componentDidMount(){this.chartObserver=new n.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),this.context.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupContext:e,shared:t,className:r,...s}=this.state,n=this.state.popupShown?()=>{const r=this.findRenderFunction();if(t)return null!==r?r(e):h.createElement(W,{...e});const s=e.point,n=this.findRenderFunctionByIndex(s.series.index);return null!==n?n(e):null!==r?r(e):h.createElement("span",{dangerouslySetInnerHTML:{__html:e.point.formattedValue}})}:Function.prototype,i=a.classNames({"k-chart-shared-tooltip":t,"k-chart-tooltip-inverse":!!r});return h.createElement(G,{...s,popupContent:n,className:i})}componentWillUnmount(){this.context.observersStore.dispatch({type:"remove",payload:this.chartObserver})}onShowTooltip(e){const{anchor:t,style:r,shared:s,className:n,crosshair:a}=e;let i;a||(i=s?this.createSharedTooltipContext(e):this.createTooltipContext(e),this.setState({popupShown:!0,popupAlign:t.align,popupOffset:t.point,popupContext:i,popupStyles:r,className:n,shared:s}))}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}createSharedTooltipContext(e){const{points:t,categoryText:r}=e,s=t.filter((e=>void 0!==e.series.name)).length>0,n=e.series.length>1;let a=1;return s&&a++,n&&a++,{categoryText:r,colorMarker:n,colspan:a,nameColumn:s,points:e.points.map((t=>new B(t,e.format)))}}createTooltipContext(e){const{point:t,format:r}=e;return{point:new B(t,r)}}findRenderFunctionByIndex(e){const t=this.context.optionsStore.getState().series;return void 0!==t&&Array.isArray(t)&&void 0!==t[e]&&t[e].hasOwnProperty("tooltip")&&t[e].tooltip.hasOwnProperty("render")?t[e].tooltip.render:null}findRenderFunction(){const e=this.context.optionsStore.getState().tooltip;return void 0!==e&&e.hasOwnProperty("render")?e.render:null}};J.contextType=X;let Q=J;const ee=e=>e.children;ee.displayName="Container";const te=class extends h.Component{constructor(e,t){super(e,t),this.context=null,this.state={popupShown:!1},this.chartObserver=new n.InstanceObserver(this,{showTooltip:"onShowTooltip",hideTooltip:"onHideTooltip"}),t.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{popupContend:e,className:t,...r}=this.state,s=this.state.popupShown?()=>e:Function.prototype,n=a.classNames({"k-chart-crosshair-tooltip":!0,"k-chart-tooltip-inverse":!!t});return h.createElement(G,{...r,popupContent:s,className:n})}componentWillUnmount(){var e;null==(e=this.context)||e.observersStore.dispatch({type:"remove",payload:this.chartObserver})}onShowTooltip(e){const{anchor:t,style:r,className:s,crosshair:n,axisName:a,axisIndex:i,value:o}=e,{name:l,index:c}=this.props;n&&a===l&&i===c&&this.setState({popupShown:!0,popupAlign:t.align,popupOffset:t.point,popupContend:o,popupStyles:r,className:s})}onHideTooltip(){this.setState({popupShown:!1,popupStyles:{},className:void 0})}};te.contextType=X;let re=te;const se=["categoryAxis","valueAxis","xAxis","yAxis"];function ne(e){const t={};for(let r=0;r<se.length;r++){const s=ae(e,se[r]);for(let e=0;e<s.length;e++){const r=s[e];t[r.name+r.index]=r}}return t}function ae(e,t){const r=[];if(e[t]){const s=[].concat(e[t]);for(let e=0;e<s.length;e++){const n=(s[e].crosshair||{}).tooltip;n&&n.visible&&r.push({index:e,name:t})}}return r}const ie=class extends h.Component{constructor(){super(...arguments),this.context=null,this.state={tooltips:{}},this.storeUnsubscriber=Function.prototype,this.subscriber=()=>{var e;this.setState({tooltips:ne(null==(e=this.context)?void 0:e.optionsStore.getState())})}}componentDidMount(){this.storeUnsubscriber=this.context.optionsStore.subscribe(this.subscriber)}render(){const{tooltips:e}=this.state,t=Object.keys(e).map((t=>h.createElement(re,{...e[t],key:t})));return h.createElement(ee,null,t)}componentWillUnmount(){this.storeUnsubscriber()}};ie.contextType=X;let oe=ie;const le={name:"@progress/kendo-react-charts",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},ce=class extends h.Component{constructor(e){super(e),this.chartInstance=null,this.surface=null,this._element=null,this.optionsStore={},this.optionsUnsubscriber=Function.prototype,this.themeStore={},this.themeUnsubscriber=Function.prototype,this.observersStore={},this.suppressTransitions=!1,this.showLicenseWatermark=!1,this.onRender=e=>{null!==this.chartInstance&&(this.surface=e.sender.surface,this.trigger("render",e))},this.onDrilldown=e=>{var t;const{series:r}=this.optionsStore.getState(),s=r.find((t=>t.name===e.series.name));if(s.drilldownSeriesFactory){const r="onDrilldown";if(this.props.hasOwnProperty(r)){const n={seriesName:s.name,drilldownValue:e.value},a=[...(null==(t=this.props.drilldownState)?void 0:t.steps)||[],n],i=this.props.getTarget(),o={...e,currentState:this.props.drilldownState,nextState:{steps:a}},l=new f(o,i);this.props[r].call(void 0,l)}}return!0},this.onLegendItemClick=e=>{if(null!==this.chartInstance)if(this.props.onLegendItemClick)this.trigger("legendItemClick",e);else{const{series:t}=this.optionsStore.getState();if(!t)return;let r={};const{seriesIndex:s,pointIndex:n}=e,a=t[s];if(void 0===n)r=Object.assign({},a,{visible:u(a.visible)});else{const e=a.pointVisibility=a.pointVisibility||[];e[n]=u(e[n]),r=Object.assign({},a)}this.optionsStore.dispatch({chartCollectionIdxKey:`series_${s}`,payload:r}),this.suppressTransitions=!0}},this.onWindowResize=()=>{null!==this.chartInstance&&this.chartInstance.resize()},this.onChartMouseLeave=e=>{const t=H(this,e);this.triggerDomEvent("onMouseLeave",t)?e.preventDefault():null!==this.chartInstance&&this.chartInstance.hideElements()},this.onChildMouseLeave=e=>{const{syntheticEvent:t}=e;return this.chartInstance&&!p(t.relatedTarget,this.element)&&this.chartInstance.hideElements(),!1},this.showLicenseWatermark=!a.validatePackage(le,{component:"Chart"}),this.optionsStore=j(M),this.observersStore=j(z),this.childrenObserver=new n.InstanceObserver(this,{onMouseLeave:"onChildMouseLeave"}),this.state={optionsStore:this.optionsStore,observersStore:this.observersStore,childrenObserver:this.childrenObserver,drilldownState:{steps:[]}},this.themeStore=j(U),this.chartObserver=new n.InstanceObserver(this,{render:"onRender",legendItemClick:"onLegendItemClick",drilldown:"onDrilldown"})}get element(){return this._element}static getDerivedStateFromProps(e,t){return{...t,drilldownState:e.drilldownState||[]}}componentDidMount(){if(this._element){let e={};try{e=n.chartTheme(this._element)}catch{}const t=n.deepExtend(n.chartBaseTheme(),e);this.themeStore.dispatch({type:"push",payload:t}),this.instantiateCoreChart()}this.optionsUnsubscriber=this.optionsStore.subscribe(this.refresh.bind(this)),this.themeUnsubscriber=this.themeStore.subscribe(this.refresh.bind(this)),window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){this.optionsUnsubscriber(),this.themeUnsubscriber(),null!==this.chartInstance&&(this.chartInstance.destroy(),this.chartInstance=null),window.removeEventListener("resize",this.onWindowResize)}componentDidUpdate(e){const{dir:t,children:r,...n}=this.props;if(null!==this.chartInstance){const r=s.provideIntlService(this),a=this.chartInstance.chartService,i=r.locale!==a._intlService.locale,o=Object.entries(e).filter((e=>"dir"!==e[0]&&"children"!==e[0])).some((e=>{const[t,r]=e;return!(n.hasOwnProperty(t)&&n[t]===r)}));i&&(this.chartInstance.chartService._intlService=r,this.chartInstance.chartService.format._intlService=r,o||this.chartInstance.noTransitionsRedraw()),o&&this.refresh(),e.dir!==t&&this.chartInstance.setDirection(this.getDirection(t))}}render(){const{style:e={},className:t,wrapper:r,children:s}=this.props,n=Object.assign({},e,{position:"relative"}),i=h.createElement(r,{className:t,style:n,key:"chartElement"},h.createElement("div",{onMouseLeave:this.onChartMouseLeave,ref:e=>this._element=e,className:"k-chart-surface"},s),h.createElement(h.Fragment,null,this.showLicenseWatermark&&h.createElement(a.WatermarkOverlay,null)));return h.createElement(X.Provider,{value:this.state},h.createElement(Q,{key:"seriesTooltip"}),h.createElement(oe,{key:"crosshairTooltips"}),i)}getDirection(e){return"rtl"===(void 0!==e?e:a.canUseDOM&&window.getComputedStyle(this.element).direction||"ltr")}getChartOptions(){const{renderAs:e,pannable:t,zoomable:r,paneDefaults:s,panes:n,transitions:a,seriesColors:i,seriesDefaults:o,axisDefaults:l,deriveOptionsFromParent:c}=this.props;let h={};return void 0!==e&&(h.renderAs=e),void 0!==t&&(h.pannable=t),void 0!==r&&(h.zoomable=r),void 0!==s&&(h.paneDefaults=s),void 0!==n&&(h.panes=n),void 0!==a&&(h.transitions=a),void 0!==i&&(h.seriesColors=i),void 0!==o&&(h.seriesDefaults=o),void 0!==l&&(h.axisDefaults=l),h=Object.assign(h,this.optionsStore.getState()),c&&(h=c(h)),h}refresh(){if(null!==this.chartInstance){const e=this.themeStore.getState(),t=this.getChartOptions(),r=t.transitions;this.suppressTransitions&&(t.transitions=!1),this.props.onRefresh?this.props.onRefresh.call(void 0,t,e,this.chartInstance):this.chartInstance.setOptions(t,e),this.suppressTransitions&&(t.transitions=r,this.suppressTransitions=!1)}}instantiateCoreChart(){const{dir:e,chartConstructor:t}=this.props,r=this.getChartOptions();this.chartInstance=new t(this.element,r,this.themeStore.getState(),{rtl:this.getDirection(e),intlService:s.provideIntlService(this),observer:this.chartObserver,sender:this})}trigger(e,t){const r=function(e,t,r){if(F[e])return new F[e](t,r)}(e,t,this.props.getTarget()),s="on"+e.charAt(0).toUpperCase()+e.slice(1),n=this.observersStore.getState();let a=!1;for(let r=0;r<n.length;r++)n[r].trigger(e,t)&&(a=!0);return!1===a&&r&&this.props.hasOwnProperty(s)?(this.props[s].call(void 0,r),r.isDefaultPrevented&&r.isDefaultPrevented()):a}requiresHandlers(e){for(let t=0;t<e.length;t++){const r=e[t],s="on"+r.charAt(0).toUpperCase()+r.slice(1);if(this.props.hasOwnProperty(s))return!0}return!1}triggerDomEvent(e,t){const r=this.observersStore.getState();let s=!1;for(let n=0;n<r.length;n++)r[n].trigger(e,t)&&(s=!0);return s}};ce.propTypes={dir:r.string,renderAs:r.oneOf(["svg","canvas"])},ce.defaultProps={renderAs:"svg"};let he=ce;s.registerForIntl(he);const pe=class extends h.Component{constructor(e,t){super(e,t),this.context=null,this.state={donutCenterStyles:null},this.chartObserver=new n.InstanceObserver(this,{render:"onRender"}),t.observersStore.dispatch({type:"add",payload:this.chartObserver})}render(){const{render:e}=this.props,{donutCenterStyles:t}=this.state;let r=null;return e&&t&&(r=h.createElement("div",{className:"k-chart-donut-center",style:t},h.createElement(e,null))),r}onRender(e){var t;const r=null==(t=this.context)?void 0:t.optionsStore.getState().series,s=Array.isArray(r)?r[0]:null,n=e.sender._plotArea.charts;if(!s||"donut"!==s.type||0===n[0].points.length)return;const a=n[0].points[0].sector,i=a.innerRadius,o=a.center.y-i,l=a.center.x-i,c=2*i;this.setState({donutCenterStyles:{height:c,left:l,top:o,width:c}})}};pe.contextType=X;let de=pe,ue=class extends h.Component{constructor(){super(...arguments),this._baseChart=null,this.getTarget=()=>this}get chartInstance(){return null!==this._baseChart?this._baseChart.chartInstance:null}get surface(){return null!==this._baseChart?this._baseChart.surface:null}get element(){return null!==this._baseChart?this._baseChart.element:null}render(){const{donutCenterRender:e,children:t,className:r,...s}=this.props;return h.createElement(he,{...s,ref:e=>this._baseChart=e,chartConstructor:n.Chart,getTarget:this.getTarget,wrapper:"div",className:a.classNames("k-chart k-widget",r)},t,h.createElement(de,{render:e}))}},me=class extends h.Component{constructor(){super(...arguments),this._baseChart=null,this.deriveOptionsFromParent=e=>{const{type:t,data:r}=this.props,s=Object.assign({},e,{type:t,data:r});return n.Sparkline.normalizeOptions(s)},this.getTarget=()=>this}get chartInstance(){return null!==this._baseChart?this._baseChart.chartInstance:null}get surface(){return null!==this._baseChart?this._baseChart.surface:null}get element(){return null!==this._baseChart?this._baseChart.element:null}render(){const{children:e,type:t,className:r,...s}=this.props;return h.createElement(he,{...s,ref:e=>this._baseChart=e,chartConstructor:n.Sparkline,getTarget:this.getTarget,wrapper:"span",deriveOptionsFromParent:this.deriveOptionsFromParent,className:a.classNames("k-sparkline k-widget",r)},e)}};const ye={autoBindElements:!0,liveDrag:!1,partialRedraw:!0};let ge=class extends h.Component{constructor(){super(...arguments),this._baseChart=null,this.deriveOptionsFromParent=e=>{const t=Object.assign({},e.navigator||{},ye);return Object.assign({},e,{navigator:t})},this.onRefresh=(e,t,r)=>{this.props.partialRedraw?(r.applyOptions(e),r.bindCategories(),r.navigator.redrawSlaves()):r.setOptions(e,t)},this.getTarget=()=>this}get chartInstance(){return null!==this._baseChart?this._baseChart.chartInstance:null}get surface(){return null!==this._baseChart?this._baseChart.surface:null}get element(){return null!==this._baseChart?this._baseChart.element:null}render(){const{children:e,className:t,...r}=this.props;return h.createElement(he,{...r,ref:e=>this._baseChart=e,chartConstructor:n.StockChart,getTarget:this.getTarget,wrapper:"div",deriveOptionsFromParent:this.deriveOptionsFromParent,onRefresh:this.onRefresh,className:a.classNames("k-stockchart k-widget",t)},e)}};const ve=class extends h.Component{constructor(e,t){super(e,t),this.optionsStore=t.optionsStore}renderChildren(e,t){const{children:r}=e.props,{_chartKey:s,_parentStore:n}=this.props,a={...e.props,_chartCollectionIdxKey:`${s}_${t}`,_parentStore:n};return h.cloneElement(e,a,r)}render(){const{_chartKey:e,_parentStore:t,children:r}=this.props;return(t||this.optionsStore).dispatch({chartKey:e,payload:[]}),h.Children.map(r,((e,t)=>h.isValidElement(e)?this.renderChildren(e,t):e))}};ve.contextType=X;let Ce=ve;const be=class extends h.Component{constructor(e,t){super(e,t),this.optionsStore=t.optionsStore,this.childStore=j(M)}render(){const{children:e}=this.props;return void 0!==e?h.Children.map(e,(e=>h.isValidElement(e)?this.renderChildren(e):e)):null}componentDidMount(){this.dispatch()}componentDidUpdate(){this.dispatch()}dispatch(){const{_chartKey:e,_chartCollectionIdxKey:t,_parentStore:r,children:s,...n}=this.props;(r||this.optionsStore).dispatch({chartKey:e,chartCollectionIdxKey:t,payload:Object.assign({},n,this.childStore.getState())})}renderChildren(e){const{children:t}=e.props,r={...e.props,_parentStore:this.childStore};return h.cloneElement(e,r,t)}};be.contextType=X;let fe=be,xe=class{constructor(e){this.currentState=e.currentState,this.nextState=e.nextState}};const Ee=h.forwardRef(((e,t)=>{const r=h.useRef(null),s=h.useRef(null),n={valueField:Ie.valueField,textField:Ie.textField,iconField:Ie.iconField,iconClassField:Ie.iconClassField,...e};h.useImperativeHandle(r,(()=>({element:s.current,props:n}))),h.useImperativeHandle(t,(()=>r.current));let i=[{id:"0",...e.rootItem||{text:"Home",icon:h.createElement(a.SvgIcon,{icon:l.homeIcon,style:{marginInlineEnd:"4px"}})}}];e.drilldownState&&(i=[...i,...e.drilldownState.steps.map(((e,t)=>({id:(t+1).toString(),text:e.drilldownValue})))]);const c={...n,data:i};return h.createElement("div",null,h.createElement(o.Breadcrumb,{...c,onItemSelect:t=>{var r;const s="onDrilldownStateChange";if(e.hasOwnProperty(s)){const n=i.findIndex((e=>e.id===t.id)),a={steps:((null==(r=e.drilldownState)?void 0:r.steps)||[]).slice(0,n)},o=new xe({currentState:e.drilldownState,nextState:a});e[s].call(void 0,o)}}}))})),Se={id:r.string,style:r.object,className:r.string,breadcrumbOrderedList:r.elementType,breadcrumbListItem:r.elementType,breadcrumbDelimiter:r.elementType,breadcrumbLink:r.elementType,dir:r.oneOf(["ltr","rtl"]),disabled:r.bool,valueField:r.string,textField:r.string,iconField:r.string,iconClassField:r.string,onItemSelect:r.func,ariaLabel:r.string,onDrilldownStateChange:r.func,drilldownState:r.shape({steps:r.array}),rootItem:r.object},Ie={valueField:"id",textField:"text",iconField:"icon",iconClassField:"iconClass",data:[]};Ee.displayName="KendoReactChartBreadcrumb",Ee.propTypes=Se;const Ne="charts.nodata",ke={[Ne]:"No data available."},_e=e=>{const t=s.useLocalization();return h.createElement("div",{className:a.classNames("k-chart-overlay",e.className),style:{display:"none",...e.style}},h.createElement("div",{className:"k-no-data"},void 0===e.children?t.toLanguageString(Ne,ke[Ne]):e.children))};_e.displayName="ChartNoDataOverlay";const we=e=>h.createElement(fe,{...e,_chartKey:"title"});we.displayName="ChartAxisDefaultsTitle";const Te=e=>h.createElement(fe,{...e,_chartKey:"labels"});Te.displayName="ChartAxisDefaultsLabels";const Ae=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"});Ae.displayName="ChartAxisDefaultsCrosshair";const Ke=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"});Ke.displayName="ChartAxisDefaultsCrosshairTooltip";const Oe=e=>h.createElement(fe,{...e,_chartKey:"title"});Oe.displayName="ChartCategoryAxisTitle";const Le=e=>h.createElement(fe,{...e,_chartKey:"title"});Le.displayName="ChartPaneDefaultsTitle";const De=e=>h.createElement(fe,{...e,_chartKey:"item"});De.displayName="ChartLegendItem";const Re=e=>h.createElement(fe,{...e,_chartKey:"title"});Re.displayName="ChartLegendTitle";const Pe=e=>h.createElement(fe,{...e,_chartKey:"inactiveItems"});Pe.displayName="ChartLegendInactiveItems";const Fe=e=>h.createElement(fe,{...e,_chartKey:"title"});Fe.displayName="ChartValueAxisTitle";const Ve=e=>h.createElement(fe,{...e,_chartKey:"title"});Ve.displayName="ChartXAxisTitle";const He=e=>h.createElement(fe,{...e,_chartKey:"title"});He.displayName="ChartYAxisTitle";const je=e=>h.createElement(fe,{...e,_chartKey:"categoryAxis"});je.displayName="ChartNavigatorCategoryAxis";const Me=e=>h.createElement(fe,{...e,_chartKey:"pane"});Me.displayName="ChartNavigatorPane";const Ue=e=>h.createElement(fe,{...e});Ue.displayName="ChartNavigatorSeriesItem";const ze=e=>h.createElement(Ce,{...e,_chartKey:"series"});ze.propTypes={children:function(e,t,r){return d(e,t,r,Ue)}};const qe=e=>h.createElement(fe,{...e,_chartKey:"chartArea"});qe.displayName="ChartArea";const Be=e=>h.createElement(fe,{...e});Be.displayName="ChartCategoryAxisItem";const We=e=>h.createElement(Ce,{...e,_chartKey:"categoryAxis"});We.propTypes={children:function(e,t,r){return d(e,t,r,Be)}},We.displayName="ChartCategoryAxis";const Xe=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"legend"});Xe.displayName="ChartLegend";const Ye=e=>h.createElement(fe,{visible:!0,position:"bottom",...e,_chartKey:"navigator"});Ye.displayName="ChartNavigator";const $e=e=>h.createElement(fe,{...e});$e.displayName="ChartPane";const Ze=e=>h.createElement(fe,{...e,_chartKey:"paneDefaults"});Ze.displayName="ChartPaneDefaults";const Ge=e=>h.createElement(Ce,{...e,_chartKey:"panes"});Ge.propTypes={children:function(e,t,r){return d(e,t,r,$e)}};const Je=e=>{let t=e=>h.createElement(h.Fragment,null);e.drilldownSeriesFactory&&(t=e.drilldownSeriesFactory);const r=t=>{var r,s;return t&&(null==(s=null==(r=t.drilldownState)?void 0:r.steps)?void 0:s.find((({seriesName:t})=>t===e.name)))};return h.createElement(X.Consumer,null,(s=>r(s)?h.createElement(t,{_chartCollectionIdxKey:e._chartCollectionIdxKey,drilldownValue:r(s).drilldownValue}):h.createElement(fe,{...e})))};Je.displayName="ChartSeriesItem";const Qe=e=>h.createElement(Ce,{...e,_chartKey:"series"});Qe.propTypes={children:function(e,t,r){return d(e,t,r,Je)}},Qe.displayName="ChartSeries";const et=e=>h.createElement(fe,{...e,_chartKey:"subtitle"});et.displayName="ChartSubtitle";const tt=e=>h.createElement(fe,{...e,_chartKey:"title"});tt.displayName="ChartTitle";const rt=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"});rt.displayName="ChartTooltip";const st=e=>h.createElement(fe,{...e});st.displayName="ChartValueAxisItem";const nt=e=>h.createElement(Ce,{...e,_chartKey:"valueAxis"});nt.propTypes={children:function(e,t,r){return d(e,t,r,st)}},nt.displayName="ChartValueAxis";const at=e=>h.createElement(fe,{...e});at.displayName="ChartXAxisItem";const it=e=>h.createElement(Ce,{...e,_chartKey:"xAxis"});it.prototype={children:function(e,t,r){return d(e,t,r,at)}},it.displayName="ChartXAxis";const ot=e=>h.createElement(fe,{...e});ot.displayName="ChartYAxisItem";const lt=e=>h.createElement(Ce,{...e,_chartKey:"yAxis"});lt.propTypes={children:function(e,t,r){return d(e,t,r,ot)}},lt.displayName="ChartYAxis";const ct=r.exact({left:r.number,top:r.number}),ht={left:r.number,right:r.number},pt={...ht,top:r.number,bottom:r.number},dt=r.oneOfType([r.number,r.exact(pt)]),ut=dt,mt=r.exact({width:r.number,color:r.string,opacity:r.number,dashType:r.string}),yt={visible:r.bool,font:r.string,color:r.string,opacity:r.number,align:r.oneOf(["left","right","center"]),position:r.oneOf(["inside","before","after"]),padding:ut,margin:r.exact(ht),border:mt,offset:ct},gt={color:r.string,opacity:r.number,offset:ct,padding:r.number,width:r.number,focusHighlight:r.exact({border:mt})},vt={colorType:r.oneOf(["static","source","target"]),color:r.string,opacity:r.number,highlight:r.exact({opacity:r.number,inactiveOpacity:r.number}),focusHighlight:r.exact({border:mt})},Ct=r.exact({text:r.string,...yt}),bt=r.exact({id:r.oneOfType([r.string,r.number]).isRequired,label:Ct.isRequired,...gt}),ft=r.exact({sourceId:r.oneOfType([r.string,r.number]).isRequired,targetId:r.oneOfType([r.string,r.number]).isRequired,value:r.number.isRequired,...vt}),xt={data:r.exact({nodes:r.arrayOf(bt.isRequired).isRequired,links:r.arrayOf(ft.isRequired).isRequired}).isRequired,links:r.exact(vt),nodes:r.exact(gt),labels:r.exact(yt),legend:r.exact({align:r.oneOf(["start","center","end"]),background:r.string,border:mt,height:r.number,labels:r.object,margin:dt,offsetX:r.number,offsetY:r.number,orientation:r.oneOf(["vertical","horizontal"]),padding:ut,position:r.oneOf(["top","bottom","left","right","custom"]),reverse:r.bool,visible:r.bool,width:r.number,item:r.object,title:r.object}),title:r.exact({align:r.oneOf(["center","left","right"]),background:r.string,border:mt,color:r.string,font:r.string,margin:dt,padding:ut,position:r.oneOf(["top","bottom"]),text:r.string,visible:r.bool}),tooltip:r.exact({visible:r.bool,offset:r.number,followPointer:r.bool,delay:r.number,linkComponent:r.any,nodeComponent:r.any}),className:r.string,style:r.object,dir:r.string,disableAutoLayout:r.bool,disableKeyboardNavigation:r.bool,onNodeEnter:r.func,onNodeLeave:r.func,onLinkEnter:r.func,onLinkLeave:r.func,onNodeClick:r.func,onLinkClick:r.func},Et="sankey.tooltipUnitFormat",St={[Et]:"({0} units)"},It=e=>{const{Content:t,dir:r,offset:s,event:{tooltipData:n,dataItem:a,nodeValue:i}}=e,o=h.useRef(null);return h.useEffect((()=>{const e=o.current;if(!n||!e)return;const t=e.offsetWidth,r=e.offsetHeight,a={...n.popupOffset},i=n.popupAlign;a.left+="left"===i.horizontal?s:-1*s,"right"===i.horizontal&&(a.left-=t),"bottom"===i.vertical?a.top-=r+s:a.top+=s,e.style.left=`${a.left}px`,e.style.top=`${a.top}px`,e.style.visibility=""}),[n]),h.createElement("div",{ref:o,style:{visibility:"hidden"},dir:r,className:"k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"},h.createElement("div",{className:"k-tooltip-content"},h.createElement(t,{dir:r,dataItem:a,nodeValue:i})))},Nt={display:"flex",alignItems:"center"},kt=e=>h.createElement("div",{style:{width:15,height:15,backgroundColor:e.color,display:"inline-flex",marginLeft:3}}),_t=e=>h.createElement("span",{style:{margin:"0 3px"}},e.children),wt=e=>s.useInternationalization().format(s.useLocalization().toLanguageString(Et,St[Et]),[e||0]),Tt=e=>{const{color:t,label:r}=e.dataItem;return h.createElement("div",{style:Nt,className:"k-tooltip-content"},h.createElement(kt,{color:t}),h.createElement(_t,null,r.text),h.createElement(_t,null,wt(e.nodeValue)))},At=e=>{const{source:t,target:r,value:s}=e.dataItem,n="rtl"===e.dir?l.arrowLeftIcon:l.arrowRightIcon;return h.createElement("div",{style:Nt},h.createElement(kt,{color:t.color}),h.createElement(_t,null,t.label.text),h.createElement(a.IconWrap,{icon:n,name:n.name}),h.createElement(kt,{color:r.color}),h.createElement(_t,null,r.label.text),h.createElement(_t,null,wt(s)))},Kt=12,Ot={offset:Kt,visible:!0},Lt=["nodeEnter","nodeLeave","linkEnter","linkLeave","nodeClick","linkClick"],Dt=h.forwardRef(((e,t)=>{const r=!a.validatePackage(le,{component:"Sankey"}),s=h.useRef(null),i=h.useRef(null),o=a.useRtl(s,e.dir,[e.dir,s.current]),l=h.useRef(null),{data:c,links:p,nodes:d,labels:u,title:m,legend:y,tooltip:g=Ot,disableAutoLayout:v,disableKeyboardNavigation:C}=e,b=h.useRef();b.current=e;const[f,x]=h.useState(null),E=h.useCallback((e=>{const{visible:t,offset:r=Kt,nodeComponent:s=Tt,linkComponent:n=At}={...Ot,...g};if(t){const t={event:e,offset:r,dir:o,Content:"node"===e.targetType?s:n};x(t)}}),[g,o]),S=h.useCallback((()=>{x(null)}),[]),I=h.useCallback(((e,t)=>{const r=b.current[e];if(r){const e={...t,nativeEvent:t.originalEvent,target:l.current};r.call(void 0,e)}}),[]);return h.useEffect((()=>{const e={data:c,links:p,nodes:d,labels:u,title:m,legend:y,disableAutoLayout:v,disableKeyboardNavigation:C,rtl:"rtl"===o,tooltip:{...Ot,...g}};if(i.current)i.current.setOptions(e);else if(a.canUseDOM&&s.current){const t=n.sankeyTheme(s.current);i.current=new n.Sankey(s.current,e,t),((e,t)=>{e&&(e.unbind(),Lt.forEach((r=>{t[r]&&e.bind(r,t[r])})))})(i.current,{nodeEnter:e=>{I("onNodeEnter",e)},nodeLeave:e=>{I("onNodeLeave",e)},linkEnter:e=>{I("onLinkEnter",e)},linkLeave:e=>{I("onLinkLeave",e)},nodeClick:e=>{I("onNodeClick",e)},linkClick:e=>{I("onLinkClick",e)}}),i.current.bind("tooltipShow",E),i.current.bind("tooltipHide",S)}return()=>{i.current&&(i.current.destroy(),i.current=null)}}),[c,p,d,u,m,y,v,C,o,g,S,E,I]),h.useImperativeHandle(l,(()=>({get element(){return s.current},exportVisual:e=>i.current.exportVisual(e),props:e})),[]),h.useImperativeHandle(t,(()=>l.current)),h.createElement(h.Fragment,null,h.createElement("div",{ref:s,className:e.className,style:e.style,dir:o}),f&&h.createElement(It,{...f}),r&&h.createElement(a.WatermarkOverlay,null))}));Dt.propTypes=xt,Dt.displayName="KendoReactSankey";const Rt=n.createSankeyData;e.AxisLabelClickEvent=y,e.Chart=ue,e.ChartArea=qe,e.ChartAxisDefaults=e=>h.createElement(fe,{...e,_chartKey:"axisDefaults"}),e.ChartAxisDefaultsCrosshair=Ae,e.ChartAxisDefaultsCrosshairTooltip=Ke,e.ChartAxisDefaultsLabels=Te,e.ChartAxisDefaultsTitle=we,e.ChartBreadcrumb=Ee,e.ChartCategoryAxis=We,e.ChartCategoryAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartCategoryAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartCategoryAxisItem=Be,e.ChartCategoryAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartCategoryAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartCategoryAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartCategoryAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartCategoryAxisRangeLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"rangeLabels"}),e.ChartCategoryAxisTitle=Oe,e.ChartLegend=Xe,e.ChartLegendInactiveItems=Pe,e.ChartLegendItem=De,e.ChartLegendTitle=Re,e.ChartNavigator=Ye,e.ChartNavigatorCategoryAxis=je,e.ChartNavigatorHint=e=>h.createElement(fe,{...e,_chartKey:"hint"}),e.ChartNavigatorPane=Me,e.ChartNavigatorSelect=e=>h.createElement(fe,{...e,_chartKey:"select"}),e.ChartNavigatorSeries=ze,e.ChartNavigatorSeriesItem=Ue,e.ChartNoDataOverlay=_e,e.ChartPane=$e,e.ChartPaneDefaults=Ze,e.ChartPaneDefaultsTitle=Le,e.ChartPanes=Ge,e.ChartPlotArea=e=>h.createElement(fe,{...e,_chartKey:"plotArea"}),e.ChartSeries=Qe,e.ChartSeriesDefaults=e=>h.createElement(fe,{...e,_chartKey:"seriesDefaults"}),e.ChartSeriesErrorBars=e=>h.createElement(fe,{...e,_chartKey:"errorBars"}),e.ChartSeriesExtremes=e=>h.createElement(fe,{...e,_chartKey:"extremes"}),e.ChartSeriesHighlight=e=>h.createElement(fe,{...e,_chartKey:"highlight"}),e.ChartSeriesItem=Je,e.ChartSeriesItemOutliers=e=>h.createElement(fe,{...e,_chartKey:"outliers"}),e.ChartSeriesItemTooltip=e=>h.createElement(fe,{...e,_chartKey:"tooltip"}),e.ChartSeriesLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartSeriesLabelsFrom=e=>h.createElement(fe,{...e,_chartKey:"from"}),e.ChartSeriesLabelsTo=e=>h.createElement(fe,{...e,_chartKey:"to"}),e.ChartSeriesMarkers=e=>h.createElement(fe,{...e,_chartKey:"markers"}),e.ChartSeriesNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartSeriesNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartSeriesNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartSubtitle=et,e.ChartTitle=tt,e.ChartTooltip=rt,e.ChartValueAxis=nt,e.ChartValueAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartValueAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartValueAxisItem=st,e.ChartValueAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartValueAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartValueAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartValueAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartValueAxisTitle=Fe,e.ChartXAxis=it,e.ChartXAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartXAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartXAxisItem=at,e.ChartXAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartXAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartXAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartXAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartXAxisTitle=Ve,e.ChartYAxis=lt,e.ChartYAxisCrosshair=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"crosshair"}),e.ChartYAxisCrosshairTooltip=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"tooltip"}),e.ChartYAxisItem=ot,e.ChartYAxisLabels=e=>h.createElement(fe,{visible:!0,...e,_chartKey:"labels"}),e.ChartYAxisNotes=e=>h.createElement(fe,{...e,_chartKey:"notes"}),e.ChartYAxisNotesIcon=e=>h.createElement(fe,{...e,_chartKey:"icon"}),e.ChartYAxisNotesLabel=e=>h.createElement(fe,{...e,_chartKey:"label"}),e.ChartYAxisTitle=He,e.ChartZoomable=e=>h.createElement(fe,{...e,_chartKey:"zoomable"}),e.CollectionConfigurationComponent=Ce,e.ConfigurationComponent=fe,e.CrosshairTooltip=re,e.CrosshairTooltipContainer=oe,e.DonutCenter=de,e.DragEndEvent=C,e.DragEvent=v,e.DragStartEvent=b,e.DrilldownEvent=f,e.DrilldownStateChangeEvent=xe,e.LegendItemClickEvent=E,e.LegendItemHoverEvent=x,e.NavigatorFilterEvent=S,e.NoteClickEvent=I,e.NoteHoverEvent=N,e.PlotAreaClickEvent=k,e.PlotAreaHoverEvent=_,e.RenderEvent=w,e.Sankey=Dt,e.SelectEndEvent=A,e.SelectEvent=T,e.SelectStartEvent=K,e.SeriesClickEvent=O,e.SeriesHoverEvent=L,e.SeriesTooltip=Q,e.SharedTooltipContent=W,e.Sparkline=me,e.StockChart=ge,e.TooltipPoint=B,e.TooltipPopup=G,e.ZoomEndEvent=R,e.ZoomEvent=D,e.ZoomStartEvent=P,e.createSankeyData=Rt,e.exportVisual=(e,t={})=>{if(e&&null!==e.chartInstance)return e.chartInstance.exportVisual(t)},e.findAxisByName=(e,t)=>{if(e&&null!==e.chartInstance)return e.chartInstance.findAxisByName(t)},e.findPaneByIndex=(e,t)=>{if(e&&null!==e.chartInstance)return e.chartInstance.findPaneByIndex(t)},e.findPaneByName=(e,t)=>{if(e&&null!==e.chartInstance)return e.chartInstance.findPaneByName(t)}}));
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-charts",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-charts",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1741180443,version:"10.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "
|
|
13
|
+
publishDate: 1741180443,
|
|
14
|
+
version: "10.0.0-develop.1",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-charts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-develop.1",
|
|
4
4
|
"description": "React Chart renders a wide range of high-quality data visualizations. KendoReact Charts package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
29
|
"@progress/kendo-licensing": "^1.5.0",
|
|
30
|
-
"@progress/kendo-react-common": "
|
|
31
|
-
"@progress/kendo-react-intl": "
|
|
32
|
-
"@progress/kendo-react-layout": "
|
|
33
|
-
"@progress/kendo-react-popup": "
|
|
30
|
+
"@progress/kendo-react-common": "10.0.0-develop.1",
|
|
31
|
+
"@progress/kendo-react-intl": "10.0.0-develop.1",
|
|
32
|
+
"@progress/kendo-react-layout": "10.0.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-popup": "10.0.0-develop.1",
|
|
34
34
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
35
35
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
36
36
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"package": {
|
|
59
59
|
"productName": "KendoReact",
|
|
60
60
|
"productCode": "KENDOUIREACT",
|
|
61
|
-
"publishDate":
|
|
61
|
+
"publishDate": 1741180443,
|
|
62
62
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
63
63
|
}
|
|
64
64
|
},
|
package/sankey/Sankey.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),j=require("@progress/kendo-charts"),k=require("@progress/kendo-react-common"),H=require("../package-metadata.js"),W=require("./propTypes.js"),y=require("./SankeyTooltip.js");function _(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return i.default=e,Object.freeze(i)}const t=_(x),w=12,m={offset:w,visible:!0},I=["nodeEnter","nodeLeave","linkEnter","linkLeave","nodeClick","linkClick"],K=(e,i)=>{e&&(e.unbind(),I.forEach(o=>{i[o]&&e.bind(o,i[o])}))},b=t.forwardRef((e,i)=>{const o=!k.validatePackage(H.packageMetadata,{component:"Sankey"}),r=t.useRef(null),a=t.useRef(null),u=k.useRtl(r,e.dir,[e.dir,r.current]),f=t.useRef(null),{data:g,links:v,nodes:C,labels:E,title:T,legend:L,tooltip:d=m,disableAutoLayout:R,disableKeyboardNavigation:S}=e,O=t.useRef();O.current=e;const[h,N]=t.useState(null),P=t.useCallback(l=>{const{visible:s,offset:n=w,nodeComponent:p=y.NodeTooltipContent,linkComponent:M=y.LinkTooltipContent}={...m,...d};if(s){const D={event:l,offset:n,dir:u,Content:l.targetType==="node"?p:M};N(D)}},[d,u]),q=t.useCallback(()=>{N(null)},[]),c=t.useCallback((l,s)=>{const n=O.current[l];if(n){const p={...s,nativeEvent:s.originalEvent,target:f.current};n.call(void 0,p)}},[]);return t.useEffect(()=>{const l={data:g,links:v,nodes:C,labels:E,title:T,legend:L,disableAutoLayout:R,disableKeyboardNavigation:S,rtl:u==="rtl",tooltip:{...m,...d}};if(a.current)a.current.setOptions(l);else if(k.canUseDOM&&r.current){const s=j.sankeyTheme(r.current);a.current=new j.Sankey(r.current,l,s),K(a.current,{nodeEnter:n=>{c("onNodeEnter",n)},nodeLeave:n=>{c("onNodeLeave",n)},linkEnter:n=>{c("onLinkEnter",n)},linkLeave:n=>{c("onLinkLeave",n)},nodeClick:n=>{c("onNodeClick",n)},linkClick:n=>{c("onLinkClick",n)}}),a.current.bind("tooltipShow",P),a.current.bind("tooltipHide",q)}return()=>{a.current&&(a.current.destroy(),a.current=null)}},[g,v,C,E,T,L,R,S,u,d,q,P,c]),t.useImperativeHandle(f,()=>({get element(){return r.current},exportVisual:l=>a.current.exportVisual(l),props:e}),[]),t.useImperativeHandle(i,()=>f.current),t.createElement(t.Fragment,null,t.createElement("div",{ref:r,className:e.className,style:e.style,dir:u}),h&&t.createElement(y.TooltipComponent,{...h}),o&&t.createElement(k.WatermarkOverlay,null))});b.propTypes=W.sankeyPropTypes;b.displayName="KendoReactSankey";exports.Sankey=b;
|
package/sankey/Sankey.mjs
CHANGED
|
@@ -5,108 +5,106 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { sankeyTheme as
|
|
10
|
-
import { validatePackage as D, useRtl as I, canUseDOM as K } from "@progress/kendo-react-common";
|
|
11
|
-
import { packageMetadata as
|
|
12
|
-
import { sankeyPropTypes as
|
|
13
|
-
import { TooltipComponent as
|
|
14
|
-
const
|
|
15
|
-
offset:
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { sankeyTheme as H, Sankey as W } from "@progress/kendo-charts";
|
|
10
|
+
import { validatePackage as D, useRtl as I, canUseDOM as K, WatermarkOverlay as M } from "@progress/kendo-react-common";
|
|
11
|
+
import { packageMetadata as V } from "../package-metadata.mjs";
|
|
12
|
+
import { sankeyPropTypes as A } from "./propTypes.mjs";
|
|
13
|
+
import { TooltipComponent as F, NodeTooltipContent as U, LinkTooltipContent as $ } from "./SankeyTooltip.mjs";
|
|
14
|
+
const O = 12, p = {
|
|
15
|
+
offset: O,
|
|
16
16
|
visible: !0
|
|
17
|
-
},
|
|
18
|
-
n && (n.unbind(),
|
|
19
|
-
|
|
17
|
+
}, j = ["nodeEnter", "nodeLeave", "linkEnter", "linkLeave", "nodeClick", "linkClick"], q = (n, u) => {
|
|
18
|
+
n && (n.unbind(), j.forEach((s) => {
|
|
19
|
+
u[s] && n.bind(s, u[s]);
|
|
20
20
|
}));
|
|
21
|
-
}, P =
|
|
22
|
-
D(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = n, T = t.useRef();
|
|
21
|
+
}, P = e.forwardRef((n, u) => {
|
|
22
|
+
const s = !D(V, { component: "Sankey" }), l = e.useRef(null), o = e.useRef(null), c = I(l, n.dir, [n.dir, l.current]), k = e.useRef(null), {
|
|
23
|
+
data: m,
|
|
24
|
+
links: y,
|
|
25
|
+
nodes: v,
|
|
26
|
+
labels: E,
|
|
27
|
+
title: C,
|
|
28
|
+
legend: b,
|
|
29
|
+
tooltip: d = p,
|
|
30
|
+
disableAutoLayout: g,
|
|
31
|
+
disableKeyboardNavigation: L
|
|
32
|
+
} = n, T = e.useRef();
|
|
34
33
|
T.current = n;
|
|
35
|
-
const [
|
|
36
|
-
(
|
|
34
|
+
const [R, h] = e.useState(null), N = e.useCallback(
|
|
35
|
+
(r) => {
|
|
37
36
|
const {
|
|
38
37
|
visible: a,
|
|
39
|
-
offset:
|
|
40
|
-
nodeComponent: f =
|
|
41
|
-
linkComponent:
|
|
42
|
-
} = { ...
|
|
38
|
+
offset: t = O,
|
|
39
|
+
nodeComponent: f = U,
|
|
40
|
+
linkComponent: w = $
|
|
41
|
+
} = { ...p, ...d };
|
|
43
42
|
if (a) {
|
|
44
|
-
const
|
|
45
|
-
event:
|
|
46
|
-
offset:
|
|
47
|
-
dir:
|
|
48
|
-
Content:
|
|
43
|
+
const x = {
|
|
44
|
+
event: r,
|
|
45
|
+
offset: t,
|
|
46
|
+
dir: c,
|
|
47
|
+
Content: r.targetType === "node" ? f : w
|
|
49
48
|
};
|
|
50
|
-
|
|
49
|
+
h(x);
|
|
51
50
|
}
|
|
52
51
|
},
|
|
53
|
-
[
|
|
54
|
-
),
|
|
55
|
-
|
|
56
|
-
}, []), i =
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
52
|
+
[d, c]
|
|
53
|
+
), S = e.useCallback(() => {
|
|
54
|
+
h(null);
|
|
55
|
+
}, []), i = e.useCallback((r, a) => {
|
|
56
|
+
const t = T.current[r];
|
|
57
|
+
if (t) {
|
|
59
58
|
const f = {
|
|
60
59
|
...a,
|
|
61
60
|
nativeEvent: a.originalEvent,
|
|
62
|
-
target:
|
|
61
|
+
target: k.current
|
|
63
62
|
};
|
|
64
|
-
|
|
63
|
+
t.call(void 0, f);
|
|
65
64
|
}
|
|
66
65
|
}, []);
|
|
67
|
-
return
|
|
68
|
-
const
|
|
69
|
-
data:
|
|
70
|
-
links:
|
|
71
|
-
nodes:
|
|
72
|
-
labels:
|
|
73
|
-
title:
|
|
74
|
-
legend:
|
|
75
|
-
disableAutoLayout:
|
|
76
|
-
disableKeyboardNavigation:
|
|
77
|
-
rtl:
|
|
78
|
-
tooltip: { ...
|
|
66
|
+
return e.useEffect(() => {
|
|
67
|
+
const r = {
|
|
68
|
+
data: m,
|
|
69
|
+
links: y,
|
|
70
|
+
nodes: v,
|
|
71
|
+
labels: E,
|
|
72
|
+
title: C,
|
|
73
|
+
legend: b,
|
|
74
|
+
disableAutoLayout: g,
|
|
75
|
+
disableKeyboardNavigation: L,
|
|
76
|
+
rtl: c === "rtl",
|
|
77
|
+
tooltip: { ...p, ...d }
|
|
79
78
|
};
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
else if (K &&
|
|
83
|
-
const a =
|
|
84
|
-
|
|
85
|
-
nodeEnter: (
|
|
86
|
-
i("onNodeEnter",
|
|
79
|
+
if (o.current)
|
|
80
|
+
o.current.setOptions(r);
|
|
81
|
+
else if (K && l.current) {
|
|
82
|
+
const a = H(l.current);
|
|
83
|
+
o.current = new W(l.current, r, a), q(o.current, {
|
|
84
|
+
nodeEnter: (t) => {
|
|
85
|
+
i("onNodeEnter", t);
|
|
87
86
|
},
|
|
88
|
-
nodeLeave: (
|
|
89
|
-
i("onNodeLeave",
|
|
87
|
+
nodeLeave: (t) => {
|
|
88
|
+
i("onNodeLeave", t);
|
|
90
89
|
},
|
|
91
|
-
linkEnter: (
|
|
92
|
-
i("onLinkEnter",
|
|
90
|
+
linkEnter: (t) => {
|
|
91
|
+
i("onLinkEnter", t);
|
|
93
92
|
},
|
|
94
|
-
linkLeave: (
|
|
95
|
-
i("onLinkLeave",
|
|
93
|
+
linkLeave: (t) => {
|
|
94
|
+
i("onLinkLeave", t);
|
|
96
95
|
},
|
|
97
|
-
nodeClick: (
|
|
98
|
-
i("onNodeClick",
|
|
96
|
+
nodeClick: (t) => {
|
|
97
|
+
i("onNodeClick", t);
|
|
99
98
|
},
|
|
100
|
-
linkClick: (
|
|
101
|
-
i("onLinkClick",
|
|
99
|
+
linkClick: (t) => {
|
|
100
|
+
i("onLinkClick", t);
|
|
102
101
|
}
|
|
103
|
-
}),
|
|
102
|
+
}), o.current.bind("tooltipShow", N), o.current.bind("tooltipHide", S);
|
|
104
103
|
}
|
|
105
104
|
return () => {
|
|
106
|
-
|
|
105
|
+
o.current && (o.current.destroy(), o.current = null);
|
|
107
106
|
};
|
|
108
107
|
}, [
|
|
109
|
-
p,
|
|
110
108
|
m,
|
|
111
109
|
y,
|
|
112
110
|
v,
|
|
@@ -114,24 +112,25 @@ const S = 12, k = {
|
|
|
114
112
|
C,
|
|
115
113
|
b,
|
|
116
114
|
g,
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
L,
|
|
116
|
+
c,
|
|
117
|
+
d,
|
|
118
|
+
S,
|
|
119
119
|
N,
|
|
120
|
-
h,
|
|
121
120
|
i
|
|
122
|
-
]),
|
|
123
|
-
|
|
121
|
+
]), e.useImperativeHandle(
|
|
122
|
+
k,
|
|
124
123
|
() => ({
|
|
125
124
|
get element() {
|
|
126
|
-
return
|
|
125
|
+
return l.current;
|
|
127
126
|
},
|
|
128
|
-
exportVisual: (
|
|
127
|
+
exportVisual: (r) => o.current.exportVisual(r),
|
|
129
128
|
props: n
|
|
130
129
|
}),
|
|
131
130
|
[]
|
|
132
|
-
),
|
|
131
|
+
), e.useImperativeHandle(u, () => k.current), /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { ref: l, className: n.className, style: n.style, dir: c }), R && /* @__PURE__ */ e.createElement(F, { ...R }), s && /* @__PURE__ */ e.createElement(M, null));
|
|
133
132
|
});
|
|
134
|
-
P.propTypes =
|
|
133
|
+
P.propTypes = A;
|
|
135
134
|
P.displayName = "KendoReactSankey";
|
|
136
135
|
export {
|
|
137
136
|
P as Sankey
|