chartist 1.4.0 → 2.0.0-rc.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.
Files changed (138) hide show
  1. package/README.md +45 -101
  2. package/dist/_settings.scss +1 -89
  3. package/dist/chartist.min.css +2 -0
  4. package/dist/chartist.min.js +2 -0
  5. package/dist/compat.cjs +588 -0
  6. package/dist/compat.cjs.map +1 -0
  7. package/dist/compat.d.cts +119 -0
  8. package/dist/compat.d.ts +118 -0
  9. package/dist/compat.js +567 -0
  10. package/dist/compat.js.map +1 -0
  11. package/dist/compat.min.js +2 -0
  12. package/dist/compat.min.js.map +1 -0
  13. package/dist/compat.umd.js +2 -0
  14. package/dist/compat.umd.js.map +1 -0
  15. package/dist/index.cjs +5592 -3484
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.css +749 -2
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.cts +4897 -0
  20. package/dist/index.d.ts +4896 -8
  21. package/dist/index.js +5562 -3479
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.css +2 -0
  24. package/dist/index.min.css.map +1 -0
  25. package/dist/index.min.js +2 -0
  26. package/dist/index.min.js.map +1 -0
  27. package/dist/index.scss +1 -204
  28. package/dist/index.umd.js +2 -2
  29. package/dist/index.umd.js.map +1 -1
  30. package/dist/scss/_settings.scss +125 -0
  31. package/dist/scss/index.scss +254 -0
  32. package/dist/scss/themes/accessible.scss +53 -0
  33. package/dist/themes/accessible.css +34 -0
  34. package/dist/themes/accessible.min.css +1 -0
  35. package/package.json +238 -12
  36. package/dist/axes/AutoScaleAxis.d.ts +0 -12
  37. package/dist/axes/AutoScaleAxis.d.ts.map +0 -1
  38. package/dist/axes/Axis.d.ts +0 -40
  39. package/dist/axes/Axis.d.ts.map +0 -1
  40. package/dist/axes/FixedScaleAxis.d.ts +0 -11
  41. package/dist/axes/FixedScaleAxis.d.ts.map +0 -1
  42. package/dist/axes/StepAxis.d.ts +0 -9
  43. package/dist/axes/StepAxis.d.ts.map +0 -1
  44. package/dist/axes/index.d.ts +0 -6
  45. package/dist/axes/index.d.ts.map +0 -1
  46. package/dist/axes/types.d.ts +0 -5
  47. package/dist/axes/types.d.ts.map +0 -1
  48. package/dist/charts/BarChart/BarChart.d.ts +0 -50
  49. package/dist/charts/BarChart/BarChart.d.ts.map +0 -1
  50. package/dist/charts/BarChart/BarChart.types.d.ts +0 -66
  51. package/dist/charts/BarChart/BarChart.types.d.ts.map +0 -1
  52. package/dist/charts/BarChart/index.d.ts +0 -3
  53. package/dist/charts/BarChart/index.d.ts.map +0 -1
  54. package/dist/charts/BaseChart.d.ts +0 -47
  55. package/dist/charts/BaseChart.d.ts.map +0 -1
  56. package/dist/charts/LineChart/LineChart.d.ts +0 -97
  57. package/dist/charts/LineChart/LineChart.d.ts.map +0 -1
  58. package/dist/charts/LineChart/LineChart.types.d.ts +0 -83
  59. package/dist/charts/LineChart/LineChart.types.d.ts.map +0 -1
  60. package/dist/charts/LineChart/index.d.ts +0 -3
  61. package/dist/charts/LineChart/index.d.ts.map +0 -1
  62. package/dist/charts/PieChart/PieChart.d.ts +0 -101
  63. package/dist/charts/PieChart/PieChart.d.ts.map +0 -1
  64. package/dist/charts/PieChart/PieChart.types.d.ts +0 -95
  65. package/dist/charts/PieChart/PieChart.types.d.ts.map +0 -1
  66. package/dist/charts/PieChart/index.d.ts +0 -3
  67. package/dist/charts/PieChart/index.d.ts.map +0 -1
  68. package/dist/charts/index.d.ts +0 -6
  69. package/dist/charts/index.d.ts.map +0 -1
  70. package/dist/charts/types.d.ts +0 -11
  71. package/dist/charts/types.d.ts.map +0 -1
  72. package/dist/core/constants.d.ts +0 -13
  73. package/dist/core/constants.d.ts.map +0 -1
  74. package/dist/core/creation.d.ts +0 -61
  75. package/dist/core/creation.d.ts.map +0 -1
  76. package/dist/core/data/bounds.d.ts +0 -14
  77. package/dist/core/data/bounds.d.ts.map +0 -1
  78. package/dist/core/data/data.d.ts +0 -23
  79. package/dist/core/data/data.d.ts.map +0 -1
  80. package/dist/core/data/highLow.d.ts +0 -13
  81. package/dist/core/data/highLow.d.ts.map +0 -1
  82. package/dist/core/data/index.d.ts +0 -7
  83. package/dist/core/data/index.d.ts.map +0 -1
  84. package/dist/core/data/normalize.d.ts +0 -11
  85. package/dist/core/data/normalize.d.ts.map +0 -1
  86. package/dist/core/data/segments.d.ts +0 -29
  87. package/dist/core/data/segments.d.ts.map +0 -1
  88. package/dist/core/data/serialize.d.ts +0 -12
  89. package/dist/core/data/serialize.d.ts.map +0 -1
  90. package/dist/core/index.d.ts +0 -8
  91. package/dist/core/index.d.ts.map +0 -1
  92. package/dist/core/lang.d.ts +0 -23
  93. package/dist/core/lang.d.ts.map +0 -1
  94. package/dist/core/math.d.ts +0 -42
  95. package/dist/core/math.d.ts.map +0 -1
  96. package/dist/core/optionsProvider.d.ts +0 -15
  97. package/dist/core/optionsProvider.d.ts.map +0 -1
  98. package/dist/core/types.d.ts +0 -266
  99. package/dist/core/types.d.ts.map +0 -1
  100. package/dist/event/EventEmitter.d.ts +0 -27
  101. package/dist/event/EventEmitter.d.ts.map +0 -1
  102. package/dist/event/index.d.ts +0 -2
  103. package/dist/event/index.d.ts.map +0 -1
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/interpolation/cardinal.d.ts +0 -30
  106. package/dist/interpolation/cardinal.d.ts.map +0 -1
  107. package/dist/interpolation/index.d.ts +0 -6
  108. package/dist/interpolation/index.d.ts.map +0 -1
  109. package/dist/interpolation/monotoneCubic.d.ts +0 -30
  110. package/dist/interpolation/monotoneCubic.d.ts.map +0 -1
  111. package/dist/interpolation/none.d.ts +0 -22
  112. package/dist/interpolation/none.d.ts.map +0 -1
  113. package/dist/interpolation/simple.d.ts +0 -30
  114. package/dist/interpolation/simple.d.ts.map +0 -1
  115. package/dist/interpolation/step.d.ts +0 -26
  116. package/dist/interpolation/step.d.ts.map +0 -1
  117. package/dist/svg/Svg.d.ts +0 -201
  118. package/dist/svg/Svg.d.ts.map +0 -1
  119. package/dist/svg/SvgList.d.ts +0 -31
  120. package/dist/svg/SvgList.d.ts.map +0 -1
  121. package/dist/svg/SvgPath.d.ts +0 -125
  122. package/dist/svg/SvgPath.d.ts.map +0 -1
  123. package/dist/svg/animation.d.ts +0 -37
  124. package/dist/svg/animation.d.ts.map +0 -1
  125. package/dist/svg/index.d.ts +0 -6
  126. package/dist/svg/index.d.ts.map +0 -1
  127. package/dist/svg/types.d.ts +0 -55
  128. package/dist/svg/types.d.ts.map +0 -1
  129. package/dist/utils/extend.d.ts +0 -10
  130. package/dist/utils/extend.d.ts.map +0 -1
  131. package/dist/utils/functional.d.ts +0 -31
  132. package/dist/utils/functional.d.ts.map +0 -1
  133. package/dist/utils/index.d.ts +0 -5
  134. package/dist/utils/index.d.ts.map +0 -1
  135. package/dist/utils/types.d.ts +0 -7
  136. package/dist/utils/types.d.ts.map +0 -1
  137. package/dist/utils/utils.d.ts +0 -31
  138. package/dist/utils/utils.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ import*as e from"./index.min.js";import{AutoScaleAxis as t,BarChart as n,LineChart as r,PieChart as i,StepAxis as a,Svg as o,axisUnits as s,findAll as c,getHighLow as l,isNumeric as u,normalizeData as d,safeHasProperty as f,serialMap as p}from"./index.min.js";var m=Object.defineProperty,h=(e,t)=>{let n={};for(var r in e)m(n,r,{get:e[r],enumerable:!0});return t||m(n,Symbol.toStringTag,{value:`Module`}),n};const g=e=>e;var _=/* @__PURE__ */ h({compat:()=>I,fromLegacyPlugin:()=>L});const v=[`data`,`optionsChanged`,`draw`,`created`,`animationBegin`,`animationEnd`],y=/* @__PURE__ */ new WeakMap,b=Symbol.for(`chartist.animationEmitter`),x=Symbol.for(`chartist.presetState`),S=e=>e[x],C={line:r,bar:n,pie:i};function w(e){if(Array.isArray(e))return e.map(w);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,w(t)]))}return e}const T=e=>typeof e==`function`&&typeof e.prototype?.projectValue==`function`;function E(e){let{area:t,padding:n}=e;return{x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,padding:n,width(){return this.x2-this.x1},height(){return this.y1-this.y2}}}function D(e,n,r){let i=d(n,e.reverseData,!0),o=i.series;return{axisX:T(e.axisX.type)?new e.axisX.type(s.x,o,r,e.axisX):new a(s.x,o,r,{...e.axisX,ticks:i.labels,stretch:e.fullWidth}),axisY:T(e.axisY.type)?new e.axisY.type(s.y,o,r,e.axisY):new t(s.y,o,r,{...e.axisY,high:u(e.high)?e.high:e.axisY.high,low:u(e.low)?e.low:e.axisY.low})}}function O(e){return p(e,(...e)=>e.reduce((e,t)=>({x:e.x+(f(t,`x`)?t.x:0),y:e.y+(f(t,`y`)?t.y:0)}),{x:0,y:0}))}function k(e,n,r){let i=!!e.horizontalBars,o=i?`x`:`y`,c=i?`y`:`x`,u=d(n,e.reverseData,o,!0),f=u.series,p=e.stackBars&&e.stackMode!==!0&&f.length?l([O(f)],e,o):l(f,e,o);typeof e.high==`number`&&(p.high=e.high),typeof e.low==`number`&&(p.low=e.low);let m=i?e.axisX:e.axisY,h=i?e.axisY:e.axisX,g=new(T(m.type)?m.type:t)(s[o],f,r,{...m,highLow:p,referenceValue:0}),_=T(h.type)?new h.type(s[c],f,r,h):new a(s[c],f,r,{ticks:e.distributeSeries&&e.stackBars?u.labels.slice(0,1):u.labels});return i?{axisX:g,axisY:_}:{axisX:_,axisY:g}}const A={line:D,bar:k,pie:()=>({axisX:void 0,axisY:void 0})};function j(e,t,n,r,i){let a=t.preset?.options,s=t.copy??t.preset?.data,l=E(t.layout),{axisX:u,axisY:d}=A[t.preset.kind](a,s,l),f=e=>e===`x`?u:d,p=e=>new o(e),m=t=>g(e).emit(`draw`,t),h=e=>{let t=i(e);return{element:p(t),group:p(t.parentElement)}},_=c(n,{role:`grid`}),v=c(n,{role:`label`}),y=v.filter(e=>e.ctx.kind===`axis`),b=v.filter(e=>e.ctx.kind===`pie`),x=[...new Set([..._,...y].map(e=>e.ctx.axis.dimension))];for(let e of x){let t=t=>t.ctx.axis.dimension===e,n=[...new Set([..._,...y].filter(t).map(e=>e.ctx.index))].sort((e,t)=>e-t);for(let r of n){let n=_.find(e=>t(e)&&e.ctx.index===r);if(n){let{x1:t,y1:i,x2:a,y2:o}=n.attrs;m({type:`grid`,axis:f(e),index:r,...h(n),x1:t,y1:i,x2:a,y2:o})}let i=y.find(e=>t(e)&&e.ctx.index===r);if(i){let{x:t,y:n,width:a,height:o}=i.attrs;m({type:`label`,axis:f(e),index:r,...h(i),text:i.ctx.text,x:t,y:n,width:a,height:o})}}}for(let e of c(n,{role:`gridBackground`}))m({type:`gridBackground`,...h(e)});let S=s.series??[];for(let e of c(n,{role:`series`})){let t=e.ctx.seriesIndex,n={series:S[a.reverseData?S.length-1-t:t],seriesIndex:t,axisX:u,axisY:d},r=e.children,i=r.find(e=>e.role===`slice`);if(i){let e=i.ctx;m({type:`slice`,value:e.value,totalDataSum:e.totalDataSum,index:e.index,meta:e.meta,series:e.series,...h(i),path:e.path.clone(),center:e.center,radius:e.radius,startAngle:e.startAngle,endAngle:e.endAngle,chartRect:l});let t=b.find(t=>t.ctx.index===e.index);if(t){let e=t.ctx;m({type:`label`,index:e.index,...h(t),text:e.text,chartRect:l,series:e.series,meta:e.meta,x:e.x,y:e.y})}continue}for(let e of r.filter(e=>e.role===`bar`)){let n=e.ctx;m({type:`bar`,value:n.value,index:n.valueIndex,meta:n.meta,series:n.series,seriesIndex:t,axisX:u,axisY:d,chartRect:l,...h(e),x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2})}for(let e of r.filter(e=>e.role===`point`)){let t=e.ctx;m({type:`point`,value:t.value,index:t.valueIndex,meta:t.meta,...n,...h(e),x:t.x,y:t.y,chartRect:l})}let o=[...r.filter(e=>e.role===`line`),...r.filter(e=>e.role===`area`).reverse()];for(let e of o){let r=e.ctx;m({type:e.role,values:r.values,path:r.path.clone(),chartRect:l,index:t,...n,meta:r.meta,...h(e)})}}let C=a.horizontalBars?u:d;g(e).emit(`created`,t.preset.kind===`pie`?{chartRect:l,svg:p(r),options:a}:{chartRect:l,axisX:u,axisY:d,bounds:C.bounds,svg:p(r),options:a})}function M(e){let t=y.get(e);if(t)return t;let n={instances:[]};return y.set(e,n),e.on(`resolve`,({config:t})=>(n.preset=t.preset,t.data!==n.source&&(n.copy=w(t.data),g(e).emit(`data`,{type:n.source===void 0?`initial`:`update`,data:n.copy}),n.source=t.data),{config:{...t,data:n.copy}})),e.on(`layout`,e=>{n.layout=e}),e.on(`responsive`,t=>`previousOptions`in t?g(e).emit(`optionsChanged`,{previousOptions:t.previousOptions,currentOptions:t.currentOptions}):void 0),e.on(`mount`,({scene:t,output:r,elementOf:i})=>{let a=r.svg;if(!a)throw Error(`Chartist: the compat plugin requires the DOM renderer`);n.svg=new o(a);for(let e of n.instances)e.svg=n.svg;a[b]={emit:(t,n)=>g(e).emit(t,n)},n.preset&&j(e,n,t,a,i)}),n}function N(e){return{getCurrentOptions:e,removeMediaQueryListeners:()=>void 0}}function P(e,t){let n=S(e),r={get container(){return e.container},get data(){return t.copy??n?.data},get options(){return n?.options},get svg(){return t.svg},eventEmitter:{on:(t,n)=>g(e).on(t,n),off:(t,n)=>g(e).off(t,n),emit:(t,n)=>g(e).emit(t,n)},optionsProvider:N(()=>n?.options),on(t,n){return g(e).on(t,n),r},off(t,n){return g(e).off(t,n),r},update(t,i,a){return n?n.update(t,i,a):e.update(t?{data:t}:{}),r},detach(){return n?n.detach():e.detach(),r}},i=n&&C[n.kind];return i?Object.setPrototypeOf(r,i.prototype):r}function F(e,t,n){return{name:e.name||`legacy-plugin`,provides:v,install(r){let i=M(r);if(n){i.instances.push(n);let e=n;e.optionsProvider||=N(()=>S(r)?.options)}let a=n??P(r,i);t===void 0?e(a):e(a,t)}}}const I={name:`compat`,provides:v,install:e=>void M(e),legacyPlugin:F};function L(e,t){return F(e,t)}function R(e,t){return d(e,t).series}const z={Line:r,Bar:n,Pie:i,getDataArray:R};function B(t,n=globalThis){if(n.document===void 0)return;let i=n.Chartist;if(i&&`LineChart`in i&&i.LineChart!==r){console.warn("Chartist: the global `Chartist` belongs to another copy of Chartist, so chartist/compat leaves it alone. Load Chartist once: as modules, or as the UMD build with compat.umd.js.");return}let a=i??(n.Chartist={}),o=(e,t)=>{e in a||(a[e]=t)};for(let[t,n]of Object.entries(e))o(t,n);for(let[e,n]of Object.entries(t))o(e,n);o(`plugins`,{});for(let[e,t]of Object.entries(z))o(e,t)}B(_);export{I as compat,L as fromLegacyPlugin};
2
+ //# sourceMappingURL=compat.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compat.min.js","names":["compat","core","__defProp","__exportAll","target","name","all","no_symbols","untyped","handle","compat_exports","compat","fromLegacyPlugin","LEGACY_EVENTS","states","ANIMATION_EMITTER","PRESET_STATE","presetOf","CLASSES","LineChart","BarChart","PieChart","mutableCopy","value","proto","key","entry","isLegacyAxisClass","type","chartRectOf","layout","area","lineAxes","normalized","normalizeData","data","options","series","axisUnits","chartRect","StepAxis","AutoScaleAxis","isNumeric","serialSums","serialMap","values","sum","safeHasProperty","barAxes","horizontal","valueDimension","labelDimension","highLow","getHighLow","valueOptions","labelOptions","valueAxis","labelAxis","AXES","emitDrawEvents","state","axisOf","dimension","axisX","axisY","wrap","Svg","element","draw","payload","parts","elementOf","node","grids","findAll","scene","allLabels","labels","n","sliceLabels","order","onAxis","indexes","a","b","index","grid","label","background","rawSeries","seriesIndex","common","children","slice","ctx","labelCtx","barNode","point","shapes","shape","svgElement","enable","existing","config","change","svg","output","instance","event","optionsProviderOf","getOptions","legacyChart","preset","chart","listener","override","legacyPlugin","plugin","chartObject","getDataArray","reverse","LEGACY_NAMES","installGlobal","root","add"],"sources":["../src/chart/types.ts","../src/compat/index.ts","../src/compat/global.ts","../src/compat/entry.ts"],"sourcesContent":["import type { PipelineOptions } from '../pipeline/phases';\nimport type {\n AllPhasesListener,\n PhaseListener,\n PhaseListeners,\n PhaseName\n} from '../pipeline/types';\nimport type { Renderer } from '../render/types';\nimport type { ResponsiveSet } from '../responsive/responsive';\n\n/**\n * The custom events a chart can emit, by name, with their payloads. The\n * core emits only `responsive`. A plugin that emits events of its own\n * declares them here (TypeScript merges your declaration into Chartist's),\n * so `on()`, `off()` and `emit()` check the names and payloads:\n *\n * ```ts\n * declare module 'chartist' {\n * interface ChartEvents {\n * 'legend:click': { readonly seriesIndex: number };\n * }\n * }\n * ```\n *\n * `chartist/compat` declares the 1.x events (`draw`, `created`, …).\n * @experimental\n */\nexport interface ChartEvents {\n /**\n * Responsive entries changed which overrides apply: the config before\n * and after (`chart()`), or the options before and after (presets).\n */\n responsive:\n | {\n readonly previousConfig: ChartConfig;\n readonly currentConfig: ChartConfig;\n }\n | { readonly previousOptions: unknown; readonly currentOptions: unknown };\n}\n\n/**\n * The name of a custom event: a key of {@link ChartEvents}. Plugins list\n * the names they emit in `provides`.\n */\nexport type CustomEventName = keyof ChartEvents & string;\n\n/**\n * A plugin: a name and an `install` function that registers listeners on\n * the chart. Plugins go into `plugins`, in the config of {@link chart} or\n * the options of the presets. They install in order, so with two\n * listeners on the same event, the earlier plugin's runs first.\n *\n * For options, write a function that takes them and returns the plugin, or\n * read them from the second argument of `install` and pass the plugin\n * with {@link withOptions}.\n *\n * @example\n * ```ts\n * import { barChart, type ChartPlugin } from 'chartist';\n *\n * // Bars at or above the limit get the class ct-over.\n * const threshold = (limit: number): ChartPlugin => ({\n * name: 'threshold',\n * install(chart) {\n * chart.on('compose', current => {\n * if (current.role !== 'bar') {\n * return;\n * }\n * const { value } = current.ctx;\n * const y =\n * typeof value === 'number'\n * ? value\n * : value && 'y' in value\n * ? value.y\n * : undefined;\n * return y !== undefined && y >= limit\n * ? current.addClass('ct-over')\n * : undefined;\n * });\n * }\n * });\n *\n * barChart('#chart', { series: [[5, 4, 3, 7]] }, { plugins: [threshold(5)] });\n * ```\n * @experimental\n */\nexport interface ChartPlugin<TOptions = unknown> {\n /** Names the plugin. Prefix your custom events with it to keep them apart. */\n readonly name: string;\n /**\n * The custom events this plugin emits with `chart.emit()`, each declared\n * in {@link ChartEvents}. They're known before any plugin installs, so\n * another plugin may listen to them.\n */\n readonly provides?: readonly CustomEventName[];\n /**\n * Sets the plugin up: runs once, before the first render, with the\n * chart's handle. Listeners registered here stay for every later render,\n * after updates and resizes too, and `off(name)` without a listener\n * leaves them alone: remove one with its reference.\n * @param chart The chart's handle, to listen to events and emit them.\n * @param options The options of a `[plugin, options]` entry, if any.\n */\n install(chart: ChartHandle, options?: TOptions): void;\n}\n\n/**\n * A plugin paired with its options, as {@link withOptions} creates it.\n * `install` receives the options as its second argument.\n */\nexport type PluginWithOptions<TOptions = unknown> = readonly [\n ChartPlugin<TOptions>,\n TOptions\n];\n\n/**\n * An entry of a chart's `plugins`: a plugin, or a plugin with its options.\n * Prefer {@link withOptions} (it checks the options) or a function that\n * returns a plugin over a bare `[plugin, options]` pair. A 1.x plugin (a\n * plain function) throws; convert it with `fromLegacyPlugin()` from\n * `chartist/compat`.\n */\nexport type PluginEntry =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ChartPlugin<any> | PluginWithOptions<any>;\n\n/**\n * The config of {@link chart}: the data, the layers that draw it and the\n * axes they draw on, plus size, padding, plugins and listeners.\n *\n * Without `axes`, layers draw into the whole chart area; the pie layer\n * needs `coordinates: 'polar'`. {@link toScene} takes the same config.\n * @experimental\n */\nexport interface ChartConfig extends PipelineOptions {\n /**\n * Plugins to install before the first render, in order: plugins, or\n * plugins with their options from {@link withOptions}.\n */\n readonly plugins?: readonly PluginEntry[];\n /**\n * Phase listeners by phase name (or `'*'` for all phases). They're\n * registered before the first render, so they see it too.\n */\n readonly on?: PhaseListeners;\n /** Turns the scene into output; the DOM renderer by default. */\n readonly renderer?: Renderer;\n /**\n * Overrides that apply while their condition matches, created with\n * `responsive([...])`: entries of a media query string or a\n * `container()` condition, and a partial config. The chart renders again\n * when the matching entries change.\n */\n readonly responsive?: ResponsiveSet<ChartOverrides>;\n}\n\n/**\n * The part of a {@link ChartConfig} that responsive entries can override:\n * everything but `responsive`, `plugins`, `on` and `renderer`. The\n * matching entries merge over the config in order, shallowly.\n * @experimental\n */\nexport type ChartOverrides = Partial<\n Omit<ChartConfig, 'responsive' | 'plugins' | 'on' | 'renderer'>\n>;\n\n/**\n * The handle {@link chart} returns: update or remove the chart, and listen\n * to its events. Plugins get the same handle in `install`. The methods\n * other than `destroy` and `emit` return the handle, so calls chain.\n * @experimental\n */\nexport interface ChartHandle {\n /** The element the chart renders into (undefined in `toScene`). */\n readonly container?: Element;\n /**\n * Shallow-merges the changes into the config and renders again. Plugins\n * and listeners stay; `plugins` and `on` can't change.\n */\n update(config: Partial<Omit<ChartConfig, 'plugins' | 'on'>>): this;\n /**\n * Stops reacting to container size changes (and media queries in\n * presets). The output and the listeners stay.\n */\n detach(): this;\n /** Detaches, removes the output and clears all listeners. */\n destroy(): void;\n /**\n * Emits a custom event (declared in {@link ChartEvents}), e.g. from a\n * plugin. Phase names are reserved: emitting one throws.\n */\n emit<K extends CustomEventName>(name: K, payload: ChartEvents[K]): void;\n /**\n * Listens to a phase event, which fires on every render. Listeners of\n * `resolve` to `scene` may return a new payload to change what's drawn;\n * `compose` listeners may return `null` to drop a node.\n */\n on<K extends PhaseName>(name: K, listener: PhaseListener<K>): this;\n /** Listens to every phase event, with the phase name and its payload. */\n on(name: '*', listener: AllPhasesListener): this;\n /** Listens to a custom event, declared in {@link ChartEvents}. */\n on<K extends CustomEventName>(\n name: K,\n listener: (payload: ChartEvents[K]) => void\n ): this;\n /**\n * Removes a phase listener, whoever added it. Without a listener,\n * removes the listeners of the phase added through `on` and the\n * config's `on`; plugins keep theirs.\n */\n off<K extends PhaseName>(name: K, listener?: PhaseListener<K>): this;\n /**\n * Removes a listener of all phases, or without a listener, those added\n * through `on`.\n */\n off(name: '*', listener?: AllPhasesListener): this;\n /**\n * Removes a custom event listener, or without a listener, the event's\n * listeners added through `on`.\n */\n off<K extends CustomEventName>(\n name: K,\n listener?: (payload: ChartEvents[K]) => void\n ): this;\n}\n\n/**\n * Pairs a plugin with its options for a chart's `plugins`, and checks the\n * options against the plugin's options type. `install` receives them as\n * its second argument.\n *\n * @example\n * ```ts\n * import { lineChart, withOptions, type ChartPlugin } from 'chartist';\n *\n * const lastPoint: ChartPlugin<{ className: string }> = {\n * name: 'last-point',\n * install(chart, options) {\n * chart.on('compose', current => {\n * if (current.role !== 'series') {\n * return;\n * }\n * const last = current.children.at(-1);\n * return last && options\n * ? current.replace(last, last.addClass(options.className))\n * : undefined;\n * });\n * }\n * };\n *\n * lineChart(\n * '#chart',\n * { series: [[1, 3, 2, 5]] },\n * { plugins: [withOptions(lastPoint, { className: 'ct-last' })] }\n * );\n * ```\n * @experimental\n */\nexport function withOptions<TOptions>(\n plugin: ChartPlugin<TOptions>,\n options: TOptions\n): PluginWithOptions<TOptions> {\n return [plugin, options];\n}\n\n/**\n * The handle without event typing, for code that routes event names it\n * doesn't know (the 1.x chart classes, compat). Internal.\n */\nexport interface UntypedEvents {\n on(name: string, listener: (payload: unknown) => void): unknown;\n off(name: string, listener?: (payload: unknown) => void): unknown;\n emit(name: string, payload?: unknown): void;\n}\n\n/** The same handle, seen without event typing. Internal. */\nexport const untyped = (handle: ChartHandle): UntypedEvents =>\n handle as unknown as UntypedEvents;\n","/**\n * The compat plugin: 1.x events, `Svg` wrappers and 1.x plugins on v2\n * charts. Opt-in: `plugins: [compat]`, or convert a 1.x plugin with\n * `fromLegacyPlugin()`.\n *\n * Imports only from the package root, so the built `chartist/compat` entry\n * shares the core with `chartist` instead of bundling a copy.\n */\nimport {\n AutoScaleAxis,\n BarChart,\n LineChart,\n PieChart,\n Svg,\n StepAxis,\n axisUnits,\n findAll,\n getHighLow,\n isNumeric,\n normalizeData,\n safeHasProperty,\n serialMap,\n type ChartHandle,\n type ChartPlugin,\n type ChartRect,\n type Data,\n type Layout,\n type PresetState,\n type NormalizedSeries,\n type AxisLabelContext,\n type PieLabelContext,\n type RoleNode,\n type SceneNode\n} from '../index';\nimport { untyped } from '../chart/types';\nimport type {\n AnimationEvent,\n AreaDrawEvent,\n AxesDrawEvent,\n BarChartCreatedEvent,\n BarDrawEvent,\n DataEvent,\n LineChartCreatedEvent,\n LineDrawEvent,\n OptionsChangedEvent,\n PieChartCreatedEvent,\n PointDrawEvent,\n SliceDrawEvent,\n SliceLabelDrawEvent\n} from '../index';\n\n// With chartist/compat, the 1.x events are typed on every chart handle.\ndeclare module '../chart/types' {\n interface ChartEvents {\n /**\n * 1.x: the chart's data, before the first render (`type: 'initial'`)\n * and after an update with new data (`type: 'update'`). Listeners can\n * change it in place. Needs the {@link compat} plugin.\n */\n data: DataEvent;\n /**\n * 1.x: the responsive options changed, with the options before and\n * after. Needs the {@link compat} plugin.\n */\n optionsChanged: OptionsChangedEvent;\n /**\n * 1.x: an element was drawn: a grid line, label, point, line, area,\n * bar or slice, with its live `element`. Check `type` to narrow it.\n * Needs the {@link compat} plugin.\n */\n draw:\n | PointDrawEvent\n | LineDrawEvent\n | AreaDrawEvent\n | BarDrawEvent\n | SliceDrawEvent\n | SliceLabelDrawEvent\n | AxesDrawEvent;\n /**\n * 1.x: the chart is drawn and in the DOM, after its `draw` events,\n * with the `svg`, the chart area and the axes. Needs the {@link compat}\n * plugin.\n */\n created:\n | LineChartCreatedEvent\n | BarChartCreatedEvent\n | PieChartCreatedEvent;\n /**\n * 1.x: an SMIL animation began, started with `animate()` on an element\n * of the chart, such as the `element` of a `draw` event. Needs the\n * {@link compat} plugin.\n */\n animationBegin: AnimationEvent;\n /**\n * 1.x: an SMIL animation ended, started with `animate()` on an element\n * of the chart. Needs the {@link compat} plugin.\n */\n animationEnd: AnimationEvent;\n }\n}\n\n/** The 1.x events the compat plugin emits. */\nconst LEGACY_EVENTS = [\n 'data',\n 'optionsChanged',\n 'draw',\n 'created',\n 'animationBegin',\n 'animationEnd'\n] as const;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype LegacyPlugin = (chart: any, options?: any) => void;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyOptions = any;\n\ninterface CompatState {\n preset?: PresetState<Data, AnyOptions>;\n /** The data object of the last `data` event, and its mutable copy. */\n source?: unknown;\n copy?: Data;\n layout?: Layout;\n svg?: Svg;\n /** 1.x chart instances whose `svg` field follows the chart's. */\n instances: { svg?: Svg }[];\n}\n\nconst states = new WeakMap<ChartHandle, CompatState>();\n\n/**\n * Where `Svg#animate()` looks for the emitter of an element's animations\n * when it gets none (on the element or an ancestor). The core reads the\n * same global symbol.\n */\nconst ANIMATION_EMITTER = Symbol.for('chartist.animationEmitter');\n\n/**\n * Where a preset's chart handle holds its preset state from the moment\n * plugins install. The core sets the same global symbol.\n */\nconst PRESET_STATE = Symbol.for('chartist.presetState');\n\nconst presetOf = (handle: ChartHandle) =>\n (handle as { [PRESET_STATE]?: PresetState<Data, AnyOptions> })[PRESET_STATE];\n\n/** The 1.x class of each preset, for 0.x and 1.x type checks in plugins. */\nconst CLASSES: Record<string, { prototype: object }> = {\n line: LineChart,\n bar: BarChart,\n pie: PieChart\n};\n\n/** Copies plain arrays and objects; other values are kept by reference. */\nfunction mutableCopy<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(mutableCopy) as T;\n }\n if (value && typeof value === 'object') {\n const proto = Object.getPrototypeOf(value);\n if (proto === Object.prototype || proto === null) {\n return Object.fromEntries(\n Object.entries(value).map(([key, entry]) => [key, mutableCopy(entry)])\n ) as T;\n }\n }\n return value;\n}\n\nconst isLegacyAxisClass = (\n type: unknown\n): type is new (...args: unknown[]) => unknown =>\n typeof type === 'function' &&\n typeof (type as { prototype?: { projectValue?: unknown } }).prototype\n ?.projectValue === 'function';\n\nfunction chartRectOf(layout: Layout): ChartRect {\n const { area, padding } = layout;\n return {\n x1: area.x1,\n x2: area.x2,\n y1: area.y1,\n y2: area.y2,\n padding,\n width() {\n return this.x2 - this.x1;\n },\n height() {\n return this.y1 - this.y2;\n }\n };\n}\n\n/** The 1.x axes, constructed as 1.x `LineChart.createChart` does. */\nfunction lineAxes(options: AnyOptions, data: Data, chartRect: ChartRect) {\n const normalized = normalizeData(\n data as Data<NormalizedSeries[]>,\n options.reverseData,\n true\n );\n const series = normalized.series as NormalizedSeries[];\n const axisX = isLegacyAxisClass(options.axisX.type)\n ? new options.axisX.type(axisUnits.x, series, chartRect, options.axisX)\n : new StepAxis(axisUnits.x, series, chartRect, {\n ...options.axisX,\n ticks: normalized.labels,\n stretch: options.fullWidth\n });\n const axisY = isLegacyAxisClass(options.axisY.type)\n ? new options.axisY.type(axisUnits.y, series, chartRect, options.axisY)\n : new AutoScaleAxis(axisUnits.y, series, chartRect, {\n ...options.axisY,\n high: isNumeric(options.high) ? options.high : options.axisY.high,\n low: isNumeric(options.low) ? options.low : options.axisY.low\n });\n return { axisX, axisY };\n}\n\n/** Sums per index across series, as 1.x `BarChart` stacks them. */\nfunction serialSums(series: NormalizedSeries[]) {\n return serialMap(series, (...values) =>\n values.reduce<{ x: number; y: number }>(\n (sum, value) => ({\n x: sum.x + (safeHasProperty(value, 'x') ? (value.x as number) : 0),\n y: sum.y + (safeHasProperty(value, 'y') ? (value.y as number) : 0)\n }),\n { x: 0, y: 0 }\n )\n );\n}\n\n/** The 1.x axes, constructed as 1.x `BarChart.createChart` does. */\nfunction barAxes(options: AnyOptions, data: Data, chartRect: ChartRect) {\n const horizontal = Boolean(options.horizontalBars);\n const valueDimension = horizontal ? 'x' : 'y';\n const labelDimension = horizontal ? 'y' : 'x';\n const normalized = normalizeData(\n data as Data<NormalizedSeries[]>,\n options.reverseData,\n valueDimension,\n true\n );\n const series = normalized.series as NormalizedSeries[];\n const highLow =\n options.stackBars && options.stackMode !== true && series.length\n ? getHighLow([serialSums(series)], options, valueDimension)\n : getHighLow(series, options, valueDimension);\n if (typeof options.high === 'number') {\n highLow.high = options.high;\n }\n if (typeof options.low === 'number') {\n highLow.low = options.low;\n }\n const valueOptions = horizontal ? options.axisX : options.axisY;\n const labelOptions = horizontal ? options.axisY : options.axisX;\n const ValueAxis = isLegacyAxisClass(valueOptions.type)\n ? valueOptions.type\n : AutoScaleAxis;\n const valueAxis = new ValueAxis(\n axisUnits[valueDimension],\n series,\n chartRect,\n {\n ...valueOptions,\n highLow,\n referenceValue: 0\n }\n );\n const labelAxis = isLegacyAxisClass(labelOptions.type)\n ? new labelOptions.type(\n axisUnits[labelDimension],\n series,\n chartRect,\n labelOptions\n )\n : new StepAxis(axisUnits[labelDimension], series, chartRect, {\n ticks:\n options.distributeSeries && options.stackBars\n ? normalized.labels.slice(0, 1)\n : normalized.labels\n });\n return horizontal\n ? { axisX: valueAxis, axisY: labelAxis }\n : { axisX: labelAxis, axisY: valueAxis };\n}\n\nconst AXES: Record<\n string,\n (\n options: AnyOptions,\n data: Data,\n chartRect: ChartRect\n ) => { axisX: unknown; axisY: unknown }\n> = {\n line: lineAxes,\n bar: barAxes,\n // Pie charts have no axes.\n pie: () => ({ axisX: undefined, axisY: undefined })\n};\n\n/** 1.x `draw` payloads in 1.x order, then `created`. */\nfunction emitDrawEvents(\n handle: ChartHandle,\n state: CompatState,\n scene: SceneNode,\n svgElement: Element,\n elementOf: (node: SceneNode) => Element | undefined\n) {\n const options = state.preset?.options as AnyOptions;\n const data = (state.copy ?? state.preset?.data) as Data;\n const chartRect = chartRectOf(state.layout!);\n const { axisX, axisY } = AXES[state.preset!.kind](options, data, chartRect);\n const axisOf = (dimension?: string) => (dimension === 'x' ? axisX : axisY);\n const wrap = (element: Element) => new Svg(element);\n const draw = (payload: Record<string, unknown>) =>\n untyped(handle).emit('draw', payload);\n const parts = (node: SceneNode) => {\n const element = elementOf(node)!;\n return { element: wrap(element), group: wrap(element.parentElement!) };\n };\n\n // Axes: per tick its grid line, then its label, in the order the axes\n // appear in the chart (X first for lines, the label axis first for bars).\n const grids = findAll(scene, { role: 'grid' });\n // Only axis labels; pie labels belong to their slice.\n const allLabels = findAll(scene, { role: 'label' });\n const labels = allLabels.filter(\n (n): n is RoleNode<'label'> & { ctx: AxisLabelContext } =>\n n.ctx.kind === 'axis'\n );\n const sliceLabels = allLabels.filter(\n (n): n is RoleNode<'label'> & { ctx: PieLabelContext } =>\n n.ctx.kind === 'pie'\n );\n const order = [\n ...new Set([...grids, ...labels].map(n => n.ctx.axis.dimension))\n ];\n for (const dimension of order) {\n const onAxis = (node: { ctx: { axis: { dimension: string } } }) =>\n node.ctx.axis.dimension === dimension;\n const indexes = [\n ...new Set([...grids, ...labels].filter(onAxis).map(n => n.ctx.index))\n ].sort((a, b) => a - b);\n for (const index of indexes) {\n const grid = grids.find(n => onAxis(n) && n.ctx.index === index);\n if (grid) {\n const { x1, y1, x2, y2 } = grid.attrs;\n draw({\n type: 'grid',\n axis: axisOf(dimension),\n index,\n ...parts(grid),\n x1,\n y1,\n x2,\n y2\n });\n }\n const label = labels.find(n => onAxis(n) && n.ctx.index === index);\n if (label) {\n const { x, y, width, height } = label.attrs;\n draw({\n type: 'label',\n axis: axisOf(dimension),\n index,\n ...parts(label),\n text: label.ctx.text,\n x,\n y,\n width,\n height\n });\n }\n }\n }\n for (const background of findAll(scene, { role: 'gridBackground' })) {\n draw({ type: 'gridBackground', ...parts(background) });\n }\n\n // Series: points, then the line, then the areas in creation order.\n const rawSeries = (data.series ?? []) as unknown[];\n for (const series of findAll(scene, { role: 'series' })) {\n const seriesIndex = series.ctx.seriesIndex;\n const original =\n rawSeries[\n options.reverseData ? rawSeries.length - 1 - seriesIndex : seriesIndex\n ];\n const common = { series: original, seriesIndex, axisX, axisY };\n const children = series.children;\n const slice = children.find(n => n.role === 'slice');\n if (slice) {\n const ctx = slice.ctx;\n draw({\n type: 'slice',\n value: ctx.value,\n totalDataSum: ctx.totalDataSum,\n index: ctx.index,\n meta: ctx.meta,\n series: ctx.series,\n ...parts(slice),\n path: ctx.path.clone(),\n center: ctx.center,\n radius: ctx.radius,\n startAngle: ctx.startAngle,\n endAngle: ctx.endAngle,\n chartRect\n });\n const label = sliceLabels.find(n => n.ctx.index === ctx.index);\n if (label) {\n const labelCtx = label.ctx;\n draw({\n type: 'label',\n index: labelCtx.index,\n ...parts(label),\n text: labelCtx.text,\n chartRect,\n series: labelCtx.series,\n meta: labelCtx.meta,\n x: labelCtx.x,\n y: labelCtx.y\n });\n }\n continue;\n }\n for (const barNode of children.filter(n => n.role === 'bar')) {\n const ctx = barNode.ctx!;\n draw({\n type: 'bar',\n value: ctx.value,\n index: ctx.valueIndex,\n meta: ctx.meta,\n series: ctx.series,\n seriesIndex,\n axisX,\n axisY,\n chartRect,\n ...parts(barNode),\n x1: ctx.x1,\n y1: ctx.y1,\n x2: ctx.x2,\n y2: ctx.y2\n });\n }\n for (const point of children.filter(n => n.role === 'point')) {\n const ctx = point.ctx!;\n draw({\n type: 'point',\n value: ctx.value,\n index: ctx.valueIndex,\n meta: ctx.meta,\n ...common,\n ...parts(point),\n x: ctx.x,\n y: ctx.y,\n chartRect\n });\n }\n const shapes = [\n ...children.filter(n => n.role === 'line'),\n // Areas are inserted first, so the DOM order is the reverse.\n ...children.filter(n => n.role === 'area').reverse()\n ];\n for (const shape of shapes) {\n const ctx = shape.ctx!;\n draw({\n type: shape.role,\n values: ctx.values,\n path: ctx.path.clone(),\n chartRect,\n index: seriesIndex,\n ...common,\n meta: ctx.meta,\n ...parts(shape)\n });\n }\n }\n\n // 0.x plugins also read `bounds`, the value axis's scale, which 0.x\n // passed next to the axes (auto scale axes only, as in 0.x).\n const valueAxis = options.horizontalBars ? axisX : axisY;\n untyped(handle).emit(\n 'created',\n state.preset!.kind === 'pie'\n ? { chartRect, svg: wrap(svgElement), options }\n : {\n chartRect,\n axisX,\n axisY,\n bounds: (valueAxis as { bounds?: unknown }).bounds,\n svg: wrap(svgElement),\n options\n }\n );\n}\n\n/** Turns the 1.x events on for a chart, once. */\nfunction enable(handle: ChartHandle): CompatState {\n const existing = states.get(handle);\n if (existing) {\n return existing;\n }\n const state: CompatState = { instances: [] };\n states.set(handle, state);\n\n handle.on('resolve', ({ config }) => {\n state.preset = config.preset as CompatState['preset'];\n if (config.data !== state.source) {\n // 1.x data handlers mutate the data; they get a copy, and the copy\n // is used from now on (as 1.x keeps its mutated data).\n state.copy = mutableCopy(config.data) as Data;\n untyped(handle).emit('data', {\n type: state.source === undefined ? 'initial' : 'update',\n data: state.copy\n });\n state.source = config.data;\n }\n return { config: { ...config, data: state.copy as typeof config.data } };\n });\n handle.on('layout', layout => {\n state.layout = layout;\n });\n handle.on('responsive', change =>\n 'previousOptions' in change\n ? untyped(handle).emit('optionsChanged', {\n previousOptions: change.previousOptions,\n currentOptions: change.currentOptions\n })\n : undefined\n );\n handle.on('mount', ({ scene, output, elementOf }) => {\n const svg = (output as { svg?: Element }).svg;\n if (!svg) {\n throw new Error('Chartist: the compat plugin requires the DOM renderer');\n }\n state.svg = new Svg(svg);\n // Set before the draw events, so listeners can query the chart.\n for (const instance of state.instances) {\n instance.svg = state.svg;\n }\n // Animations of the chart's elements emit animationBegin and\n // animationEnd on the chart, as 1.x did with the chart's emitter.\n (svg as { [ANIMATION_EMITTER]?: unknown })[ANIMATION_EMITTER] = {\n emit: (event: string, payload: unknown) =>\n untyped(handle).emit(event, payload)\n };\n if (state.preset) {\n emitDrawEvents(handle, state, scene, svg, elementOf);\n }\n });\n return state;\n}\n\n/** 1.x `optionsProvider`: the options in effect, after responsive options. */\nfunction optionsProviderOf(getOptions: () => unknown) {\n return {\n getCurrentOptions: getOptions,\n // The preset watches the media queries and stops on `detach()`.\n removeMediaQueryListeners: () => undefined\n };\n}\n\n/**\n * A 1.x-style chart object for 1.x plugins on the functional API. For a\n * preset it is an instance of the preset's 1.x class (without running its\n * constructor), so type checks such as `chart instanceof LineChart` hold;\n * for `chart()` compositions a plain object.\n */\nfunction legacyChart(handle: ChartHandle, state: CompatState) {\n const preset = presetOf(handle);\n const chart = {\n get container() {\n return handle.container;\n },\n get data() {\n return state.copy ?? preset?.data;\n },\n get options() {\n return preset?.options;\n },\n get svg() {\n return state.svg;\n },\n eventEmitter: {\n on: (event: string, listener: (payload: unknown) => void) =>\n untyped(handle).on(event, listener),\n off: (event: string, listener?: (payload: unknown) => void) =>\n untyped(handle).off(event, listener),\n emit: (event: string, payload: unknown) =>\n untyped(handle).emit(event, payload)\n },\n optionsProvider: optionsProviderOf(() => preset?.options),\n on(event: string, listener: (payload: unknown) => void) {\n untyped(handle).on(event, listener);\n return chart;\n },\n off(event: string, listener?: (payload: unknown) => void) {\n untyped(handle).off(event, listener);\n return chart;\n },\n update(data?: unknown, options?: unknown, override?: boolean) {\n if (preset) {\n preset.update(data as never, options as never, override);\n } else {\n handle.update(data ? { data: data as never } : {});\n }\n return chart;\n },\n detach() {\n if (preset) {\n preset.detach();\n } else {\n handle.detach();\n }\n return chart;\n }\n };\n // The fields above are own properties, so they shadow the class's.\n const type = preset && CLASSES[preset.kind];\n return type ? Object.setPrototypeOf(chart, type.prototype) : chart;\n}\n\n/**\n * Runs a 1.x plugin function as a v2 plugin, with the given chart object.\n * Used by the 1.x chart classes, which pass themselves.\n */\nfunction legacyPlugin(\n plugin: LegacyPlugin,\n options?: unknown,\n chart?: unknown\n): ChartPlugin {\n return {\n name: plugin.name || 'legacy-plugin',\n provides: LEGACY_EVENTS,\n install(handle) {\n const state = enable(handle);\n if (chart) {\n // A 1.x chart instance: keep its `svg` field current, as 1.x did.\n state.instances.push(chart as { svg?: Svg });\n // The 1.x classes run on a preset and have no options provider;\n // plugins call it for the options in effect.\n const instance = chart as { optionsProvider?: unknown };\n if (!instance.optionsProvider) {\n instance.optionsProvider = optionsProviderOf(\n () => presetOf(handle)?.options\n );\n }\n }\n const chartObject = chart ?? legacyChart(handle, state);\n // As 1.x: plugins without options are called with the chart only.\n if (options === undefined) {\n plugin(chartObject);\n } else {\n plugin(chartObject, options);\n }\n }\n };\n}\n\n/**\n * The compat plugin. Restores the 1.x events (`data`, `optionsChanged`,\n * `draw`, `created`, `animationBegin`, `animationEnd`) with 1.x payloads.\n * With it, the 1.x chart classes also run 1.x plugin functions.\n *\n * Add it to `plugins`, of a 1.x class, a preset or `chart()`. The `draw`\n * events come in the 1.x order, right after the chart is in the DOM, so\n * `element` is a live element; then `created`. Animations started with\n * `animate()` on the chart's elements emit `animationBegin` and\n * `animationEnd`. Importing\n * `chartist/compat` also types the 1.x events on every chart handle. It\n * needs the DOM renderer, and the `draw` and `created` events need a\n * chart made by a preset or a 1.x class.\n *\n * @example\n * ```ts\n * import { lineChart } from 'chartist';\n * import { compat } from 'chartist/compat';\n *\n * const chart = lineChart(\n * '#chart',\n * {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [[12, 9, 7, 8, 5]]\n * },\n * { plugins: [compat] }\n * );\n *\n * // Registered after the first render, so it runs from the next one on.\n * chart.on('draw', data => {\n * if (data.type === 'point' && data.index === 4) {\n * data.element.addClass('is-friday');\n * }\n * });\n * ```\n */\nexport const compat: ChartPlugin & { legacyPlugin: typeof legacyPlugin } = {\n name: 'compat',\n provides: LEGACY_EVENTS,\n install: handle => void enable(handle),\n legacyPlugin\n};\n\n/**\n * Converts a 1.x plugin function into a v2 plugin for `chart()` and the\n * preset functions. It turns the 1.x events on for the chart and calls the\n * plugin with a 1.x-style chart object (`container`, `data`, `options`,\n * `svg`, `eventEmitter`, `on`, `off`, `update`, `detach`). You don't need\n * {@link compat} in the list as well.\n *\n * @param plugin The 1.x plugin: a function that gets the chart (and its\n * options)\n * @param options The plugin's options; without them, the plugin is called\n * with the chart only, as in 1.x\n * @example\n * ```ts\n * import { lineChart, type Plugin } from 'chartist';\n * import { fromLegacyPlugin } from 'chartist/compat';\n *\n * // A 1.x plugin: a function that gets the chart and its options.\n * const caption: Plugin = (chart, options) => {\n * chart.on('created', () => {\n * chart.container.setAttribute('aria-label', options.text);\n * });\n * };\n *\n * lineChart(\n * '#chart',\n * { series: [[1, 3, 2, 4]] },\n * { plugins: [fromLegacyPlugin(caption, { text: 'Visitors per week' })] }\n * );\n * ```\n */\nexport function fromLegacyPlugin(\n plugin: LegacyPlugin,\n options?: unknown\n): ChartPlugin {\n return legacyPlugin(plugin, options);\n}\n","/**\n * The global `Chartist` that plugin scripts of the 0.x and 1.x era read.\n * They register on `Chartist.plugins`, check the chart type with\n * `instanceof Chartist.Line`, and call helpers such as `Chartist.extend`.\n * Importing `chartist/compat` (any build: module, CommonJS or the UMD\n * script) sets this up, so such a script works when it loads after it.\n *\n * The names are added to the global only, never exported: the module\n * builds keep the 1.x and v2 names.\n */\nimport * as core from '../index';\nimport {\n BarChart,\n LineChart,\n PieChart,\n normalizeData,\n type Data\n} from '../index';\n\n/**\n * 0.x: the values of each series as plain numbers (`undefined` for holes),\n * normalized as the 1.x charts do; reversed when `reverse` is true. Line\n * and bar data give an array per series, pie data one array.\n */\nexport function getDataArray(\n data: Data,\n reverse?: boolean\n): (number | undefined)[] | (number | undefined)[][] {\n return normalizeData(data as Data<never>, reverse).series as\n | (number | undefined)[]\n | (number | undefined)[][];\n}\n\n/** The 0.x names plugin scripts use, next to the library's own. */\nconst LEGACY_NAMES = {\n // 0.x names of the chart classes, for `chart instanceof Chartist.Line`.\n Line: LineChart,\n Bar: BarChart,\n Pie: PieChart,\n getDataArray\n};\n\ntype Root = { Chartist?: Record<string, unknown>; document?: unknown };\n\n/**\n * Adds the core, compat and the 0.x names to the global `Chartist`, only\n * what it lacks: a global set by the UMD build or by plugin scripts keeps\n * its values, and `plugins` keeps what scripts registered. If the global\n * belongs to another copy of Chartist (say the UMD build next to these\n * modules), it is left alone with a warning: mixing two copies breaks the\n * plugins' type checks. Outside a browser it does nothing.\n */\nexport function installGlobal(\n compat: Record<string, unknown>,\n root: Root = globalThis as Root\n): void {\n if (root.document === undefined) {\n return;\n }\n const existing = root.Chartist;\n if (existing && 'LineChart' in existing && existing.LineChart !== LineChart) {\n // A hint for developers, as the warnings for 1.x events without compat.\n // eslint-disable-next-line no-console\n console.warn(\n 'Chartist: the global `Chartist` belongs to another copy of Chartist, so chartist/compat leaves it alone. Load Chartist once: as modules, or as the UMD build with compat.umd.js.'\n );\n return;\n }\n const target = existing ?? (root.Chartist = {});\n const add = (name: string, value: unknown) => {\n if (!(name in target)) {\n target[name] = value;\n }\n };\n for (const [name, value] of Object.entries(core)) {\n add(name, value);\n }\n for (const [name, value] of Object.entries(compat)) {\n add(name, value);\n }\n add('plugins', {});\n for (const [name, value] of Object.entries(LEGACY_NAMES)) {\n add(name, value);\n }\n}\n","/**\n * The published entry of `chartist/compat`, in every build. Next to the\n * compat API, importing it sets up the global `Chartist` for plugin\n * scripts of the 0.x and 1.x era (see ./global.ts). That's why\n * package.json lists the compat files under `sideEffects`.\n */\nimport * as compat from './index';\nimport { installGlobal } from './global';\n\nexport * from './index';\n\ninstallGlobal(compat);\n"],"mappings":"wZAoRA,MAAaQ,EAAW,GACtBC,iEC/KF,MAAMI,EAAgB,CACpB,OACA,iBACA,OACA,UACA,iBACA,cACF,EAkBMC,kBAAS,IAAI,QAObC,EAAoB,OAAO,IAAI,2BAA2B,EAM1DC,EAAe,OAAO,IAAI,sBAAsB,EAEhDC,EAAY,GACfR,EAA8DO,GAG3DE,EAAiD,CACrD,KAAMC,EACN,IAAKC,EACL,IAAKC,CACP,EAGA,SAASC,EAAe,EAAa,CACnC,GAAI,MAAM,QAAQC,CAAK,EACrB,OAAOA,EAAM,IAAID,CAAW,EAE9B,GAAIC,GAAS,OAAOA,GAAU,SAAU,CACtC,IAAMC,EAAQ,OAAO,eAAeD,CAAK,EACzC,GAAIC,IAAU,OAAO,WAAaA,IAAU,KAC1C,OAAO,OAAO,YACZ,OAAO,QAAQD,CAAK,CAAC,CAAC,KAAK,CAACE,EAAKC,KAAW,CAACD,EAAKH,EAAYI,CAAK,CAAC,CAAC,CACvE,CAEJ,CACA,OAAOH,CACT,CAEA,MAAMI,EACJ,GAEA,OAAOC,GAAS,YAChB,OAAQA,EAAoD,WACxD,cAAiB,WAEvB,SAASC,EAAY,EAA2B,CAC9C,GAAM,CAAE,OAAM,WAAYC,EAC1B,MAAO,CACL,GAAIC,EAAK,GAC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B,CAAI,EAC7C2H,EAAIvH,EAAMkB,CAAK,EAEjB,IAAK,GAAM,CAAClB,EAAMkB,KAAU,OAAO,QAAQZ,CAAM,EAC/CiH,EAAIvH,EAAMkB,CAAK,EAEjBqG,EAAI,UAAW,CAAC,CAAC,EACjB,IAAK,GAAM,CAACvH,EAAMkB,KAAU,OAAO,QAAQkG,CAAY,EACrDG,EAAIvH,EAAMkB,CAAK,CAEnB,CCzEAmG,EAAc1H,CAAM"}
@@ -0,0 +1,2 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("./index.umd.js")):typeof define==`function`&&define.amd?define([`exports`,`./index.umd.js`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Chartist=e.Chartist||{},e.Chartist))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e};t=((e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule||!s.call(e,`default`)?r(i,`default`,{value:e,enumerable:!0}):i,e)))(t,1);let u=e=>e;var d=/* @__PURE__ */ c({compat:()=>A,fromLegacyPlugin:()=>j});let f=[`data`,`optionsChanged`,`draw`,`created`,`animationBegin`,`animationEnd`],p=/* @__PURE__ */ new WeakMap,m=Symbol.for(`chartist.animationEmitter`),h=Symbol.for(`chartist.presetState`),g=e=>e[h],_={line:t.LineChart,bar:t.BarChart,pie:t.PieChart};function v(e){if(Array.isArray(e))return e.map(v);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,v(t)]))}return e}let y=e=>typeof e==`function`&&typeof e.prototype?.projectValue==`function`;function b(e){let{area:t,padding:n}=e;return{x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,padding:n,width(){return this.x2-this.x1},height(){return this.y1-this.y2}}}function x(e,n,r){let i=(0,t.normalizeData)(n,e.reverseData,!0),a=i.series;return{axisX:y(e.axisX.type)?new e.axisX.type(t.axisUnits.x,a,r,e.axisX):new t.StepAxis(t.axisUnits.x,a,r,{...e.axisX,ticks:i.labels,stretch:e.fullWidth}),axisY:y(e.axisY.type)?new e.axisY.type(t.axisUnits.y,a,r,e.axisY):new t.AutoScaleAxis(t.axisUnits.y,a,r,{...e.axisY,high:(0,t.isNumeric)(e.high)?e.high:e.axisY.high,low:(0,t.isNumeric)(e.low)?e.low:e.axisY.low})}}function S(e){return(0,t.serialMap)(e,(...e)=>e.reduce((e,n)=>({x:e.x+((0,t.safeHasProperty)(n,`x`)?n.x:0),y:e.y+((0,t.safeHasProperty)(n,`y`)?n.y:0)}),{x:0,y:0}))}function C(e,n,r){let i=!!e.horizontalBars,a=i?`x`:`y`,o=i?`y`:`x`,s=(0,t.normalizeData)(n,e.reverseData,a,!0),c=s.series,l=e.stackBars&&e.stackMode!==!0&&c.length?(0,t.getHighLow)([S(c)],e,a):(0,t.getHighLow)(c,e,a);typeof e.high==`number`&&(l.high=e.high),typeof e.low==`number`&&(l.low=e.low);let u=i?e.axisX:e.axisY,d=i?e.axisY:e.axisX,f=new(y(u.type)?u.type:t.AutoScaleAxis)(t.axisUnits[a],c,r,{...u,highLow:l,referenceValue:0}),p=y(d.type)?new d.type(t.axisUnits[o],c,r,d):new t.StepAxis(t.axisUnits[o],c,r,{ticks:e.distributeSeries&&e.stackBars?s.labels.slice(0,1):s.labels});return i?{axisX:f,axisY:p}:{axisX:p,axisY:f}}let w={line:x,bar:C,pie:()=>({axisX:void 0,axisY:void 0})};function T(e,n,r,i,a){let o=n.preset?.options,s=n.copy??n.preset?.data,c=b(n.layout),{axisX:l,axisY:d}=w[n.preset.kind](o,s,c),f=e=>e===`x`?l:d,p=e=>new t.Svg(e),m=t=>u(e).emit(`draw`,t),h=e=>{let t=a(e);return{element:p(t),group:p(t.parentElement)}},g=(0,t.findAll)(r,{role:`grid`}),_=(0,t.findAll)(r,{role:`label`}),v=_.filter(e=>e.ctx.kind===`axis`),y=_.filter(e=>e.ctx.kind===`pie`),x=[...new Set([...g,...v].map(e=>e.ctx.axis.dimension))];for(let e of x){let t=t=>t.ctx.axis.dimension===e,n=[...new Set([...g,...v].filter(t).map(e=>e.ctx.index))].sort((e,t)=>e-t);for(let r of n){let n=g.find(e=>t(e)&&e.ctx.index===r);if(n){let{x1:t,y1:i,x2:a,y2:o}=n.attrs;m({type:`grid`,axis:f(e),index:r,...h(n),x1:t,y1:i,x2:a,y2:o})}let i=v.find(e=>t(e)&&e.ctx.index===r);if(i){let{x:t,y:n,width:a,height:o}=i.attrs;m({type:`label`,axis:f(e),index:r,...h(i),text:i.ctx.text,x:t,y:n,width:a,height:o})}}}for(let e of(0,t.findAll)(r,{role:`gridBackground`}))m({type:`gridBackground`,...h(e)});let S=s.series??[];for(let e of(0,t.findAll)(r,{role:`series`})){let t=e.ctx.seriesIndex,n={series:S[o.reverseData?S.length-1-t:t],seriesIndex:t,axisX:l,axisY:d},r=e.children,i=r.find(e=>e.role===`slice`);if(i){let e=i.ctx;m({type:`slice`,value:e.value,totalDataSum:e.totalDataSum,index:e.index,meta:e.meta,series:e.series,...h(i),path:e.path.clone(),center:e.center,radius:e.radius,startAngle:e.startAngle,endAngle:e.endAngle,chartRect:c});let t=y.find(t=>t.ctx.index===e.index);if(t){let e=t.ctx;m({type:`label`,index:e.index,...h(t),text:e.text,chartRect:c,series:e.series,meta:e.meta,x:e.x,y:e.y})}continue}for(let e of r.filter(e=>e.role===`bar`)){let n=e.ctx;m({type:`bar`,value:n.value,index:n.valueIndex,meta:n.meta,series:n.series,seriesIndex:t,axisX:l,axisY:d,chartRect:c,...h(e),x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2})}for(let e of r.filter(e=>e.role===`point`)){let t=e.ctx;m({type:`point`,value:t.value,index:t.valueIndex,meta:t.meta,...n,...h(e),x:t.x,y:t.y,chartRect:c})}let a=[...r.filter(e=>e.role===`line`),...r.filter(e=>e.role===`area`).reverse()];for(let e of a){let r=e.ctx;m({type:e.role,values:r.values,path:r.path.clone(),chartRect:c,index:t,...n,meta:r.meta,...h(e)})}}let C=o.horizontalBars?l:d;u(e).emit(`created`,n.preset.kind===`pie`?{chartRect:c,svg:p(i),options:o}:{chartRect:c,axisX:l,axisY:d,bounds:C.bounds,svg:p(i),options:o})}function E(e){let n=p.get(e);if(n)return n;let r={instances:[]};return p.set(e,r),e.on(`resolve`,({config:t})=>(r.preset=t.preset,t.data!==r.source&&(r.copy=v(t.data),u(e).emit(`data`,{type:r.source===void 0?`initial`:`update`,data:r.copy}),r.source=t.data),{config:{...t,data:r.copy}})),e.on(`layout`,e=>{r.layout=e}),e.on(`responsive`,t=>`previousOptions`in t?u(e).emit(`optionsChanged`,{previousOptions:t.previousOptions,currentOptions:t.currentOptions}):void 0),e.on(`mount`,({scene:n,output:i,elementOf:a})=>{let o=i.svg;if(!o)throw Error(`Chartist: the compat plugin requires the DOM renderer`);r.svg=new t.Svg(o);for(let e of r.instances)e.svg=r.svg;o[m]={emit:(t,n)=>u(e).emit(t,n)},r.preset&&T(e,r,n,o,a)}),r}function D(e){return{getCurrentOptions:e,removeMediaQueryListeners:()=>void 0}}function O(e,t){let n=g(e),r={get container(){return e.container},get data(){return t.copy??n?.data},get options(){return n?.options},get svg(){return t.svg},eventEmitter:{on:(t,n)=>u(e).on(t,n),off:(t,n)=>u(e).off(t,n),emit:(t,n)=>u(e).emit(t,n)},optionsProvider:D(()=>n?.options),on(t,n){return u(e).on(t,n),r},off(t,n){return u(e).off(t,n),r},update(t,i,a){return n?n.update(t,i,a):e.update(t?{data:t}:{}),r},detach(){return n?n.detach():e.detach(),r}},i=n&&_[n.kind];return i?Object.setPrototypeOf(r,i.prototype):r}function k(e,t,n){return{name:e.name||`legacy-plugin`,provides:f,install(r){let i=E(r);if(n){i.instances.push(n);let e=n;e.optionsProvider||=D(()=>g(r)?.options)}let a=n??O(r,i);t===void 0?e(a):e(a,t)}}}let A={name:`compat`,provides:f,install:e=>void E(e),legacyPlugin:k};function j(e,t){return k(e,t)}function M(e,n){return(0,t.normalizeData)(e,n).series}let N={Line:t.LineChart,Bar:t.BarChart,Pie:t.PieChart,getDataArray:M};function P(e,n=globalThis){if(n.document===void 0)return;let r=n.Chartist;if(r&&`LineChart`in r&&r.LineChart!==t.LineChart){console.warn("Chartist: the global `Chartist` belongs to another copy of Chartist, so chartist/compat leaves it alone. Load Chartist once: as modules, or as the UMD build with compat.umd.js.");return}let i=r??(n.Chartist={}),a=(e,t)=>{e in i||(i[e]=t)};for(let[e,n]of Object.entries(t))a(e,n);for(let[t,n]of Object.entries(e))a(t,n);a(`plugins`,{});for(let[e,t]of Object.entries(N))a(e,t)}P(d),e.compat=A,e.fromLegacyPlugin=j});
2
+ //# sourceMappingURL=compat.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compat.umd.js","names":["LineChart","BarChart","PieChart","normalizeData","axisUnits","StepAxis","AutoScaleAxis","isNumeric","serialMap","safeHasProperty","getHighLow","Svg","findAll","normalizeData","LineChart","BarChart","PieChart","core","compat","factory","global","exports","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__exportAll","target","name","all","no_symbols","__copyProps","from","keys","i","n","key","to","except","k","desc","mod","isNodeMode","src_index","untyped","handle","compat_exports","compat","fromLegacyPlugin","LEGACY_EVENTS","states","ANIMATION_EMITTER","PRESET_STATE","presetOf","CLASSES","mutableCopy","value","proto","entry","isLegacyAxisClass","type","chartRectOf","layout","area","lineAxes","normalized","data","options","series","chartRect","serialSums","values","sum","barAxes","horizontal","valueDimension","labelDimension","highLow","valueOptions","labelOptions","valueAxis","labelAxis","AXES","emitDrawEvents","state","axisOf","dimension","axisX","axisY","wrap","element","draw","payload","parts","elementOf","node","grids","scene","allLabels","labels","sliceLabels","order","onAxis","indexes","a","b","index","grid","label","background","rawSeries","seriesIndex","common","children","slice","ctx","labelCtx","barNode","point","shapes","shape","svgElement","enable","existing","config","change","svg","output","instance","event","optionsProviderOf","getOptions","legacyChart","preset","chart","listener","override","legacyPlugin","plugin","chartObject","getDataArray","reverse","LEGACY_NAMES","installGlobal","root","add"],"sources":["../src/chart/types.ts","../src/compat/index.ts","../src/compat/global.ts","../src/compat/entry.ts"],"sourcesContent":["import type { PipelineOptions } from '../pipeline/phases';\nimport type {\n AllPhasesListener,\n PhaseListener,\n PhaseListeners,\n PhaseName\n} from '../pipeline/types';\nimport type { Renderer } from '../render/types';\nimport type { ResponsiveSet } from '../responsive/responsive';\n\n/**\n * The custom events a chart can emit, by name, with their payloads. The\n * core emits only `responsive`. A plugin that emits events of its own\n * declares them here (TypeScript merges your declaration into Chartist's),\n * so `on()`, `off()` and `emit()` check the names and payloads:\n *\n * ```ts\n * declare module 'chartist' {\n * interface ChartEvents {\n * 'legend:click': { readonly seriesIndex: number };\n * }\n * }\n * ```\n *\n * `chartist/compat` declares the 1.x events (`draw`, `created`, …).\n * @experimental\n */\nexport interface ChartEvents {\n /**\n * Responsive entries changed which overrides apply: the config before\n * and after (`chart()`), or the options before and after (presets).\n */\n responsive:\n | {\n readonly previousConfig: ChartConfig;\n readonly currentConfig: ChartConfig;\n }\n | { readonly previousOptions: unknown; readonly currentOptions: unknown };\n}\n\n/**\n * The name of a custom event: a key of {@link ChartEvents}. Plugins list\n * the names they emit in `provides`.\n */\nexport type CustomEventName = keyof ChartEvents & string;\n\n/**\n * A plugin: a name and an `install` function that registers listeners on\n * the chart. Plugins go into `plugins`, in the config of {@link chart} or\n * the options of the presets. They install in order, so with two\n * listeners on the same event, the earlier plugin's runs first.\n *\n * For options, write a function that takes them and returns the plugin, or\n * read them from the second argument of `install` and pass the plugin\n * with {@link withOptions}.\n *\n * @example\n * ```ts\n * import { barChart, type ChartPlugin } from 'chartist';\n *\n * // Bars at or above the limit get the class ct-over.\n * const threshold = (limit: number): ChartPlugin => ({\n * name: 'threshold',\n * install(chart) {\n * chart.on('compose', current => {\n * if (current.role !== 'bar') {\n * return;\n * }\n * const { value } = current.ctx;\n * const y =\n * typeof value === 'number'\n * ? value\n * : value && 'y' in value\n * ? value.y\n * : undefined;\n * return y !== undefined && y >= limit\n * ? current.addClass('ct-over')\n * : undefined;\n * });\n * }\n * });\n *\n * barChart('#chart', { series: [[5, 4, 3, 7]] }, { plugins: [threshold(5)] });\n * ```\n * @experimental\n */\nexport interface ChartPlugin<TOptions = unknown> {\n /** Names the plugin. Prefix your custom events with it to keep them apart. */\n readonly name: string;\n /**\n * The custom events this plugin emits with `chart.emit()`, each declared\n * in {@link ChartEvents}. They're known before any plugin installs, so\n * another plugin may listen to them.\n */\n readonly provides?: readonly CustomEventName[];\n /**\n * Sets the plugin up: runs once, before the first render, with the\n * chart's handle. Listeners registered here stay for every later render,\n * after updates and resizes too, and `off(name)` without a listener\n * leaves them alone: remove one with its reference.\n * @param chart The chart's handle, to listen to events and emit them.\n * @param options The options of a `[plugin, options]` entry, if any.\n */\n install(chart: ChartHandle, options?: TOptions): void;\n}\n\n/**\n * A plugin paired with its options, as {@link withOptions} creates it.\n * `install` receives the options as its second argument.\n */\nexport type PluginWithOptions<TOptions = unknown> = readonly [\n ChartPlugin<TOptions>,\n TOptions\n];\n\n/**\n * An entry of a chart's `plugins`: a plugin, or a plugin with its options.\n * Prefer {@link withOptions} (it checks the options) or a function that\n * returns a plugin over a bare `[plugin, options]` pair. A 1.x plugin (a\n * plain function) throws; convert it with `fromLegacyPlugin()` from\n * `chartist/compat`.\n */\nexport type PluginEntry =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ChartPlugin<any> | PluginWithOptions<any>;\n\n/**\n * The config of {@link chart}: the data, the layers that draw it and the\n * axes they draw on, plus size, padding, plugins and listeners.\n *\n * Without `axes`, layers draw into the whole chart area; the pie layer\n * needs `coordinates: 'polar'`. {@link toScene} takes the same config.\n * @experimental\n */\nexport interface ChartConfig extends PipelineOptions {\n /**\n * Plugins to install before the first render, in order: plugins, or\n * plugins with their options from {@link withOptions}.\n */\n readonly plugins?: readonly PluginEntry[];\n /**\n * Phase listeners by phase name (or `'*'` for all phases). They're\n * registered before the first render, so they see it too.\n */\n readonly on?: PhaseListeners;\n /** Turns the scene into output; the DOM renderer by default. */\n readonly renderer?: Renderer;\n /**\n * Overrides that apply while their condition matches, created with\n * `responsive([...])`: entries of a media query string or a\n * `container()` condition, and a partial config. The chart renders again\n * when the matching entries change.\n */\n readonly responsive?: ResponsiveSet<ChartOverrides>;\n}\n\n/**\n * The part of a {@link ChartConfig} that responsive entries can override:\n * everything but `responsive`, `plugins`, `on` and `renderer`. The\n * matching entries merge over the config in order, shallowly.\n * @experimental\n */\nexport type ChartOverrides = Partial<\n Omit<ChartConfig, 'responsive' | 'plugins' | 'on' | 'renderer'>\n>;\n\n/**\n * The handle {@link chart} returns: update or remove the chart, and listen\n * to its events. Plugins get the same handle in `install`. The methods\n * other than `destroy` and `emit` return the handle, so calls chain.\n * @experimental\n */\nexport interface ChartHandle {\n /** The element the chart renders into (undefined in `toScene`). */\n readonly container?: Element;\n /**\n * Shallow-merges the changes into the config and renders again. Plugins\n * and listeners stay; `plugins` and `on` can't change.\n */\n update(config: Partial<Omit<ChartConfig, 'plugins' | 'on'>>): this;\n /**\n * Stops reacting to container size changes (and media queries in\n * presets). The output and the listeners stay.\n */\n detach(): this;\n /** Detaches, removes the output and clears all listeners. */\n destroy(): void;\n /**\n * Emits a custom event (declared in {@link ChartEvents}), e.g. from a\n * plugin. Phase names are reserved: emitting one throws.\n */\n emit<K extends CustomEventName>(name: K, payload: ChartEvents[K]): void;\n /**\n * Listens to a phase event, which fires on every render. Listeners of\n * `resolve` to `scene` may return a new payload to change what's drawn;\n * `compose` listeners may return `null` to drop a node.\n */\n on<K extends PhaseName>(name: K, listener: PhaseListener<K>): this;\n /** Listens to every phase event, with the phase name and its payload. */\n on(name: '*', listener: AllPhasesListener): this;\n /** Listens to a custom event, declared in {@link ChartEvents}. */\n on<K extends CustomEventName>(\n name: K,\n listener: (payload: ChartEvents[K]) => void\n ): this;\n /**\n * Removes a phase listener, whoever added it. Without a listener,\n * removes the listeners of the phase added through `on` and the\n * config's `on`; plugins keep theirs.\n */\n off<K extends PhaseName>(name: K, listener?: PhaseListener<K>): this;\n /**\n * Removes a listener of all phases, or without a listener, those added\n * through `on`.\n */\n off(name: '*', listener?: AllPhasesListener): this;\n /**\n * Removes a custom event listener, or without a listener, the event's\n * listeners added through `on`.\n */\n off<K extends CustomEventName>(\n name: K,\n listener?: (payload: ChartEvents[K]) => void\n ): this;\n}\n\n/**\n * Pairs a plugin with its options for a chart's `plugins`, and checks the\n * options against the plugin's options type. `install` receives them as\n * its second argument.\n *\n * @example\n * ```ts\n * import { lineChart, withOptions, type ChartPlugin } from 'chartist';\n *\n * const lastPoint: ChartPlugin<{ className: string }> = {\n * name: 'last-point',\n * install(chart, options) {\n * chart.on('compose', current => {\n * if (current.role !== 'series') {\n * return;\n * }\n * const last = current.children.at(-1);\n * return last && options\n * ? current.replace(last, last.addClass(options.className))\n * : undefined;\n * });\n * }\n * };\n *\n * lineChart(\n * '#chart',\n * { series: [[1, 3, 2, 5]] },\n * { plugins: [withOptions(lastPoint, { className: 'ct-last' })] }\n * );\n * ```\n * @experimental\n */\nexport function withOptions<TOptions>(\n plugin: ChartPlugin<TOptions>,\n options: TOptions\n): PluginWithOptions<TOptions> {\n return [plugin, options];\n}\n\n/**\n * The handle without event typing, for code that routes event names it\n * doesn't know (the 1.x chart classes, compat). Internal.\n */\nexport interface UntypedEvents {\n on(name: string, listener: (payload: unknown) => void): unknown;\n off(name: string, listener?: (payload: unknown) => void): unknown;\n emit(name: string, payload?: unknown): void;\n}\n\n/** The same handle, seen without event typing. Internal. */\nexport const untyped = (handle: ChartHandle): UntypedEvents =>\n handle as unknown as UntypedEvents;\n","/**\n * The compat plugin: 1.x events, `Svg` wrappers and 1.x plugins on v2\n * charts. Opt-in: `plugins: [compat]`, or convert a 1.x plugin with\n * `fromLegacyPlugin()`.\n *\n * Imports only from the package root, so the built `chartist/compat` entry\n * shares the core with `chartist` instead of bundling a copy.\n */\nimport {\n AutoScaleAxis,\n BarChart,\n LineChart,\n PieChart,\n Svg,\n StepAxis,\n axisUnits,\n findAll,\n getHighLow,\n isNumeric,\n normalizeData,\n safeHasProperty,\n serialMap,\n type ChartHandle,\n type ChartPlugin,\n type ChartRect,\n type Data,\n type Layout,\n type PresetState,\n type NormalizedSeries,\n type AxisLabelContext,\n type PieLabelContext,\n type RoleNode,\n type SceneNode\n} from '../index';\nimport { untyped } from '../chart/types';\nimport type {\n AnimationEvent,\n AreaDrawEvent,\n AxesDrawEvent,\n BarChartCreatedEvent,\n BarDrawEvent,\n DataEvent,\n LineChartCreatedEvent,\n LineDrawEvent,\n OptionsChangedEvent,\n PieChartCreatedEvent,\n PointDrawEvent,\n SliceDrawEvent,\n SliceLabelDrawEvent\n} from '../index';\n\n// With chartist/compat, the 1.x events are typed on every chart handle.\ndeclare module '../chart/types' {\n interface ChartEvents {\n /**\n * 1.x: the chart's data, before the first render (`type: 'initial'`)\n * and after an update with new data (`type: 'update'`). Listeners can\n * change it in place. Needs the {@link compat} plugin.\n */\n data: DataEvent;\n /**\n * 1.x: the responsive options changed, with the options before and\n * after. Needs the {@link compat} plugin.\n */\n optionsChanged: OptionsChangedEvent;\n /**\n * 1.x: an element was drawn: a grid line, label, point, line, area,\n * bar or slice, with its live `element`. Check `type` to narrow it.\n * Needs the {@link compat} plugin.\n */\n draw:\n | PointDrawEvent\n | LineDrawEvent\n | AreaDrawEvent\n | BarDrawEvent\n | SliceDrawEvent\n | SliceLabelDrawEvent\n | AxesDrawEvent;\n /**\n * 1.x: the chart is drawn and in the DOM, after its `draw` events,\n * with the `svg`, the chart area and the axes. Needs the {@link compat}\n * plugin.\n */\n created:\n | LineChartCreatedEvent\n | BarChartCreatedEvent\n | PieChartCreatedEvent;\n /**\n * 1.x: an SMIL animation began, started with `animate()` on an element\n * of the chart, such as the `element` of a `draw` event. Needs the\n * {@link compat} plugin.\n */\n animationBegin: AnimationEvent;\n /**\n * 1.x: an SMIL animation ended, started with `animate()` on an element\n * of the chart. Needs the {@link compat} plugin.\n */\n animationEnd: AnimationEvent;\n }\n}\n\n/** The 1.x events the compat plugin emits. */\nconst LEGACY_EVENTS = [\n 'data',\n 'optionsChanged',\n 'draw',\n 'created',\n 'animationBegin',\n 'animationEnd'\n] as const;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype LegacyPlugin = (chart: any, options?: any) => void;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyOptions = any;\n\ninterface CompatState {\n preset?: PresetState<Data, AnyOptions>;\n /** The data object of the last `data` event, and its mutable copy. */\n source?: unknown;\n copy?: Data;\n layout?: Layout;\n svg?: Svg;\n /** 1.x chart instances whose `svg` field follows the chart's. */\n instances: { svg?: Svg }[];\n}\n\nconst states = new WeakMap<ChartHandle, CompatState>();\n\n/**\n * Where `Svg#animate()` looks for the emitter of an element's animations\n * when it gets none (on the element or an ancestor). The core reads the\n * same global symbol.\n */\nconst ANIMATION_EMITTER = Symbol.for('chartist.animationEmitter');\n\n/**\n * Where a preset's chart handle holds its preset state from the moment\n * plugins install. The core sets the same global symbol.\n */\nconst PRESET_STATE = Symbol.for('chartist.presetState');\n\nconst presetOf = (handle: ChartHandle) =>\n (handle as { [PRESET_STATE]?: PresetState<Data, AnyOptions> })[PRESET_STATE];\n\n/** The 1.x class of each preset, for 0.x and 1.x type checks in plugins. */\nconst CLASSES: Record<string, { prototype: object }> = {\n line: LineChart,\n bar: BarChart,\n pie: PieChart\n};\n\n/** Copies plain arrays and objects; other values are kept by reference. */\nfunction mutableCopy<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(mutableCopy) as T;\n }\n if (value && typeof value === 'object') {\n const proto = Object.getPrototypeOf(value);\n if (proto === Object.prototype || proto === null) {\n return Object.fromEntries(\n Object.entries(value).map(([key, entry]) => [key, mutableCopy(entry)])\n ) as T;\n }\n }\n return value;\n}\n\nconst isLegacyAxisClass = (\n type: unknown\n): type is new (...args: unknown[]) => unknown =>\n typeof type === 'function' &&\n typeof (type as { prototype?: { projectValue?: unknown } }).prototype\n ?.projectValue === 'function';\n\nfunction chartRectOf(layout: Layout): ChartRect {\n const { area, padding } = layout;\n return {\n x1: area.x1,\n x2: area.x2,\n y1: area.y1,\n y2: area.y2,\n padding,\n width() {\n return this.x2 - this.x1;\n },\n height() {\n return this.y1 - this.y2;\n }\n };\n}\n\n/** The 1.x axes, constructed as 1.x `LineChart.createChart` does. */\nfunction lineAxes(options: AnyOptions, data: Data, chartRect: ChartRect) {\n const normalized = normalizeData(\n data as Data<NormalizedSeries[]>,\n options.reverseData,\n true\n );\n const series = normalized.series as NormalizedSeries[];\n const axisX = isLegacyAxisClass(options.axisX.type)\n ? new options.axisX.type(axisUnits.x, series, chartRect, options.axisX)\n : new StepAxis(axisUnits.x, series, chartRect, {\n ...options.axisX,\n ticks: normalized.labels,\n stretch: options.fullWidth\n });\n const axisY = isLegacyAxisClass(options.axisY.type)\n ? new options.axisY.type(axisUnits.y, series, chartRect, options.axisY)\n : new AutoScaleAxis(axisUnits.y, series, chartRect, {\n ...options.axisY,\n high: isNumeric(options.high) ? options.high : options.axisY.high,\n low: isNumeric(options.low) ? options.low : options.axisY.low\n });\n return { axisX, axisY };\n}\n\n/** Sums per index across series, as 1.x `BarChart` stacks them. */\nfunction serialSums(series: NormalizedSeries[]) {\n return serialMap(series, (...values) =>\n values.reduce<{ x: number; y: number }>(\n (sum, value) => ({\n x: sum.x + (safeHasProperty(value, 'x') ? (value.x as number) : 0),\n y: sum.y + (safeHasProperty(value, 'y') ? (value.y as number) : 0)\n }),\n { x: 0, y: 0 }\n )\n );\n}\n\n/** The 1.x axes, constructed as 1.x `BarChart.createChart` does. */\nfunction barAxes(options: AnyOptions, data: Data, chartRect: ChartRect) {\n const horizontal = Boolean(options.horizontalBars);\n const valueDimension = horizontal ? 'x' : 'y';\n const labelDimension = horizontal ? 'y' : 'x';\n const normalized = normalizeData(\n data as Data<NormalizedSeries[]>,\n options.reverseData,\n valueDimension,\n true\n );\n const series = normalized.series as NormalizedSeries[];\n const highLow =\n options.stackBars && options.stackMode !== true && series.length\n ? getHighLow([serialSums(series)], options, valueDimension)\n : getHighLow(series, options, valueDimension);\n if (typeof options.high === 'number') {\n highLow.high = options.high;\n }\n if (typeof options.low === 'number') {\n highLow.low = options.low;\n }\n const valueOptions = horizontal ? options.axisX : options.axisY;\n const labelOptions = horizontal ? options.axisY : options.axisX;\n const ValueAxis = isLegacyAxisClass(valueOptions.type)\n ? valueOptions.type\n : AutoScaleAxis;\n const valueAxis = new ValueAxis(\n axisUnits[valueDimension],\n series,\n chartRect,\n {\n ...valueOptions,\n highLow,\n referenceValue: 0\n }\n );\n const labelAxis = isLegacyAxisClass(labelOptions.type)\n ? new labelOptions.type(\n axisUnits[labelDimension],\n series,\n chartRect,\n labelOptions\n )\n : new StepAxis(axisUnits[labelDimension], series, chartRect, {\n ticks:\n options.distributeSeries && options.stackBars\n ? normalized.labels.slice(0, 1)\n : normalized.labels\n });\n return horizontal\n ? { axisX: valueAxis, axisY: labelAxis }\n : { axisX: labelAxis, axisY: valueAxis };\n}\n\nconst AXES: Record<\n string,\n (\n options: AnyOptions,\n data: Data,\n chartRect: ChartRect\n ) => { axisX: unknown; axisY: unknown }\n> = {\n line: lineAxes,\n bar: barAxes,\n // Pie charts have no axes.\n pie: () => ({ axisX: undefined, axisY: undefined })\n};\n\n/** 1.x `draw` payloads in 1.x order, then `created`. */\nfunction emitDrawEvents(\n handle: ChartHandle,\n state: CompatState,\n scene: SceneNode,\n svgElement: Element,\n elementOf: (node: SceneNode) => Element | undefined\n) {\n const options = state.preset?.options as AnyOptions;\n const data = (state.copy ?? state.preset?.data) as Data;\n const chartRect = chartRectOf(state.layout!);\n const { axisX, axisY } = AXES[state.preset!.kind](options, data, chartRect);\n const axisOf = (dimension?: string) => (dimension === 'x' ? axisX : axisY);\n const wrap = (element: Element) => new Svg(element);\n const draw = (payload: Record<string, unknown>) =>\n untyped(handle).emit('draw', payload);\n const parts = (node: SceneNode) => {\n const element = elementOf(node)!;\n return { element: wrap(element), group: wrap(element.parentElement!) };\n };\n\n // Axes: per tick its grid line, then its label, in the order the axes\n // appear in the chart (X first for lines, the label axis first for bars).\n const grids = findAll(scene, { role: 'grid' });\n // Only axis labels; pie labels belong to their slice.\n const allLabels = findAll(scene, { role: 'label' });\n const labels = allLabels.filter(\n (n): n is RoleNode<'label'> & { ctx: AxisLabelContext } =>\n n.ctx.kind === 'axis'\n );\n const sliceLabels = allLabels.filter(\n (n): n is RoleNode<'label'> & { ctx: PieLabelContext } =>\n n.ctx.kind === 'pie'\n );\n const order = [\n ...new Set([...grids, ...labels].map(n => n.ctx.axis.dimension))\n ];\n for (const dimension of order) {\n const onAxis = (node: { ctx: { axis: { dimension: string } } }) =>\n node.ctx.axis.dimension === dimension;\n const indexes = [\n ...new Set([...grids, ...labels].filter(onAxis).map(n => n.ctx.index))\n ].sort((a, b) => a - b);\n for (const index of indexes) {\n const grid = grids.find(n => onAxis(n) && n.ctx.index === index);\n if (grid) {\n const { x1, y1, x2, y2 } = grid.attrs;\n draw({\n type: 'grid',\n axis: axisOf(dimension),\n index,\n ...parts(grid),\n x1,\n y1,\n x2,\n y2\n });\n }\n const label = labels.find(n => onAxis(n) && n.ctx.index === index);\n if (label) {\n const { x, y, width, height } = label.attrs;\n draw({\n type: 'label',\n axis: axisOf(dimension),\n index,\n ...parts(label),\n text: label.ctx.text,\n x,\n y,\n width,\n height\n });\n }\n }\n }\n for (const background of findAll(scene, { role: 'gridBackground' })) {\n draw({ type: 'gridBackground', ...parts(background) });\n }\n\n // Series: points, then the line, then the areas in creation order.\n const rawSeries = (data.series ?? []) as unknown[];\n for (const series of findAll(scene, { role: 'series' })) {\n const seriesIndex = series.ctx.seriesIndex;\n const original =\n rawSeries[\n options.reverseData ? rawSeries.length - 1 - seriesIndex : seriesIndex\n ];\n const common = { series: original, seriesIndex, axisX, axisY };\n const children = series.children;\n const slice = children.find(n => n.role === 'slice');\n if (slice) {\n const ctx = slice.ctx;\n draw({\n type: 'slice',\n value: ctx.value,\n totalDataSum: ctx.totalDataSum,\n index: ctx.index,\n meta: ctx.meta,\n series: ctx.series,\n ...parts(slice),\n path: ctx.path.clone(),\n center: ctx.center,\n radius: ctx.radius,\n startAngle: ctx.startAngle,\n endAngle: ctx.endAngle,\n chartRect\n });\n const label = sliceLabels.find(n => n.ctx.index === ctx.index);\n if (label) {\n const labelCtx = label.ctx;\n draw({\n type: 'label',\n index: labelCtx.index,\n ...parts(label),\n text: labelCtx.text,\n chartRect,\n series: labelCtx.series,\n meta: labelCtx.meta,\n x: labelCtx.x,\n y: labelCtx.y\n });\n }\n continue;\n }\n for (const barNode of children.filter(n => n.role === 'bar')) {\n const ctx = barNode.ctx!;\n draw({\n type: 'bar',\n value: ctx.value,\n index: ctx.valueIndex,\n meta: ctx.meta,\n series: ctx.series,\n seriesIndex,\n axisX,\n axisY,\n chartRect,\n ...parts(barNode),\n x1: ctx.x1,\n y1: ctx.y1,\n x2: ctx.x2,\n y2: ctx.y2\n });\n }\n for (const point of children.filter(n => n.role === 'point')) {\n const ctx = point.ctx!;\n draw({\n type: 'point',\n value: ctx.value,\n index: ctx.valueIndex,\n meta: ctx.meta,\n ...common,\n ...parts(point),\n x: ctx.x,\n y: ctx.y,\n chartRect\n });\n }\n const shapes = [\n ...children.filter(n => n.role === 'line'),\n // Areas are inserted first, so the DOM order is the reverse.\n ...children.filter(n => n.role === 'area').reverse()\n ];\n for (const shape of shapes) {\n const ctx = shape.ctx!;\n draw({\n type: shape.role,\n values: ctx.values,\n path: ctx.path.clone(),\n chartRect,\n index: seriesIndex,\n ...common,\n meta: ctx.meta,\n ...parts(shape)\n });\n }\n }\n\n // 0.x plugins also read `bounds`, the value axis's scale, which 0.x\n // passed next to the axes (auto scale axes only, as in 0.x).\n const valueAxis = options.horizontalBars ? axisX : axisY;\n untyped(handle).emit(\n 'created',\n state.preset!.kind === 'pie'\n ? { chartRect, svg: wrap(svgElement), options }\n : {\n chartRect,\n axisX,\n axisY,\n bounds: (valueAxis as { bounds?: unknown }).bounds,\n svg: wrap(svgElement),\n options\n }\n );\n}\n\n/** Turns the 1.x events on for a chart, once. */\nfunction enable(handle: ChartHandle): CompatState {\n const existing = states.get(handle);\n if (existing) {\n return existing;\n }\n const state: CompatState = { instances: [] };\n states.set(handle, state);\n\n handle.on('resolve', ({ config }) => {\n state.preset = config.preset as CompatState['preset'];\n if (config.data !== state.source) {\n // 1.x data handlers mutate the data; they get a copy, and the copy\n // is used from now on (as 1.x keeps its mutated data).\n state.copy = mutableCopy(config.data) as Data;\n untyped(handle).emit('data', {\n type: state.source === undefined ? 'initial' : 'update',\n data: state.copy\n });\n state.source = config.data;\n }\n return { config: { ...config, data: state.copy as typeof config.data } };\n });\n handle.on('layout', layout => {\n state.layout = layout;\n });\n handle.on('responsive', change =>\n 'previousOptions' in change\n ? untyped(handle).emit('optionsChanged', {\n previousOptions: change.previousOptions,\n currentOptions: change.currentOptions\n })\n : undefined\n );\n handle.on('mount', ({ scene, output, elementOf }) => {\n const svg = (output as { svg?: Element }).svg;\n if (!svg) {\n throw new Error('Chartist: the compat plugin requires the DOM renderer');\n }\n state.svg = new Svg(svg);\n // Set before the draw events, so listeners can query the chart.\n for (const instance of state.instances) {\n instance.svg = state.svg;\n }\n // Animations of the chart's elements emit animationBegin and\n // animationEnd on the chart, as 1.x did with the chart's emitter.\n (svg as { [ANIMATION_EMITTER]?: unknown })[ANIMATION_EMITTER] = {\n emit: (event: string, payload: unknown) =>\n untyped(handle).emit(event, payload)\n };\n if (state.preset) {\n emitDrawEvents(handle, state, scene, svg, elementOf);\n }\n });\n return state;\n}\n\n/** 1.x `optionsProvider`: the options in effect, after responsive options. */\nfunction optionsProviderOf(getOptions: () => unknown) {\n return {\n getCurrentOptions: getOptions,\n // The preset watches the media queries and stops on `detach()`.\n removeMediaQueryListeners: () => undefined\n };\n}\n\n/**\n * A 1.x-style chart object for 1.x plugins on the functional API. For a\n * preset it is an instance of the preset's 1.x class (without running its\n * constructor), so type checks such as `chart instanceof LineChart` hold;\n * for `chart()` compositions a plain object.\n */\nfunction legacyChart(handle: ChartHandle, state: CompatState) {\n const preset = presetOf(handle);\n const chart = {\n get container() {\n return handle.container;\n },\n get data() {\n return state.copy ?? preset?.data;\n },\n get options() {\n return preset?.options;\n },\n get svg() {\n return state.svg;\n },\n eventEmitter: {\n on: (event: string, listener: (payload: unknown) => void) =>\n untyped(handle).on(event, listener),\n off: (event: string, listener?: (payload: unknown) => void) =>\n untyped(handle).off(event, listener),\n emit: (event: string, payload: unknown) =>\n untyped(handle).emit(event, payload)\n },\n optionsProvider: optionsProviderOf(() => preset?.options),\n on(event: string, listener: (payload: unknown) => void) {\n untyped(handle).on(event, listener);\n return chart;\n },\n off(event: string, listener?: (payload: unknown) => void) {\n untyped(handle).off(event, listener);\n return chart;\n },\n update(data?: unknown, options?: unknown, override?: boolean) {\n if (preset) {\n preset.update(data as never, options as never, override);\n } else {\n handle.update(data ? { data: data as never } : {});\n }\n return chart;\n },\n detach() {\n if (preset) {\n preset.detach();\n } else {\n handle.detach();\n }\n return chart;\n }\n };\n // The fields above are own properties, so they shadow the class's.\n const type = preset && CLASSES[preset.kind];\n return type ? Object.setPrototypeOf(chart, type.prototype) : chart;\n}\n\n/**\n * Runs a 1.x plugin function as a v2 plugin, with the given chart object.\n * Used by the 1.x chart classes, which pass themselves.\n */\nfunction legacyPlugin(\n plugin: LegacyPlugin,\n options?: unknown,\n chart?: unknown\n): ChartPlugin {\n return {\n name: plugin.name || 'legacy-plugin',\n provides: LEGACY_EVENTS,\n install(handle) {\n const state = enable(handle);\n if (chart) {\n // A 1.x chart instance: keep its `svg` field current, as 1.x did.\n state.instances.push(chart as { svg?: Svg });\n // The 1.x classes run on a preset and have no options provider;\n // plugins call it for the options in effect.\n const instance = chart as { optionsProvider?: unknown };\n if (!instance.optionsProvider) {\n instance.optionsProvider = optionsProviderOf(\n () => presetOf(handle)?.options\n );\n }\n }\n const chartObject = chart ?? legacyChart(handle, state);\n // As 1.x: plugins without options are called with the chart only.\n if (options === undefined) {\n plugin(chartObject);\n } else {\n plugin(chartObject, options);\n }\n }\n };\n}\n\n/**\n * The compat plugin. Restores the 1.x events (`data`, `optionsChanged`,\n * `draw`, `created`, `animationBegin`, `animationEnd`) with 1.x payloads.\n * With it, the 1.x chart classes also run 1.x plugin functions.\n *\n * Add it to `plugins`, of a 1.x class, a preset or `chart()`. The `draw`\n * events come in the 1.x order, right after the chart is in the DOM, so\n * `element` is a live element; then `created`. Animations started with\n * `animate()` on the chart's elements emit `animationBegin` and\n * `animationEnd`. Importing\n * `chartist/compat` also types the 1.x events on every chart handle. It\n * needs the DOM renderer, and the `draw` and `created` events need a\n * chart made by a preset or a 1.x class.\n *\n * @example\n * ```ts\n * import { lineChart } from 'chartist';\n * import { compat } from 'chartist/compat';\n *\n * const chart = lineChart(\n * '#chart',\n * {\n * labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],\n * series: [[12, 9, 7, 8, 5]]\n * },\n * { plugins: [compat] }\n * );\n *\n * // Registered after the first render, so it runs from the next one on.\n * chart.on('draw', data => {\n * if (data.type === 'point' && data.index === 4) {\n * data.element.addClass('is-friday');\n * }\n * });\n * ```\n */\nexport const compat: ChartPlugin & { legacyPlugin: typeof legacyPlugin } = {\n name: 'compat',\n provides: LEGACY_EVENTS,\n install: handle => void enable(handle),\n legacyPlugin\n};\n\n/**\n * Converts a 1.x plugin function into a v2 plugin for `chart()` and the\n * preset functions. It turns the 1.x events on for the chart and calls the\n * plugin with a 1.x-style chart object (`container`, `data`, `options`,\n * `svg`, `eventEmitter`, `on`, `off`, `update`, `detach`). You don't need\n * {@link compat} in the list as well.\n *\n * @param plugin The 1.x plugin: a function that gets the chart (and its\n * options)\n * @param options The plugin's options; without them, the plugin is called\n * with the chart only, as in 1.x\n * @example\n * ```ts\n * import { lineChart, type Plugin } from 'chartist';\n * import { fromLegacyPlugin } from 'chartist/compat';\n *\n * // A 1.x plugin: a function that gets the chart and its options.\n * const caption: Plugin = (chart, options) => {\n * chart.on('created', () => {\n * chart.container.setAttribute('aria-label', options.text);\n * });\n * };\n *\n * lineChart(\n * '#chart',\n * { series: [[1, 3, 2, 4]] },\n * { plugins: [fromLegacyPlugin(caption, { text: 'Visitors per week' })] }\n * );\n * ```\n */\nexport function fromLegacyPlugin(\n plugin: LegacyPlugin,\n options?: unknown\n): ChartPlugin {\n return legacyPlugin(plugin, options);\n}\n","/**\n * The global `Chartist` that plugin scripts of the 0.x and 1.x era read.\n * They register on `Chartist.plugins`, check the chart type with\n * `instanceof Chartist.Line`, and call helpers such as `Chartist.extend`.\n * Importing `chartist/compat` (any build: module, CommonJS or the UMD\n * script) sets this up, so such a script works when it loads after it.\n *\n * The names are added to the global only, never exported: the module\n * builds keep the 1.x and v2 names.\n */\nimport * as core from '../index';\nimport {\n BarChart,\n LineChart,\n PieChart,\n normalizeData,\n type Data\n} from '../index';\n\n/**\n * 0.x: the values of each series as plain numbers (`undefined` for holes),\n * normalized as the 1.x charts do; reversed when `reverse` is true. Line\n * and bar data give an array per series, pie data one array.\n */\nexport function getDataArray(\n data: Data,\n reverse?: boolean\n): (number | undefined)[] | (number | undefined)[][] {\n return normalizeData(data as Data<never>, reverse).series as\n | (number | undefined)[]\n | (number | undefined)[][];\n}\n\n/** The 0.x names plugin scripts use, next to the library's own. */\nconst LEGACY_NAMES = {\n // 0.x names of the chart classes, for `chart instanceof Chartist.Line`.\n Line: LineChart,\n Bar: BarChart,\n Pie: PieChart,\n getDataArray\n};\n\ntype Root = { Chartist?: Record<string, unknown>; document?: unknown };\n\n/**\n * Adds the core, compat and the 0.x names to the global `Chartist`, only\n * what it lacks: a global set by the UMD build or by plugin scripts keeps\n * its values, and `plugins` keeps what scripts registered. If the global\n * belongs to another copy of Chartist (say the UMD build next to these\n * modules), it is left alone with a warning: mixing two copies breaks the\n * plugins' type checks. Outside a browser it does nothing.\n */\nexport function installGlobal(\n compat: Record<string, unknown>,\n root: Root = globalThis as Root\n): void {\n if (root.document === undefined) {\n return;\n }\n const existing = root.Chartist;\n if (existing && 'LineChart' in existing && existing.LineChart !== LineChart) {\n // A hint for developers, as the warnings for 1.x events without compat.\n // eslint-disable-next-line no-console\n console.warn(\n 'Chartist: the global `Chartist` belongs to another copy of Chartist, so chartist/compat leaves it alone. Load Chartist once: as modules, or as the UMD build with compat.umd.js.'\n );\n return;\n }\n const target = existing ?? (root.Chartist = {});\n const add = (name: string, value: unknown) => {\n if (!(name in target)) {\n target[name] = value;\n }\n };\n for (const [name, value] of Object.entries(core)) {\n add(name, value);\n }\n for (const [name, value] of Object.entries(compat)) {\n add(name, value);\n }\n add('plugins', {});\n for (const [name, value] of Object.entries(LEGACY_NAMES)) {\n add(name, value);\n }\n}\n","/**\n * The published entry of `chartist/compat`, in every build. Next to the\n * compat API, importing it sets up the global `Chartist` for plugin\n * scripts of the 0.x and 1.x era (see ./global.ts). That's why\n * package.json lists the compat files under `sideEffects`.\n */\nimport * as compat from './index';\nimport { installGlobal } from './global';\n\nexport * from './index';\n\ninstallGlobal(compat);\n"],"mappings":"u8BAoRA,IAAa8C,EAAW,GACtBC,iEC/KF,IAAMI,EAAgB,CACpB,OACA,iBACA,OACA,UACA,iBACA,cACF,EAkBMC,kBAAS,IAAI,QAObC,EAAoB,OAAO,IAAI,2BAA2B,EAM1DC,EAAe,OAAO,IAAI,sBAAsB,EAEhDC,EAAY,GACfR,EAA8DO,GAG3DE,EAAiD,CACrD,KAAMxD,EAAAA,UACN,IAAKC,EAAAA,SAC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