@mantine-vue/charts 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.cjs CHANGED
@@ -722,6 +722,7 @@ var BarsList = createChartComponent("BarsList", (p) => cartesianOption({
722
722
  //#region src/ChartTooltip/ChartTooltip.ts
723
723
  var ChartTooltip = (0, vue.defineComponent)({
724
724
  name: "MantineChartTooltip",
725
+ slots: Object,
725
726
  props: {
726
727
  label: null,
727
728
  payload: Array,
@@ -738,18 +739,22 @@ var ChartTooltip = (0, vue.defineComponent)({
738
739
  default: true
739
740
  }
740
741
  },
741
- setup(props) {
742
+ setup(props, { slots }) {
742
743
  const labels = (0, vue.computed)(() => Object.fromEntries((props.series ?? []).map((item) => [item.name, item.label ?? item.name])));
743
744
  return () => {
745
+ const label = props.label !== void 0 ? props.label : slots.label?.();
744
746
  const payload = props.segmentId ? props.payload?.filter((item) => item.name === props.segmentId || item.dataKey === props.segmentId) : props.payload;
745
747
  if (!payload?.length) return null;
746
748
  return (0, vue.h)("div", {
747
749
  class: "mantine-ChartTooltip-tooltip",
748
750
  "data-type": props.type
749
- }, [props.label != null ? (0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipLabel" }, [props.label]) : null, (0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipBody" }, payload.map((item) => (0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipItem" }, [(0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipItemBody" }, [props.showColor ? (0, vue.h)("span", {
751
+ }, [label != null ? (0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipLabel" }, [label]) : null, (0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipBody" }, payload.map((item) => (0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipItem" }, [(0, vue.h)("div", { class: "mantine-ChartTooltip-tooltipItemBody" }, [props.showColor ? (0, vue.h)("span", {
750
752
  class: "mantine-ChartTooltip-tooltipItemColor",
751
753
  style: { background: resolveColor(item.color) }
752
- }) : null, (0, vue.h)("span", { class: "mantine-ChartTooltip-tooltipItemName" }, labels.value[item.name ?? ""] ?? item.name)]), (0, vue.h)("span", { class: "mantine-ChartTooltip-tooltipItemData" }, `${props.valueFormatter ? props.valueFormatter(Number(item.value)) : item.value ?? ""}${props.unit ?? item.unit ?? ""}`)])))]);
754
+ }) : null, (0, vue.h)("span", { class: "mantine-ChartTooltip-tooltipItemName" }, labels.value[item.name ?? ""] ?? item.name)]), (0, vue.h)("span", { class: "mantine-ChartTooltip-tooltipItemData" }, [props.valueFormatter ? props.valueFormatter(Number(item.value)) : slots.valueFormatter?.({
755
+ value: Number(item.value),
756
+ item
757
+ }) ?? (item.value == null ? "" : String(item.value)), props.unit ?? item.unit ?? ""])])))]);
753
758
  };
754
759
  }
755
760
  });
package/cjs/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../src/internal/echarts.ts","../src/internal/component.ts","../src/internal/colors.ts","../src/internal/options.ts","../src/charts.ts","../src/ChartTooltip/ChartTooltip.ts","../src/ChartLegend/ChartLegend.ts","../src/utils/get-series-labels/get-series-labels.ts"],"sourcesContent":["import { use } from 'echarts/core'\nimport {\n BarChart as EBarChart,\n EffectScatterChart,\n FunnelChart as EFunnelChart,\n GaugeChart,\n GraphChart,\n HeatmapChart as EHeatmapChart,\n LineChart as ELineChart,\n PieChart as EPieChart,\n RadarChart as ERadarChart,\n SankeyChart as ESankeyChart,\n ScatterChart as EScatterChart,\n TreemapChart as ETreemapChart,\n} from 'echarts/charts'\nimport {\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n} from 'echarts/components'\nimport { CanvasRenderer, SVGRenderer } from 'echarts/renderers'\n\nlet registered = false\n\nexport function registerECharts(): void {\n if (registered) {\n return\n }\n\n use([\n EBarChart,\n EffectScatterChart,\n EFunnelChart,\n GaugeChart,\n GraphChart,\n EHeatmapChart,\n ELineChart,\n EPieChart,\n ERadarChart,\n ESankeyChart,\n EScatterChart,\n ETreemapChart,\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n CanvasRenderer,\n SVGRenderer,\n ])\n\n registered = true\n}\n","import { computed, defineComponent, h, ref, type Component, type PropType } from 'vue'\nimport type { EChartsOption } from 'echarts'\nimport VChart from 'vue-echarts'\nimport { registerECharts } from './echarts'\n\nregisterECharts()\n\nexport type OptionBuilder = (props: Record<string, unknown>) => EChartsOption\n\nexport function createChartComponent(name: string, buildOption: OptionBuilder): Component {\n return defineComponent({\n name: `Mantine${name}`,\n inheritAttrs: false,\n props: {\n option: Object as PropType<EChartsOption>,\n height: { type: [Number, String], default: 300 },\n width: { type: [Number, String], default: '100%' },\n loading: Boolean,\n autoresize: { type: Boolean, default: true },\n renderer: { type: String as PropType<'canvas' | 'svg'>, default: 'canvas' },\n initOptions: Object as PropType<Record<string, unknown>>,\n },\n emits: ['click', 'dblclick', 'mouseover', 'mouseout', 'legendselectchanged', 'datazoom'],\n setup(props, { attrs, emit, expose }) {\n const chart = ref<InstanceType<typeof VChart>>()\n const option = computed(() => ({ ...buildOption(attrs), ...props.option }))\n expose({\n getEchartsInstance: () => chart.value?.chart,\n resize: () => chart.value?.resize(),\n setOption: (next: EChartsOption) => chart.value?.setOption(next),\n })\n const size = (value: string | number) => (typeof value === 'number' ? `${value}px` : value)\n const rootAttributes = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(\n ([key]) =>\n ['id', 'dir', 'role', 'tabindex', 'title'].includes(key) ||\n key.startsWith('aria-') ||\n (key.startsWith('data-') && key !== 'data'),\n ),\n ),\n )\n return () =>\n h(\n 'div',\n {\n ...rootAttributes.value,\n class: ['mantine-Chart-root', `mantine-${name}-root`, attrs.class],\n style: [{ width: size(props.width), height: size(props.height) }, attrs.style],\n },\n [\n h(VChart, {\n ref: chart,\n option: option.value,\n autoresize: props.autoresize,\n loading: props.loading,\n initOptions: { ...props.initOptions, renderer: props.renderer },\n class: 'mantine-Chart-container',\n onClick: (event: unknown) => emit('click', event),\n onDblclick: (event: unknown) => emit('dblclick', event),\n onMouseover: (event: unknown) => emit('mouseover', event),\n onMouseout: (event: unknown) => emit('mouseout', event),\n onLegendselectchanged: (event: unknown) => emit('legendselectchanged', event),\n onDatazoom: (event: unknown) => emit('datazoom', event),\n }),\n ],\n )\n },\n })\n}\n","const shadeMap: Record<string, string[]> = {\n blue: [\n '#e7f5ff',\n '#d0ebff',\n '#a5d8ff',\n '#74c0fc',\n '#4dabf7',\n '#339af0',\n '#228be6',\n '#1c7ed6',\n '#1971c2',\n '#1864ab',\n ],\n cyan: [\n '#e3fafc',\n '#c5f6fa',\n '#99e9f2',\n '#66d9e8',\n '#3bc9db',\n '#22b8cf',\n '#15aabf',\n '#1098ad',\n '#0c8599',\n '#0b7285',\n ],\n green: [\n '#ebfbee',\n '#d3f9d8',\n '#b2f2bb',\n '#8ce99a',\n '#69db7c',\n '#51cf66',\n '#40c057',\n '#37b24d',\n '#2f9e44',\n '#2b8a3e',\n ],\n grape: [\n '#f8f0fc',\n '#f3d9fa',\n '#eebefa',\n '#e599f7',\n '#da77f2',\n '#cc5de8',\n '#be4bdb',\n '#ae3ec9',\n '#9c36b5',\n '#862e9c',\n ],\n gray: [\n '#f8f9fa',\n '#f1f3f5',\n '#e9ecef',\n '#dee2e6',\n '#ced4da',\n '#adb5bd',\n '#868e96',\n '#495057',\n '#343a40',\n '#212529',\n ],\n orange: [\n '#fff4e6',\n '#ffe8cc',\n '#ffd8a8',\n '#ffc078',\n '#ffa94d',\n '#ff922b',\n '#fd7e14',\n '#f76707',\n '#e8590c',\n '#d9480f',\n ],\n pink: [\n '#fff0f6',\n '#ffdeeb',\n '#fcc2d7',\n '#faa2c1',\n '#f783ac',\n '#f06595',\n '#e64980',\n '#d6336c',\n '#c2255c',\n '#a61e4d',\n ],\n red: [\n '#fff5f5',\n '#ffe3e3',\n '#ffc9c9',\n '#ffa8a8',\n '#ff8787',\n '#ff6b6b',\n '#fa5252',\n '#f03e3e',\n '#e03131',\n '#c92a2a',\n ],\n teal: [\n '#e6fcf5',\n '#c3fae8',\n '#96f2d7',\n '#63e6be',\n '#38d9a9',\n '#20c997',\n '#12b886',\n '#0ca678',\n '#099268',\n '#087f5b',\n ],\n violet: [\n '#f3f0ff',\n '#e5dbff',\n '#d0bfff',\n '#b197fc',\n '#9775fa',\n '#845ef7',\n '#7950f2',\n '#7048e8',\n '#6741d9',\n '#5f3dc4',\n ],\n yellow: [\n '#fff9db',\n '#fff3bf',\n '#ffec99',\n '#ffe066',\n '#ffd43b',\n '#fcc419',\n '#fab005',\n '#f59f00',\n '#f08c00',\n '#e67700',\n ],\n}\n\nexport function resolveColor(color: unknown, fallback = '#228be6'): string {\n if (typeof color !== 'string' || !color) return fallback\n const [name, rawShade] = color.split('.')\n const shade = Number(rawShade ?? 6)\n return shadeMap[name]?.[Number.isInteger(shade) ? shade : 6] ?? color\n}\n","import type { EChartsOption, SeriesOption } from 'echarts'\nimport type { ChartDataItem, ChartReferenceLineProps, ChartSeries } from '../types'\nimport { resolveColor } from './colors'\n\ntype Props = Record<string, unknown>\n\nconst bool = (value: unknown, fallback: boolean) => (typeof value === 'boolean' ? value : fallback)\nconst num = (value: unknown, fallback: number) => (typeof value === 'number' ? value : fallback)\nconst obj = (value: unknown) => (value && typeof value === 'object' ? value : {})\nconst list = <T>(value: unknown): T[] => (Array.isArray(value) ? (value as T[]) : [])\nconst formatter = (props: Props) =>\n typeof props.valueFormatter === 'function'\n ? (props.valueFormatter as (value: number) => string)\n : undefined\n\nfunction tooltip(props: Props): EChartsOption['tooltip'] {\n if (!bool(props.withTooltip, true)) return { show: false }\n const format = formatter(props)\n return {\n trigger: 'axis',\n transitionDuration: num(props.tooltipAnimationDuration, 0) / 1000,\n valueFormatter: format ? (value) => format(Number(value)) : undefined,\n ...obj(props.tooltipProps),\n }\n}\n\nfunction markLine(referenceLines: ChartReferenceLineProps[] | undefined) {\n if (!referenceLines?.length) return undefined\n return {\n silent: true,\n symbol: 'none',\n data: referenceLines.map((line) => ({\n xAxis: line.x,\n yAxis: line.y,\n label: typeof line.label === 'string' ? { formatter: line.label } : line.label,\n lineStyle: {\n color: resolveColor(line.color, '#868e96'),\n type: line.strokeDasharray ? 'dashed' : 'solid',\n },\n })),\n }\n}\n\nexport function cartesianOption(\n props: Props,\n kind: 'line' | 'area' | 'bar' | 'composite',\n): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<\n ChartSeries & {\n type?: string\n stackId?: string\n strokeDasharray?: string | number\n curveType?: string\n }\n >(props.series)\n const dataKey = String(props.dataKey ?? 'name')\n const horizontal = props.orientation !== 'vertical'\n const chartType = String(props.type ?? 'default')\n const category = data.map((item) => item[dataKey] as string | number)\n const commonAxis = { axisLabel: { color: resolveColor(props.textColor, '#868e96') } }\n const categoryAxis = { type: 'category' as const, data: category, ...commonAxis }\n const valueAxis = { type: 'value' as const, name: props.yAxisLabel as string, ...commonAxis }\n const mapped = series.map((item, index) => {\n const itemKind = kind === 'composite' ? (item.type ?? 'line') : kind === 'area' ? 'line' : kind\n const color = resolveColor(item.color, resolveColor(`blue.${6 + (index % 3)}`))\n const stack = chartType === 'stacked' || chartType === 'percent' ? 'stack' : item.stackId\n const base = {\n name: item.label ?? item.name,\n data: data.map((entry) => entry[item.name] as number | null),\n yAxisIndex: item.yAxisId ? 1 : 0,\n stack,\n markLine:\n index === 0\n ? markLine(props.referenceLines as ChartReferenceLineProps[] | undefined)\n : undefined,\n }\n if (itemKind === 'bar') {\n return {\n ...base,\n type: 'bar',\n barMaxWidth: props.maxBarWidth as number,\n barMinHeight: num(props.minBarSize, 0),\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n label: {\n show: bool(props.withBarValueLabel, false),\n position: horizontal ? 'top' : 'right',\n },\n }\n }\n return {\n ...base,\n type: 'line',\n smooth: !['linear', 'step', 'stepBefore', 'stepAfter'].includes(\n String(props.curveType ?? item.curveType ?? 'monotone'),\n ),\n step: String(props.curveType).startsWith('step') ? 'middle' : false,\n connectNulls: bool(props.connectNulls, true),\n showSymbol: bool(props.withDots, true),\n symbolSize: 6,\n lineStyle: {\n color,\n width: num(props.strokeWidth, 2),\n type: item.strokeDasharray ? 'dashed' : 'solid',\n },\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n areaStyle: itemKind === 'area' ? { color, opacity: num(props.fillOpacity, 0.2) } : undefined,\n label: { show: bool(props.withPointLabels, false), position: 'top' },\n }\n }) as unknown as SeriesOption[]\n\n return {\n animationDurationUpdate: num(props.tooltipAnimationDuration, 0),\n color: series.map((item) => resolveColor(item.color)),\n grid: {\n left: 48,\n right: bool(props.withRightYAxis, false) ? 48 : 16,\n top: bool(props.withLegend, false) ? 44 : 16,\n bottom: 38,\n containLabel: true,\n ...obj(props.gridProps),\n },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: tooltip(props),\n xAxis: horizontal\n ? {\n ...categoryAxis,\n show: bool(props.withXAxis, true),\n name: props.xAxisLabel as string,\n ...obj(props.xAxisProps),\n }\n : { ...valueAxis, show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: horizontal\n ? [\n { ...valueAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n {\n ...valueAxis,\n show: bool(props.withRightYAxis, false),\n position: 'right',\n name: props.rightYAxisLabel as string,\n ...obj(props.rightYAxisProps),\n },\n ]\n : { ...categoryAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: mapped,\n }\n}\n\nexport function radialOption(props: Props, donut = false): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n color: data.map((item) => resolveColor(item.color)),\n legend: {\n show: bool(props.withLabels, false) || bool(props.withLegend, false),\n ...obj(props.legendProps),\n },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n series: [\n {\n type: 'pie',\n radius: donut ? [`${num(props.thickness, 40)}%`, '75%'] : ['0%', '75%'],\n startAngle: num(props.startAngle, 90),\n minAngle: num(props.minAngle, 0),\n padAngle: num(props.paddingAngle, 0),\n roseType:\n props.type === 'pie'\n ? undefined\n : props.type === 'donut'\n ? undefined\n : (props.type as 'radius' | 'area'),\n label: {\n show: bool(props.withLabels, false),\n formatter: props.withLabelsLine ? '{b}: {d}%' : '{b}',\n },\n labelLine: { show: bool(props.withLabelsLine, false) },\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n },\n ],\n graphic: props.chartLabel\n ? [\n {\n type: 'text',\n left: 'center',\n top: 'middle',\n style: {\n text: String(props.chartLabel),\n fill: resolveColor(props.chartLabelColor, '#212529'),\n fontSize: num(props.chartLabelFontSize, 18),\n },\n },\n ]\n : undefined,\n }\n}\n\nexport function scatterOption(props: Props, bubble = false): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const xKey = String(props.dataKey ?? props.xAxisKey ?? 'x')\n const yKey = String(props.yAxisKey ?? 'y')\n const zKey = String(props.zAxisKey ?? 'z')\n return {\n grid: { containLabel: true, ...obj(props.gridProps) },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n xAxis: { type: 'value', show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: { type: 'value', show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: (series.length\n ? series\n : [{ name: String(props.name ?? 'value'), color: props.color as string }]\n ).map((item) => ({\n type: 'scatter',\n name: item.label ?? item.name,\n data: data\n .filter((entry) => !entry.name || entry.name === item.name)\n .map((entry) => [entry[xKey], entry[yKey], entry[zKey], entry]),\n symbolSize: bubble\n ? (value: unknown[]) => Math.max(4, Math.sqrt(Number(value[2] ?? 1)) * num(props.range, 4))\n : num(props.size, 10),\n itemStyle: { color: resolveColor(item.color) },\n })) as unknown as SeriesOption[],\n }\n}\n\nexport function sparklineOption(props: Props): EChartsOption {\n const data = list<number | null>(props.data)\n const trend = props.trendColors as\n | { positive?: string; negative?: string; neutral?: string }\n | undefined\n const color = trend\n ? resolveColor(\n data.at(-1)! > data[0]!\n ? trend.positive\n : data.at(-1)! < data[0]!\n ? trend.negative\n : trend.neutral,\n )\n : resolveColor(props.color)\n return {\n grid: { left: 0, right: 0, top: 1, bottom: 1 },\n xAxis: { type: 'category', show: false },\n yAxis: { type: 'value', show: false, scale: true },\n series: [\n {\n type: 'line',\n data,\n showSymbol: false,\n connectNulls: bool(props.connectNulls, true),\n smooth: props.curveType !== 'linear',\n lineStyle: { color, width: num(props.strokeWidth, 2) },\n areaStyle: bool(props.withGradient, true)\n ? { color, opacity: num(props.fillOpacity, 0.6) }\n : undefined,\n },\n ],\n }\n}\n\nexport function radarOption(props: Props): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const key = String(props.dataKey ?? 'name')\n const max = num(\n props.maxValue,\n Math.max(1, ...data.flatMap((row) => series.map((s) => Number(row[s.name] ?? 0)))),\n )\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n radar: {\n indicator: data.map((row) => ({ name: String(row[key]), max })),\n shape: props.shape === 'circle' ? 'circle' : 'polygon',\n },\n series: [\n {\n type: 'radar',\n data: series.map((s) => ({\n name: s.label ?? s.name,\n value: data.map((row) => Number(row[s.name] ?? 0)),\n lineStyle: { color: resolveColor(s.color) },\n itemStyle: { color: resolveColor(s.color) },\n areaStyle: bool(props.withPolarGrid, false) ? {} : undefined,\n })),\n },\n ],\n }\n}\n\nexport function simpleOption(type: 'funnel' | 'treemap' | 'sankey', props: Props): EChartsOption {\n const data = list<Record<string, unknown>>(props.data)\n if (type === 'sankey')\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n series: [\n {\n type,\n data: list(props.nodes ?? data),\n links: list(props.links),\n emphasis: { focus: 'adjacency' },\n ...obj(props.sankeyProps),\n },\n ],\n }\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n legend: { show: bool(props.withLegend, false) },\n series: [\n {\n type,\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n ...obj(props[`${type}Props`]),\n },\n ],\n }\n}\n\nexport function radialBarOption(props: Props): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n polar: {},\n angleAxis: { max: num(props.maxValue, 100), show: false },\n radiusAxis: {\n type: 'category',\n data: data.map((i) => i.name),\n show: bool(props.withLabels, true),\n },\n series: [\n {\n type: 'bar',\n coordinateSystem: 'polar',\n roundCap: true,\n data: data.map((i) => ({ value: i.value, itemStyle: { color: resolveColor(i.color) } })),\n },\n ],\n }\n}\n\nexport function heatmapOption(props: Props): EChartsOption {\n const input =\n props.data && typeof props.data === 'object' ? (props.data as Record<string, number>) : {}\n const data = Object.entries(input).map(([date, value]) => [date, value])\n const values = Object.values(input)\n const date = (value: unknown, fallback: string) =>\n value instanceof Date\n ? value.toISOString().slice(0, 10)\n : typeof value === 'string'\n ? value\n : fallback\n const start = date(props.startDate, String(data[0]?.[0] ?? new Date().toISOString().slice(0, 10)))\n const end = date(props.endDate, String(data.at(-1)?.[0] ?? start))\n return {\n tooltip: { show: bool(props.withTooltip, false) },\n visualMap: {\n show: bool(props.withLegend, false),\n min: (props.domain as number[] | undefined)?.[0] ?? Math.min(0, ...values),\n max: (props.domain as number[] | undefined)?.[1] ?? Math.max(1, ...values),\n inRange: {\n color: list<string>(props.colors).length\n ? list<string>(props.colors).map((color) => resolveColor(color))\n : ['#ebfbee', '#2f9e44'],\n },\n orient: 'horizontal',\n left: 'center',\n bottom: 0,\n },\n calendar: {\n range: [start, end],\n cellSize: num(props.rectSize, 10) + num(props.gap, 1),\n dayLabel: {\n show: bool(props.withWeekdayLabels, false),\n firstDay: num(props.firstDayOfWeek, 1),\n },\n monthLabel: { show: bool(props.withMonthLabels, false) },\n itemStyle: {\n borderWidth: num(props.gap, 1),\n borderColor: 'transparent',\n borderRadius: num(props.rectRadius, 2),\n },\n },\n series: [{ type: 'heatmap', coordinateSystem: 'calendar', data }],\n }\n}\n","import type { MantineColor } from '@mantine-vue/core'\nimport type { DefineComponent, HTMLAttributes, VNodeChild } from 'vue'\nimport { createChartComponent } from './internal/component'\nimport {\n cartesianOption,\n heatmapOption,\n radarOption,\n radialBarOption,\n radialOption,\n scatterOption,\n simpleOption,\n sparklineOption,\n} from './internal/options'\nimport type {\n ChartData,\n ChartOptionProps,\n ChartRootProps,\n ChartSeries,\n GridChartBaseProps,\n MantineChartDotProps,\n} from './types'\n\nexport type LineChartCurveType =\n | 'bump'\n | 'linear'\n | 'natural'\n | 'monotone'\n | 'step'\n | 'stepBefore'\n | 'stepAfter'\nexport type AreaChartCurveType = LineChartCurveType\nexport type CompositeChartCurveType = LineChartCurveType\nexport interface LineChartSeries extends ChartSeries {\n strokeDasharray?: string | number\n curveType?: LineChartCurveType\n}\nexport interface AreaChartSeries extends ChartSeries {\n color: MantineColor\n strokeDasharray?: string | number\n curveType?: AreaChartCurveType\n}\nexport interface BarChartSeries extends ChartSeries {\n stackId?: string\n}\nexport interface CompositeChartSeries extends ChartSeries {\n type: 'line' | 'area' | 'bar'\n strokeDasharray?: string | number\n}\n\nexport interface LineChartProps extends GridChartBaseProps {\n series: LineChartSeries[]\n type?: 'default' | 'gradient'\n gradientStops?: { offset: number; color: MantineColor }[]\n curveType?: LineChartCurveType\n fillOpacity?: number\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n lineChartProps?: ChartOptionProps\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: LineChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface AreaChartProps extends GridChartBaseProps {\n series: AreaChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'split'\n withGradient?: boolean\n curveType?: AreaChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n areaChartProps?: ChartOptionProps\n fillOpacity?: number\n splitColors?: [MantineColor, MantineColor]\n splitOffset?: number\n connectNulls?: boolean\n areaProps?: ChartOptionProps | ((series: AreaChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface BarChartProps extends GridChartBaseProps {\n series: BarChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'waterfall'\n fillOpacity?: number\n cursorFill?: MantineColor\n barChartProps?: ChartOptionProps\n barProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n withBarValueLabel?: boolean\n valueLabelProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n minBarSize?: number\n maxBarWidth?: number\n barLabelColor?: MantineColor\n getBarColor?: (value: number, series: BarChartSeries) => MantineColor\n}\nexport interface CompositeChartProps extends Omit<GridChartBaseProps, 'orientation'> {\n series: CompositeChartSeries[]\n curveType?: CompositeChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n areaProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n barProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n withBarValueLabel?: boolean\n minBarSize?: number\n maxBarWidth?: number\n composedChartProps?: ChartOptionProps\n}\n\nexport interface PieChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface PieChartProps extends ChartRootProps {\n data: PieChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLabelsLine?: boolean\n labelsPosition?: 'inside' | 'outside'\n labelsType?: 'value' | 'percent'\n tooltipDataSource?: 'segment' | 'all'\n valueFormatter?: (value: number) => string\n strokeWidth?: number\n size?: number\n startAngle?: number\n endAngle?: number\n paddingAngle?: number\n pieProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\nexport interface DonutChartProps extends PieChartProps {\n thickness?: number\n chartLabel?: string\n chartLabelColor?: MantineColor\n chartLabelFontSize?: number\n chartLabelProps?: ChartOptionProps\n}\n\nexport interface ScatterChartSeries extends ChartSeries {\n data?: ChartData\n}\nexport interface ScatterChartProps extends GridChartBaseProps {\n data: ChartData\n series: ScatterChartSeries[]\n xAxisKey?: string\n yAxisKey?: string\n scatterProps?: ChartOptionProps | ((series: ScatterChartSeries) => ChartOptionProps)\n}\nexport interface BubbleChartProps extends ChartRootProps {\n data: ChartData\n xAxisKey?: string\n yAxisKey?: string\n zAxisKey?: string\n name?: string\n color?: MantineColor\n range?: number\n withTooltip?: boolean\n withXAxis?: boolean\n withYAxis?: boolean\n xAxisProps?: ChartOptionProps\n yAxisProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n gridProps?: ChartOptionProps\n valueFormatter?: (value: number) => string\n}\n\nexport interface RadarChartProps extends GridChartBaseProps {\n series: ChartSeries[]\n maxValue?: number\n withPolarGrid?: boolean\n withAngleAxis?: boolean\n withRadiusAxis?: boolean\n shape?: 'polygon' | 'circle'\n radarProps?: ChartOptionProps\n}\nexport interface RadialBarChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface RadialBarChartProps extends ChartRootProps {\n data: RadialBarChartCell[]\n maxValue?: number\n withLabels?: boolean\n withLegend?: boolean\n withTooltip?: boolean\n startAngle?: number\n endAngle?: number\n barSize?: number\n radialBarProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n legendProps?: ChartOptionProps\n}\nexport interface FunnelChartCell extends PieChartCell {\n label?: string\n}\nexport interface FunnelChartProps extends ChartRootProps {\n data: FunnelChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n funnelProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\n\nexport interface TreemapData {\n name: string\n value?: number\n color?: MantineColor\n children?: TreemapData[]\n}\nexport interface TreemapProps extends ChartRootProps {\n data: TreemapData[]\n withTooltip?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n treemapProps?: ChartOptionProps\n}\nexport interface SankeyChartNode {\n name: string\n color?: MantineColor\n [key: string]: unknown\n}\nexport interface SankeyChartLink {\n source: string | number\n target: string | number\n value: number\n [key: string]: unknown\n}\nexport interface SankeyChartProps extends ChartRootProps {\n data?: SankeyChartNode[]\n nodes?: SankeyChartNode[]\n links: SankeyChartLink[]\n withTooltip?: boolean\n valueFormatter?: (value: number) => string\n sankeyProps?: ChartOptionProps\n}\n\nexport interface SparklineTrendColors {\n positive: MantineColor\n negative: MantineColor\n neutral?: MantineColor\n}\nexport interface SparklineProps extends ChartRootProps {\n data: (number | null)[]\n color?: MantineColor\n withGradient?: boolean\n fillOpacity?: number\n curveType?: LineChartCurveType\n strokeWidth?: number\n trendColors?: SparklineTrendColors\n connectNulls?: boolean\n areaProps?: ChartOptionProps\n}\nexport interface HeatmapRectData {\n date: string\n value: number | null\n}\nexport interface HeatmapProps extends ChartRootProps {\n data: Record<string, number>\n domain?: [number, number]\n startDate?: Date | string\n endDate?: Date | string\n withMonthLabels?: boolean\n monthLabels?: string[]\n withWeekdayLabels?: boolean\n weekdayLabels?: string[]\n withOutsideDates?: boolean\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n rectSize?: number\n gap?: number\n rectRadius?: number\n colors?: string[]\n weekdaysLabelsWidth?: number\n monthsLabelsHeight?: number\n fontSize?: number\n getTooltipLabel?: (input: HeatmapRectData) => VNodeChild\n withTooltip?: boolean\n tooltipProps?: ChartOptionProps\n getRectProps?: (input: HeatmapRectData) => Record<string, unknown>\n splitMonths?: boolean\n withLegend?: boolean\n legendLabels?: [string, string]\n}\n\nexport interface BarsListBarData {\n name: string\n value: number\n color?: MantineColor\n textColor?: MantineColor\n variant?: 'light' | 'filled'\n}\nexport interface BarsListProps extends ChartRootProps {\n data: BarsListBarData[]\n valueFormatter?: (value: number) => string\n barsLabel?: string\n valueLabel?: string\n getBarProps?: (data: BarsListBarData) => HTMLAttributes\n renderBar?: (data: BarsListBarData, defaultBar: VNodeChild) => VNodeChild\n barGap?: string | number\n minBarSize?: string | number\n barHeight?: string | number\n barColor?: MantineColor\n barTextColor?: MantineColor\n autoContrast?: boolean\n}\n\ntype PublicComponent<P> = DefineComponent<P>\nexport const AreaChart = createChartComponent('AreaChart', (p) =>\n cartesianOption(p, 'area'),\n) as PublicComponent<AreaChartProps>\nexport const BarChart = createChartComponent('BarChart', (p) =>\n cartesianOption(p, 'bar'),\n) as PublicComponent<BarChartProps>\nexport const LineChart = createChartComponent('LineChart', (p) =>\n cartesianOption(p, 'line'),\n) as PublicComponent<LineChartProps>\nexport const CompositeChart = createChartComponent('CompositeChart', (p) =>\n cartesianOption(p, 'composite'),\n) as PublicComponent<CompositeChartProps>\nexport const PieChart = createChartComponent('PieChart', (p) =>\n radialOption(p),\n) as PublicComponent<PieChartProps>\nexport const DonutChart = createChartComponent('DonutChart', (p) =>\n radialOption(p, true),\n) as PublicComponent<DonutChartProps>\nexport const ScatterChart = createChartComponent('ScatterChart', (p) =>\n scatterOption(p),\n) as PublicComponent<ScatterChartProps>\nexport const BubbleChart = createChartComponent('BubbleChart', (p) =>\n scatterOption(p, true),\n) as PublicComponent<BubbleChartProps>\nexport const RadarChart = createChartComponent(\n 'RadarChart',\n radarOption,\n) as PublicComponent<RadarChartProps>\nexport const RadialBarChart = createChartComponent(\n 'RadialBarChart',\n radialBarOption,\n) as PublicComponent<RadialBarChartProps>\nexport const FunnelChart = createChartComponent('FunnelChart', (p) =>\n simpleOption('funnel', p),\n) as PublicComponent<FunnelChartProps>\nexport const Treemap = createChartComponent('Treemap', (p) =>\n simpleOption('treemap', p),\n) as PublicComponent<TreemapProps>\nexport const SankeyChart = createChartComponent('SankeyChart', (p) =>\n simpleOption('sankey', p),\n) as PublicComponent<SankeyChartProps>\nexport const Sparkline = createChartComponent(\n 'Sparkline',\n sparklineOption,\n) as PublicComponent<SparklineProps>\nexport const Heatmap = createChartComponent(\n 'Heatmap',\n heatmapOption,\n) as PublicComponent<HeatmapProps>\nexport const BarsList = createChartComponent('BarsList', (p) =>\n cartesianOption(\n {\n ...p,\n dataKey: 'name',\n series: [{ name: 'value', color: p.barColor }],\n orientation: 'vertical',\n withXAxis: false,\n withYAxis: true,\n withTooltip: false,\n maxBarWidth: p.barHeight,\n },\n 'bar',\n ),\n) as PublicComponent<BarsListProps>\n\nexport type AreaChartStylesNames =\n | 'area'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BarChartStylesNames =\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type LineChartStylesNames =\n | 'line'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type CompositeChartStylesNames =\n | 'line'\n | 'area'\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type PieChartStylesNames = 'root' | 'label'\nexport type DonutChartStylesNames = PieChartStylesNames\nexport type ScatterChartStylesNames =\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BubbleChartStylesNames = ScatterChartStylesNames\nexport type RadarChartStylesNames =\n | 'root'\n | 'container'\n | 'axis'\n | 'grid'\n | 'curve'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type RadialBarChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type FunnelChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type TreemapStylesNames = 'root' | 'container'\nexport type SankeyChartStylesNames = 'root' | 'container'\nexport type SparklineStylesNames = 'root'\nexport type HeatmapStylesNames =\n | 'root'\n | 'rect'\n | 'weekdayLabel'\n | 'monthLabel'\n | 'legend'\n | 'legendLabel'\n | 'legendRect'\nexport type BarsListStylesNames = 'root' | 'bar' | 'barLabel' | 'barValue' | 'labelsRow'\n\nexport type ChartTooltipStylesNames =\n | 'tooltip'\n | 'tooltipItem'\n | 'tooltipItemBody'\n | 'tooltipItemColor'\n | 'tooltipItemName'\n | 'tooltipItemData'\n | 'tooltipLabel'\n | 'tooltipBody'\nexport type ChartLegendStylesNames = 'legendItem' | 'legendItemColor' | 'legendItemName' | 'legend'\nexport type ChartCssVariables = Record<string, string>\n","import { computed, defineComponent, h, type PropType } from 'vue'\nimport type { ChartRenderable, ChartSeries, ChartTooltipPayload } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartTooltipProps {\n label?: ChartRenderable\n payload?: readonly ChartTooltipPayload[]\n unit?: string\n type?: 'area' | 'radial' | 'scatter'\n segmentId?: string\n series?: ChartSeries[]\n valueFormatter?: (value: number) => ChartRenderable\n showColor?: boolean\n}\n\nexport const ChartTooltip = defineComponent({\n name: 'MantineChartTooltip',\n props: {\n label: null,\n payload: Array as PropType<readonly ChartTooltipPayload[]>,\n unit: String,\n type: { type: String as PropType<ChartTooltipProps['type']>, default: 'area' },\n segmentId: String,\n series: Array as PropType<ChartSeries[]>,\n valueFormatter: Function as PropType<(value: number) => ChartRenderable>,\n showColor: { type: Boolean, default: true },\n },\n setup(props) {\n const labels = computed(() =>\n Object.fromEntries((props.series ?? []).map((item) => [item.name, item.label ?? item.name])),\n )\n return () => {\n const payload = props.segmentId\n ? props.payload?.filter(\n (item) => item.name === props.segmentId || item.dataKey === props.segmentId,\n )\n : props.payload\n if (!payload?.length) return null\n return h('div', { class: 'mantine-ChartTooltip-tooltip', 'data-type': props.type }, [\n props.label != null\n ? h('div', { class: 'mantine-ChartTooltip-tooltipLabel' }, [props.label])\n : null,\n h(\n 'div',\n { class: 'mantine-ChartTooltip-tooltipBody' },\n payload.map((item) =>\n h('div', { class: 'mantine-ChartTooltip-tooltipItem' }, [\n h('div', { class: 'mantine-ChartTooltip-tooltipItemBody' }, [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartTooltip-tooltipItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h(\n 'span',\n { class: 'mantine-ChartTooltip-tooltipItemName' },\n labels.value[item.name ?? ''] ?? item.name,\n ),\n ]),\n h(\n 'span',\n { class: 'mantine-ChartTooltip-tooltipItemData' },\n `${props.valueFormatter ? props.valueFormatter(Number(item.value)) : (item.value ?? '')}${props.unit ?? item.unit ?? ''}`,\n ),\n ]),\n ),\n ),\n ])\n }\n },\n})\n","import { defineComponent, h, type PropType } from 'vue'\nimport type { ChartSeries } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartLegendPayload {\n dataKey?: string\n name?: string\n color?: string\n [key: string]: unknown\n}\nexport interface ChartLegendProps {\n payload?: readonly ChartLegendPayload[]\n onHighlight: (area: string | null) => void\n legendPosition: 'top' | 'bottom' | 'middle'\n series?: ChartSeries[]\n showColor?: boolean\n centered?: boolean\n}\n\nexport const ChartLegend = defineComponent({\n name: 'MantineChartLegend',\n props: {\n payload: Array as PropType<readonly ChartLegendPayload[]>,\n onHighlight: { type: Function as PropType<(area: string | null) => void>, required: true },\n legendPosition: {\n type: String as PropType<ChartLegendProps['legendPosition']>,\n required: true,\n },\n series: Array as PropType<ChartSeries[]>,\n showColor: { type: Boolean, default: true },\n centered: Boolean,\n },\n setup(props) {\n return () =>\n h(\n 'div',\n {\n class: 'mantine-ChartLegend-legend',\n 'data-position': props.legendPosition,\n 'data-centered': props.centered || undefined,\n onMouseleave: () => props.onHighlight(null),\n },\n props.payload?.map((item) => {\n const key = item.dataKey ?? item.name ?? ''\n const label = props.series?.find((s) => s.name === key)?.label ?? key\n return h(\n 'div',\n { class: 'mantine-ChartLegend-legendItem', onMouseenter: () => props.onHighlight(key) },\n [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartLegend-legendItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h('span', { class: 'mantine-ChartLegend-legendItemName' }, label),\n ],\n )\n }),\n )\n },\n})\n","import type { ChartSeries } from '../../types'\nexport function getSeriesLabels(series: ChartSeries[] | undefined): Record<string, string> {\n return Object.fromEntries((series ?? []).map((item) => [item.name, item.label ?? item.name]))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAI,aAAa;AAEjB,SAAgB,kBAAwB;CACtC,IAAI,YACF;CAGF,CAAA,GAAA,aAAA,KAAI;EACF,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;EACA,kBAAA;CACF,CAAC;CAED,aAAa;AACf;;;ACrEA,gBAAgB;AAIhB,SAAgB,qBAAqB,MAAc,aAAuC;CACxF,QAAA,GAAA,IAAA,iBAAuB;EACrB,MAAM,UAAU;EAChB,cAAc;EACd,OAAO;GACL,QAAQ;GACR,QAAQ;IAAE,MAAM,CAAC,QAAQ,MAAM;IAAG,SAAS;GAAI;GAC/C,OAAO;IAAE,MAAM,CAAC,QAAQ,MAAM;IAAG,SAAS;GAAO;GACjD,SAAS;GACT,YAAY;IAAE,MAAM;IAAS,SAA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YAAY,KAAK;IACtD,wBAAwB,UAAmB,KAAK,uBAAuB,KAAK;IAC5E,aAAa,UAAmB,KAAK,YAAY,KAAK;GACxD,CAAC,CACH,CACF;EACJ;CACF,CAAC;AACH;;;ACrEA,IAAM,WAAqC;CACzC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;AAEA,SAAgB,aAAa,OAAgB,WAAW,WAAmB;CACzE,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,OAAO;CAChD,MAAM,CAAC,MAAM,YAAY,MAAM,MAAM,GAAG;CACxC,MAAM,QAAQ,OAAO,YAAY,CAAC;CAClC,OAAO,SAAS,QAAQ,OAAO,UAAU,KAAK,IAAI,QAAQ,MAAM;AAClE;;;ACtIA,IAAM,QAAQ,OAAgB,aAAuB,OAAO,UAAU,YAAY,QAAQ;AAC1F,IAAM,OAAO,OAAgB,aAAsB,OAAO,UAAU,WAAW,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C9F"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/internal/echarts.ts","../src/internal/component.ts","../src/internal/colors.ts","../src/internal/options.ts","../src/charts.ts","../src/ChartTooltip/ChartTooltip.ts","../src/ChartLegend/ChartLegend.ts","../src/utils/get-series-labels/get-series-labels.ts"],"sourcesContent":["import { use } from 'echarts/core'\nimport {\n BarChart as EBarChart,\n EffectScatterChart,\n FunnelChart as EFunnelChart,\n GaugeChart,\n GraphChart,\n HeatmapChart as EHeatmapChart,\n LineChart as ELineChart,\n PieChart as EPieChart,\n RadarChart as ERadarChart,\n SankeyChart as ESankeyChart,\n ScatterChart as EScatterChart,\n TreemapChart as ETreemapChart,\n} from 'echarts/charts'\nimport {\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n} from 'echarts/components'\nimport { CanvasRenderer, SVGRenderer } from 'echarts/renderers'\n\nlet registered = false\n\nexport function registerECharts(): void {\n if (registered) {\n return\n }\n\n use([\n EBarChart,\n EffectScatterChart,\n EFunnelChart,\n GaugeChart,\n GraphChart,\n EHeatmapChart,\n ELineChart,\n EPieChart,\n ERadarChart,\n ESankeyChart,\n EScatterChart,\n ETreemapChart,\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n CanvasRenderer,\n SVGRenderer,\n ])\n\n registered = true\n}\n","import { computed, defineComponent, h, ref, type Component, type PropType } from 'vue'\nimport type { EChartsOption } from 'echarts'\nimport VChart from 'vue-echarts'\nimport { registerECharts } from './echarts'\n\nregisterECharts()\n\nexport type OptionBuilder = (props: Record<string, unknown>) => EChartsOption\n\nexport function createChartComponent(name: string, buildOption: OptionBuilder): Component {\n return defineComponent({\n name: `Mantine${name}`,\n inheritAttrs: false,\n props: {\n option: Object as PropType<EChartsOption>,\n height: { type: [Number, String], default: 300 },\n width: { type: [Number, String], default: '100%' },\n loading: Boolean,\n autoresize: { type: Boolean, default: true },\n renderer: { type: String as PropType<'canvas' | 'svg'>, default: 'canvas' },\n initOptions: Object as PropType<Record<string, unknown>>,\n },\n emits: ['click', 'dblclick', 'mouseover', 'mouseout', 'legendselectchanged', 'datazoom'],\n setup(props, { attrs, emit, expose }) {\n const chart = ref<InstanceType<typeof VChart>>()\n const option = computed(() => ({ ...buildOption(attrs), ...props.option }))\n expose({\n getEchartsInstance: () => chart.value?.chart,\n resize: () => chart.value?.resize(),\n setOption: (next: EChartsOption) => chart.value?.setOption(next),\n })\n const size = (value: string | number) => (typeof value === 'number' ? `${value}px` : value)\n const rootAttributes = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(\n ([key]) =>\n ['id', 'dir', 'role', 'tabindex', 'title'].includes(key) ||\n key.startsWith('aria-') ||\n (key.startsWith('data-') && key !== 'data'),\n ),\n ),\n )\n return () =>\n h(\n 'div',\n {\n ...rootAttributes.value,\n class: ['mantine-Chart-root', `mantine-${name}-root`, attrs.class],\n style: [{ width: size(props.width), height: size(props.height) }, attrs.style],\n },\n [\n h(VChart, {\n ref: chart,\n option: option.value,\n autoresize: props.autoresize,\n loading: props.loading,\n initOptions: { ...props.initOptions, renderer: props.renderer },\n class: 'mantine-Chart-container',\n onClick: (event: unknown) => emit('click', event),\n onDblclick: (event: unknown) => emit('dblclick', event),\n onMouseover: (event: unknown) => emit('mouseover', event),\n onMouseout: (event: unknown) => emit('mouseout', event),\n onLegendselectchanged: (event: unknown) => emit('legendselectchanged', event),\n onDatazoom: (event: unknown) => emit('datazoom', event),\n }),\n ],\n )\n },\n })\n}\n","const shadeMap: Record<string, string[]> = {\n blue: [\n '#e7f5ff',\n '#d0ebff',\n '#a5d8ff',\n '#74c0fc',\n '#4dabf7',\n '#339af0',\n '#228be6',\n '#1c7ed6',\n '#1971c2',\n '#1864ab',\n ],\n cyan: [\n '#e3fafc',\n '#c5f6fa',\n '#99e9f2',\n '#66d9e8',\n '#3bc9db',\n '#22b8cf',\n '#15aabf',\n '#1098ad',\n '#0c8599',\n '#0b7285',\n ],\n green: [\n '#ebfbee',\n '#d3f9d8',\n '#b2f2bb',\n '#8ce99a',\n '#69db7c',\n '#51cf66',\n '#40c057',\n '#37b24d',\n '#2f9e44',\n '#2b8a3e',\n ],\n grape: [\n '#f8f0fc',\n '#f3d9fa',\n '#eebefa',\n '#e599f7',\n '#da77f2',\n '#cc5de8',\n '#be4bdb',\n '#ae3ec9',\n '#9c36b5',\n '#862e9c',\n ],\n gray: [\n '#f8f9fa',\n '#f1f3f5',\n '#e9ecef',\n '#dee2e6',\n '#ced4da',\n '#adb5bd',\n '#868e96',\n '#495057',\n '#343a40',\n '#212529',\n ],\n orange: [\n '#fff4e6',\n '#ffe8cc',\n '#ffd8a8',\n '#ffc078',\n '#ffa94d',\n '#ff922b',\n '#fd7e14',\n '#f76707',\n '#e8590c',\n '#d9480f',\n ],\n pink: [\n '#fff0f6',\n '#ffdeeb',\n '#fcc2d7',\n '#faa2c1',\n '#f783ac',\n '#f06595',\n '#e64980',\n '#d6336c',\n '#c2255c',\n '#a61e4d',\n ],\n red: [\n '#fff5f5',\n '#ffe3e3',\n '#ffc9c9',\n '#ffa8a8',\n '#ff8787',\n '#ff6b6b',\n '#fa5252',\n '#f03e3e',\n '#e03131',\n '#c92a2a',\n ],\n teal: [\n '#e6fcf5',\n '#c3fae8',\n '#96f2d7',\n '#63e6be',\n '#38d9a9',\n '#20c997',\n '#12b886',\n '#0ca678',\n '#099268',\n '#087f5b',\n ],\n violet: [\n '#f3f0ff',\n '#e5dbff',\n '#d0bfff',\n '#b197fc',\n '#9775fa',\n '#845ef7',\n '#7950f2',\n '#7048e8',\n '#6741d9',\n '#5f3dc4',\n ],\n yellow: [\n '#fff9db',\n '#fff3bf',\n '#ffec99',\n '#ffe066',\n '#ffd43b',\n '#fcc419',\n '#fab005',\n '#f59f00',\n '#f08c00',\n '#e67700',\n ],\n}\n\nexport function resolveColor(color: unknown, fallback = '#228be6'): string {\n if (typeof color !== 'string' || !color) return fallback\n const [name, rawShade] = color.split('.')\n const shade = Number(rawShade ?? 6)\n return shadeMap[name]?.[Number.isInteger(shade) ? shade : 6] ?? color\n}\n","import type { EChartsOption, SeriesOption } from 'echarts'\nimport type { ChartDataItem, ChartReferenceLineProps, ChartSeries } from '../types'\nimport { resolveColor } from './colors'\n\ntype Props = Record<string, unknown>\n\nconst bool = (value: unknown, fallback: boolean) => (typeof value === 'boolean' ? value : fallback)\nconst num = (value: unknown, fallback: number) => (typeof value === 'number' ? value : fallback)\nconst obj = (value: unknown) => (value && typeof value === 'object' ? value : {})\nconst list = <T>(value: unknown): T[] => (Array.isArray(value) ? (value as T[]) : [])\nconst formatter = (props: Props) =>\n typeof props.valueFormatter === 'function'\n ? (props.valueFormatter as (value: number) => string)\n : undefined\n\nfunction tooltip(props: Props): EChartsOption['tooltip'] {\n if (!bool(props.withTooltip, true)) return { show: false }\n const format = formatter(props)\n return {\n trigger: 'axis',\n transitionDuration: num(props.tooltipAnimationDuration, 0) / 1000,\n valueFormatter: format ? (value) => format(Number(value)) : undefined,\n ...obj(props.tooltipProps),\n }\n}\n\nfunction markLine(referenceLines: ChartReferenceLineProps[] | undefined) {\n if (!referenceLines?.length) return undefined\n return {\n silent: true,\n symbol: 'none',\n data: referenceLines.map((line) => ({\n xAxis: line.x,\n yAxis: line.y,\n label: typeof line.label === 'string' ? { formatter: line.label } : line.label,\n lineStyle: {\n color: resolveColor(line.color, '#868e96'),\n type: line.strokeDasharray ? 'dashed' : 'solid',\n },\n })),\n }\n}\n\nexport function cartesianOption(\n props: Props,\n kind: 'line' | 'area' | 'bar' | 'composite',\n): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<\n ChartSeries & {\n type?: string\n stackId?: string\n strokeDasharray?: string | number\n curveType?: string\n }\n >(props.series)\n const dataKey = String(props.dataKey ?? 'name')\n const horizontal = props.orientation !== 'vertical'\n const chartType = String(props.type ?? 'default')\n const category = data.map((item) => item[dataKey] as string | number)\n const commonAxis = { axisLabel: { color: resolveColor(props.textColor, '#868e96') } }\n const categoryAxis = { type: 'category' as const, data: category, ...commonAxis }\n const valueAxis = { type: 'value' as const, name: props.yAxisLabel as string, ...commonAxis }\n const mapped = series.map((item, index) => {\n const itemKind = kind === 'composite' ? (item.type ?? 'line') : kind === 'area' ? 'line' : kind\n const color = resolveColor(item.color, resolveColor(`blue.${6 + (index % 3)}`))\n const stack = chartType === 'stacked' || chartType === 'percent' ? 'stack' : item.stackId\n const base = {\n name: item.label ?? item.name,\n data: data.map((entry) => entry[item.name] as number | null),\n yAxisIndex: item.yAxisId ? 1 : 0,\n stack,\n markLine:\n index === 0\n ? markLine(props.referenceLines as ChartReferenceLineProps[] | undefined)\n : undefined,\n }\n if (itemKind === 'bar') {\n return {\n ...base,\n type: 'bar',\n barMaxWidth: props.maxBarWidth as number,\n barMinHeight: num(props.minBarSize, 0),\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n label: {\n show: bool(props.withBarValueLabel, false),\n position: horizontal ? 'top' : 'right',\n },\n }\n }\n return {\n ...base,\n type: 'line',\n smooth: !['linear', 'step', 'stepBefore', 'stepAfter'].includes(\n String(props.curveType ?? item.curveType ?? 'monotone'),\n ),\n step: String(props.curveType).startsWith('step') ? 'middle' : false,\n connectNulls: bool(props.connectNulls, true),\n showSymbol: bool(props.withDots, true),\n symbolSize: 6,\n lineStyle: {\n color,\n width: num(props.strokeWidth, 2),\n type: item.strokeDasharray ? 'dashed' : 'solid',\n },\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n areaStyle: itemKind === 'area' ? { color, opacity: num(props.fillOpacity, 0.2) } : undefined,\n label: { show: bool(props.withPointLabels, false), position: 'top' },\n }\n }) as unknown as SeriesOption[]\n\n return {\n animationDurationUpdate: num(props.tooltipAnimationDuration, 0),\n color: series.map((item) => resolveColor(item.color)),\n grid: {\n left: 48,\n right: bool(props.withRightYAxis, false) ? 48 : 16,\n top: bool(props.withLegend, false) ? 44 : 16,\n bottom: 38,\n containLabel: true,\n ...obj(props.gridProps),\n },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: tooltip(props),\n xAxis: horizontal\n ? {\n ...categoryAxis,\n show: bool(props.withXAxis, true),\n name: props.xAxisLabel as string,\n ...obj(props.xAxisProps),\n }\n : { ...valueAxis, show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: horizontal\n ? [\n { ...valueAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n {\n ...valueAxis,\n show: bool(props.withRightYAxis, false),\n position: 'right',\n name: props.rightYAxisLabel as string,\n ...obj(props.rightYAxisProps),\n },\n ]\n : { ...categoryAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: mapped,\n }\n}\n\nexport function radialOption(props: Props, donut = false): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n color: data.map((item) => resolveColor(item.color)),\n legend: {\n show: bool(props.withLabels, false) || bool(props.withLegend, false),\n ...obj(props.legendProps),\n },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n series: [\n {\n type: 'pie',\n radius: donut ? [`${num(props.thickness, 40)}%`, '75%'] : ['0%', '75%'],\n startAngle: num(props.startAngle, 90),\n minAngle: num(props.minAngle, 0),\n padAngle: num(props.paddingAngle, 0),\n roseType:\n props.type === 'pie'\n ? undefined\n : props.type === 'donut'\n ? undefined\n : (props.type as 'radius' | 'area'),\n label: {\n show: bool(props.withLabels, false),\n formatter: props.withLabelsLine ? '{b}: {d}%' : '{b}',\n },\n labelLine: { show: bool(props.withLabelsLine, false) },\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n },\n ],\n graphic: props.chartLabel\n ? [\n {\n type: 'text',\n left: 'center',\n top: 'middle',\n style: {\n text: String(props.chartLabel),\n fill: resolveColor(props.chartLabelColor, '#212529'),\n fontSize: num(props.chartLabelFontSize, 18),\n },\n },\n ]\n : undefined,\n }\n}\n\nexport function scatterOption(props: Props, bubble = false): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const xKey = String(props.dataKey ?? props.xAxisKey ?? 'x')\n const yKey = String(props.yAxisKey ?? 'y')\n const zKey = String(props.zAxisKey ?? 'z')\n return {\n grid: { containLabel: true, ...obj(props.gridProps) },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n xAxis: { type: 'value', show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: { type: 'value', show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: (series.length\n ? series\n : [{ name: String(props.name ?? 'value'), color: props.color as string }]\n ).map((item) => ({\n type: 'scatter',\n name: item.label ?? item.name,\n data: data\n .filter((entry) => !entry.name || entry.name === item.name)\n .map((entry) => [entry[xKey], entry[yKey], entry[zKey], entry]),\n symbolSize: bubble\n ? (value: unknown[]) => Math.max(4, Math.sqrt(Number(value[2] ?? 1)) * num(props.range, 4))\n : num(props.size, 10),\n itemStyle: { color: resolveColor(item.color) },\n })) as unknown as SeriesOption[],\n }\n}\n\nexport function sparklineOption(props: Props): EChartsOption {\n const data = list<number | null>(props.data)\n const trend = props.trendColors as\n | { positive?: string; negative?: string; neutral?: string }\n | undefined\n const color = trend\n ? resolveColor(\n data.at(-1)! > data[0]!\n ? trend.positive\n : data.at(-1)! < data[0]!\n ? trend.negative\n : trend.neutral,\n )\n : resolveColor(props.color)\n return {\n grid: { left: 0, right: 0, top: 1, bottom: 1 },\n xAxis: { type: 'category', show: false },\n yAxis: { type: 'value', show: false, scale: true },\n series: [\n {\n type: 'line',\n data,\n showSymbol: false,\n connectNulls: bool(props.connectNulls, true),\n smooth: props.curveType !== 'linear',\n lineStyle: { color, width: num(props.strokeWidth, 2) },\n areaStyle: bool(props.withGradient, true)\n ? { color, opacity: num(props.fillOpacity, 0.6) }\n : undefined,\n },\n ],\n }\n}\n\nexport function radarOption(props: Props): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const key = String(props.dataKey ?? 'name')\n const max = num(\n props.maxValue,\n Math.max(1, ...data.flatMap((row) => series.map((s) => Number(row[s.name] ?? 0)))),\n )\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n radar: {\n indicator: data.map((row) => ({ name: String(row[key]), max })),\n shape: props.shape === 'circle' ? 'circle' : 'polygon',\n },\n series: [\n {\n type: 'radar',\n data: series.map((s) => ({\n name: s.label ?? s.name,\n value: data.map((row) => Number(row[s.name] ?? 0)),\n lineStyle: { color: resolveColor(s.color) },\n itemStyle: { color: resolveColor(s.color) },\n areaStyle: bool(props.withPolarGrid, false) ? {} : undefined,\n })),\n },\n ],\n }\n}\n\nexport function simpleOption(type: 'funnel' | 'treemap' | 'sankey', props: Props): EChartsOption {\n const data = list<Record<string, unknown>>(props.data)\n if (type === 'sankey')\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n series: [\n {\n type,\n data: list(props.nodes ?? data),\n links: list(props.links),\n emphasis: { focus: 'adjacency' },\n ...obj(props.sankeyProps),\n },\n ],\n }\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n legend: { show: bool(props.withLegend, false) },\n series: [\n {\n type,\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n ...obj(props[`${type}Props`]),\n },\n ],\n }\n}\n\nexport function radialBarOption(props: Props): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n polar: {},\n angleAxis: { max: num(props.maxValue, 100), show: false },\n radiusAxis: {\n type: 'category',\n data: data.map((i) => i.name),\n show: bool(props.withLabels, true),\n },\n series: [\n {\n type: 'bar',\n coordinateSystem: 'polar',\n roundCap: true,\n data: data.map((i) => ({ value: i.value, itemStyle: { color: resolveColor(i.color) } })),\n },\n ],\n }\n}\n\nexport function heatmapOption(props: Props): EChartsOption {\n const input =\n props.data && typeof props.data === 'object' ? (props.data as Record<string, number>) : {}\n const data = Object.entries(input).map(([date, value]) => [date, value])\n const values = Object.values(input)\n const date = (value: unknown, fallback: string) =>\n value instanceof Date\n ? value.toISOString().slice(0, 10)\n : typeof value === 'string'\n ? value\n : fallback\n const start = date(props.startDate, String(data[0]?.[0] ?? new Date().toISOString().slice(0, 10)))\n const end = date(props.endDate, String(data.at(-1)?.[0] ?? start))\n return {\n tooltip: { show: bool(props.withTooltip, false) },\n visualMap: {\n show: bool(props.withLegend, false),\n min: (props.domain as number[] | undefined)?.[0] ?? Math.min(0, ...values),\n max: (props.domain as number[] | undefined)?.[1] ?? Math.max(1, ...values),\n inRange: {\n color: list<string>(props.colors).length\n ? list<string>(props.colors).map((color) => resolveColor(color))\n : ['#ebfbee', '#2f9e44'],\n },\n orient: 'horizontal',\n left: 'center',\n bottom: 0,\n },\n calendar: {\n range: [start, end],\n cellSize: num(props.rectSize, 10) + num(props.gap, 1),\n dayLabel: {\n show: bool(props.withWeekdayLabels, false),\n firstDay: num(props.firstDayOfWeek, 1),\n },\n monthLabel: { show: bool(props.withMonthLabels, false) },\n itemStyle: {\n borderWidth: num(props.gap, 1),\n borderColor: 'transparent',\n borderRadius: num(props.rectRadius, 2),\n },\n },\n series: [{ type: 'heatmap', coordinateSystem: 'calendar', data }],\n }\n}\n","import type { MantineColor } from '@mantine-vue/core'\nimport type { DefineComponent, HTMLAttributes, VNodeChild } from 'vue'\nimport { createChartComponent } from './internal/component'\nimport {\n cartesianOption,\n heatmapOption,\n radarOption,\n radialBarOption,\n radialOption,\n scatterOption,\n simpleOption,\n sparklineOption,\n} from './internal/options'\nimport type {\n ChartData,\n ChartOptionProps,\n ChartRootProps,\n ChartSeries,\n GridChartBaseProps,\n MantineChartDotProps,\n} from './types'\n\nexport type LineChartCurveType =\n | 'bump'\n | 'linear'\n | 'natural'\n | 'monotone'\n | 'step'\n | 'stepBefore'\n | 'stepAfter'\nexport type AreaChartCurveType = LineChartCurveType\nexport type CompositeChartCurveType = LineChartCurveType\nexport interface LineChartSeries extends ChartSeries {\n strokeDasharray?: string | number\n curveType?: LineChartCurveType\n}\nexport interface AreaChartSeries extends ChartSeries {\n color: MantineColor\n strokeDasharray?: string | number\n curveType?: AreaChartCurveType\n}\nexport interface BarChartSeries extends ChartSeries {\n stackId?: string\n}\nexport interface CompositeChartSeries extends ChartSeries {\n type: 'line' | 'area' | 'bar'\n strokeDasharray?: string | number\n}\n\nexport interface LineChartProps extends GridChartBaseProps {\n series: LineChartSeries[]\n type?: 'default' | 'gradient'\n gradientStops?: { offset: number; color: MantineColor }[]\n curveType?: LineChartCurveType\n fillOpacity?: number\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n lineChartProps?: ChartOptionProps\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: LineChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface AreaChartProps extends GridChartBaseProps {\n series: AreaChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'split'\n withGradient?: boolean\n curveType?: AreaChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n areaChartProps?: ChartOptionProps\n fillOpacity?: number\n splitColors?: [MantineColor, MantineColor]\n splitOffset?: number\n connectNulls?: boolean\n areaProps?: ChartOptionProps | ((series: AreaChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface BarChartProps extends GridChartBaseProps {\n series: BarChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'waterfall'\n fillOpacity?: number\n cursorFill?: MantineColor\n barChartProps?: ChartOptionProps\n barProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n withBarValueLabel?: boolean\n valueLabelProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n minBarSize?: number\n maxBarWidth?: number\n barLabelColor?: MantineColor\n getBarColor?: (value: number, series: BarChartSeries) => MantineColor\n}\nexport interface CompositeChartProps extends Omit<GridChartBaseProps, 'orientation'> {\n series: CompositeChartSeries[]\n curveType?: CompositeChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n areaProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n barProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n withBarValueLabel?: boolean\n minBarSize?: number\n maxBarWidth?: number\n composedChartProps?: ChartOptionProps\n}\n\nexport interface PieChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface PieChartProps extends ChartRootProps {\n data: PieChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLabelsLine?: boolean\n labelsPosition?: 'inside' | 'outside'\n labelsType?: 'value' | 'percent'\n tooltipDataSource?: 'segment' | 'all'\n valueFormatter?: (value: number) => string\n strokeWidth?: number\n size?: number\n startAngle?: number\n endAngle?: number\n paddingAngle?: number\n pieProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\nexport interface DonutChartProps extends PieChartProps {\n thickness?: number\n chartLabel?: string\n chartLabelColor?: MantineColor\n chartLabelFontSize?: number\n chartLabelProps?: ChartOptionProps\n}\n\nexport interface ScatterChartSeries extends ChartSeries {\n data?: ChartData\n}\nexport interface ScatterChartProps extends GridChartBaseProps {\n data: ChartData\n series: ScatterChartSeries[]\n xAxisKey?: string\n yAxisKey?: string\n scatterProps?: ChartOptionProps | ((series: ScatterChartSeries) => ChartOptionProps)\n}\nexport interface BubbleChartProps extends ChartRootProps {\n data: ChartData\n xAxisKey?: string\n yAxisKey?: string\n zAxisKey?: string\n name?: string\n color?: MantineColor\n range?: number\n withTooltip?: boolean\n withXAxis?: boolean\n withYAxis?: boolean\n xAxisProps?: ChartOptionProps\n yAxisProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n gridProps?: ChartOptionProps\n valueFormatter?: (value: number) => string\n}\n\nexport interface RadarChartProps extends GridChartBaseProps {\n series: ChartSeries[]\n maxValue?: number\n withPolarGrid?: boolean\n withAngleAxis?: boolean\n withRadiusAxis?: boolean\n shape?: 'polygon' | 'circle'\n radarProps?: ChartOptionProps\n}\nexport interface RadialBarChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface RadialBarChartProps extends ChartRootProps {\n data: RadialBarChartCell[]\n maxValue?: number\n withLabels?: boolean\n withLegend?: boolean\n withTooltip?: boolean\n startAngle?: number\n endAngle?: number\n barSize?: number\n radialBarProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n legendProps?: ChartOptionProps\n}\nexport interface FunnelChartCell extends PieChartCell {\n label?: string\n}\nexport interface FunnelChartProps extends ChartRootProps {\n data: FunnelChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n funnelProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\n\nexport interface TreemapData {\n name: string\n value?: number\n color?: MantineColor\n children?: TreemapData[]\n}\nexport interface TreemapProps extends ChartRootProps {\n data: TreemapData[]\n withTooltip?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n treemapProps?: ChartOptionProps\n}\nexport interface SankeyChartNode {\n name: string\n color?: MantineColor\n [key: string]: unknown\n}\nexport interface SankeyChartLink {\n source: string | number\n target: string | number\n value: number\n [key: string]: unknown\n}\nexport interface SankeyChartProps extends ChartRootProps {\n data?: SankeyChartNode[]\n nodes?: SankeyChartNode[]\n links: SankeyChartLink[]\n withTooltip?: boolean\n valueFormatter?: (value: number) => string\n sankeyProps?: ChartOptionProps\n}\n\nexport interface SparklineTrendColors {\n positive: MantineColor\n negative: MantineColor\n neutral?: MantineColor\n}\nexport interface SparklineProps extends ChartRootProps {\n data: (number | null)[]\n color?: MantineColor\n withGradient?: boolean\n fillOpacity?: number\n curveType?: LineChartCurveType\n strokeWidth?: number\n trendColors?: SparklineTrendColors\n connectNulls?: boolean\n areaProps?: ChartOptionProps\n}\nexport interface HeatmapRectData {\n date: string\n value: number | null\n}\nexport interface HeatmapProps extends ChartRootProps {\n data: Record<string, number>\n domain?: [number, number]\n startDate?: Date | string\n endDate?: Date | string\n withMonthLabels?: boolean\n monthLabels?: string[]\n withWeekdayLabels?: boolean\n weekdayLabels?: string[]\n withOutsideDates?: boolean\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n rectSize?: number\n gap?: number\n rectRadius?: number\n colors?: string[]\n weekdaysLabelsWidth?: number\n monthsLabelsHeight?: number\n fontSize?: number\n getTooltipLabel?: (input: HeatmapRectData) => VNodeChild\n withTooltip?: boolean\n tooltipProps?: ChartOptionProps\n getRectProps?: (input: HeatmapRectData) => Record<string, unknown>\n splitMonths?: boolean\n withLegend?: boolean\n legendLabels?: [string, string]\n}\n\nexport interface BarsListBarData {\n name: string\n value: number\n color?: MantineColor\n textColor?: MantineColor\n variant?: 'light' | 'filled'\n}\nexport interface BarsListProps extends ChartRootProps {\n data: BarsListBarData[]\n valueFormatter?: (value: number) => string\n barsLabel?: string\n valueLabel?: string\n getBarProps?: (data: BarsListBarData) => HTMLAttributes\n renderBar?: (data: BarsListBarData, defaultBar: VNodeChild) => VNodeChild\n barGap?: string | number\n minBarSize?: string | number\n barHeight?: string | number\n barColor?: MantineColor\n barTextColor?: MantineColor\n autoContrast?: boolean\n}\n\ntype PublicComponent<P> = DefineComponent<P>\nexport const AreaChart = createChartComponent('AreaChart', (p) =>\n cartesianOption(p, 'area'),\n) as PublicComponent<AreaChartProps>\nexport const BarChart = createChartComponent('BarChart', (p) =>\n cartesianOption(p, 'bar'),\n) as PublicComponent<BarChartProps>\nexport const LineChart = createChartComponent('LineChart', (p) =>\n cartesianOption(p, 'line'),\n) as PublicComponent<LineChartProps>\nexport const CompositeChart = createChartComponent('CompositeChart', (p) =>\n cartesianOption(p, 'composite'),\n) as PublicComponent<CompositeChartProps>\nexport const PieChart = createChartComponent('PieChart', (p) =>\n radialOption(p),\n) as PublicComponent<PieChartProps>\nexport const DonutChart = createChartComponent('DonutChart', (p) =>\n radialOption(p, true),\n) as PublicComponent<DonutChartProps>\nexport const ScatterChart = createChartComponent('ScatterChart', (p) =>\n scatterOption(p),\n) as PublicComponent<ScatterChartProps>\nexport const BubbleChart = createChartComponent('BubbleChart', (p) =>\n scatterOption(p, true),\n) as PublicComponent<BubbleChartProps>\nexport const RadarChart = createChartComponent(\n 'RadarChart',\n radarOption,\n) as PublicComponent<RadarChartProps>\nexport const RadialBarChart = createChartComponent(\n 'RadialBarChart',\n radialBarOption,\n) as PublicComponent<RadialBarChartProps>\nexport const FunnelChart = createChartComponent('FunnelChart', (p) =>\n simpleOption('funnel', p),\n) as PublicComponent<FunnelChartProps>\nexport const Treemap = createChartComponent('Treemap', (p) =>\n simpleOption('treemap', p),\n) as PublicComponent<TreemapProps>\nexport const SankeyChart = createChartComponent('SankeyChart', (p) =>\n simpleOption('sankey', p),\n) as PublicComponent<SankeyChartProps>\nexport const Sparkline = createChartComponent(\n 'Sparkline',\n sparklineOption,\n) as PublicComponent<SparklineProps>\nexport const Heatmap = createChartComponent(\n 'Heatmap',\n heatmapOption,\n) as PublicComponent<HeatmapProps>\nexport const BarsList = createChartComponent('BarsList', (p) =>\n cartesianOption(\n {\n ...p,\n dataKey: 'name',\n series: [{ name: 'value', color: p.barColor }],\n orientation: 'vertical',\n withXAxis: false,\n withYAxis: true,\n withTooltip: false,\n maxBarWidth: p.barHeight,\n },\n 'bar',\n ),\n) as PublicComponent<BarsListProps>\n\nexport type AreaChartStylesNames =\n | 'area'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BarChartStylesNames =\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type LineChartStylesNames =\n | 'line'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type CompositeChartStylesNames =\n | 'line'\n | 'area'\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type PieChartStylesNames = 'root' | 'label'\nexport type DonutChartStylesNames = PieChartStylesNames\nexport type ScatterChartStylesNames =\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BubbleChartStylesNames = ScatterChartStylesNames\nexport type RadarChartStylesNames =\n | 'root'\n | 'container'\n | 'axis'\n | 'grid'\n | 'curve'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type RadialBarChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type FunnelChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type TreemapStylesNames = 'root' | 'container'\nexport type SankeyChartStylesNames = 'root' | 'container'\nexport type SparklineStylesNames = 'root'\nexport type HeatmapStylesNames =\n | 'root'\n | 'rect'\n | 'weekdayLabel'\n | 'monthLabel'\n | 'legend'\n | 'legendLabel'\n | 'legendRect'\nexport type BarsListStylesNames = 'root' | 'bar' | 'barLabel' | 'barValue' | 'labelsRow'\n\nexport type ChartTooltipStylesNames =\n | 'tooltip'\n | 'tooltipItem'\n | 'tooltipItemBody'\n | 'tooltipItemColor'\n | 'tooltipItemName'\n | 'tooltipItemData'\n | 'tooltipLabel'\n | 'tooltipBody'\nexport type ChartLegendStylesNames = 'legendItem' | 'legendItemColor' | 'legendItemName' | 'legend'\nexport type ChartCssVariables = Record<string, string>\n","import { computed, defineComponent, h, type PropType, type SlotsType, type VNodeChild } from 'vue'\nimport type { ChartRenderable, ChartSeries, ChartTooltipPayload } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartTooltipProps {\n label?: ChartRenderable\n payload?: readonly ChartTooltipPayload[]\n unit?: string\n type?: 'area' | 'radial' | 'scatter'\n segmentId?: string\n series?: ChartSeries[]\n valueFormatter?: (value: number) => ChartRenderable\n showColor?: boolean\n}\n\nexport interface ChartTooltipSlots {\n label?: () => VNodeChild\n valueFormatter?: (input: { value: number; item: ChartTooltipPayload }) => VNodeChild\n}\n\nexport const ChartTooltip = defineComponent({\n name: 'MantineChartTooltip',\n slots: Object as SlotsType<ChartTooltipSlots>,\n props: {\n label: null,\n payload: Array as PropType<readonly ChartTooltipPayload[]>,\n unit: String,\n type: { type: String as PropType<ChartTooltipProps['type']>, default: 'area' },\n segmentId: String,\n series: Array as PropType<ChartSeries[]>,\n valueFormatter: Function as PropType<(value: number) => ChartRenderable>,\n showColor: { type: Boolean, default: true },\n },\n setup(props, { slots }) {\n const labels = computed(() =>\n Object.fromEntries((props.series ?? []).map((item) => [item.name, item.label ?? item.name])),\n )\n return () => {\n const label = props.label !== undefined ? props.label : slots.label?.()\n const payload = props.segmentId\n ? props.payload?.filter(\n (item) => item.name === props.segmentId || item.dataKey === props.segmentId,\n )\n : props.payload\n if (!payload?.length) return null\n return h('div', { class: 'mantine-ChartTooltip-tooltip', 'data-type': props.type }, [\n label != null ? h('div', { class: 'mantine-ChartTooltip-tooltipLabel' }, [label]) : null,\n h(\n 'div',\n { class: 'mantine-ChartTooltip-tooltipBody' },\n payload.map((item) =>\n h('div', { class: 'mantine-ChartTooltip-tooltipItem' }, [\n h('div', { class: 'mantine-ChartTooltip-tooltipItemBody' }, [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartTooltip-tooltipItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h(\n 'span',\n { class: 'mantine-ChartTooltip-tooltipItemName' },\n labels.value[item.name ?? ''] ?? item.name,\n ),\n ]),\n h('span', { class: 'mantine-ChartTooltip-tooltipItemData' }, [\n props.valueFormatter\n ? props.valueFormatter(Number(item.value))\n : (slots.valueFormatter?.({ value: Number(item.value), item }) ??\n (item.value == null ? '' : String(item.value))),\n props.unit ?? item.unit ?? '',\n ]),\n ]),\n ),\n ),\n ])\n }\n },\n})\n","import { defineComponent, h, type PropType } from 'vue'\nimport type { ChartSeries } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartLegendPayload {\n dataKey?: string\n name?: string\n color?: string\n [key: string]: unknown\n}\nexport interface ChartLegendProps {\n payload?: readonly ChartLegendPayload[]\n onHighlight: (area: string | null) => void\n legendPosition: 'top' | 'bottom' | 'middle'\n series?: ChartSeries[]\n showColor?: boolean\n centered?: boolean\n}\n\nexport const ChartLegend = defineComponent({\n name: 'MantineChartLegend',\n props: {\n payload: Array as PropType<readonly ChartLegendPayload[]>,\n onHighlight: { type: Function as PropType<(area: string | null) => void>, required: true },\n legendPosition: {\n type: String as PropType<ChartLegendProps['legendPosition']>,\n required: true,\n },\n series: Array as PropType<ChartSeries[]>,\n showColor: { type: Boolean, default: true },\n centered: Boolean,\n },\n setup(props) {\n return () =>\n h(\n 'div',\n {\n class: 'mantine-ChartLegend-legend',\n 'data-position': props.legendPosition,\n 'data-centered': props.centered || undefined,\n onMouseleave: () => props.onHighlight(null),\n },\n props.payload?.map((item) => {\n const key = item.dataKey ?? item.name ?? ''\n const label = props.series?.find((s) => s.name === key)?.label ?? key\n return h(\n 'div',\n { class: 'mantine-ChartLegend-legendItem', onMouseenter: () => props.onHighlight(key) },\n [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartLegend-legendItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h('span', { class: 'mantine-ChartLegend-legendItemName' }, label),\n ],\n )\n }),\n )\n },\n})\n","import type { ChartSeries } from '../../types'\nexport function getSeriesLabels(series: ChartSeries[] | undefined): Record<string, string> {\n return Object.fromEntries((series ?? []).map((item) => [item.name, item.label ?? item.name]))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAI,aAAa;AAEjB,SAAgB,kBAAwB;CACtC,IAAI,YACF;CAGF,CAAA,GAAA,aAAA,KAAI;EACF,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,eAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,mBAAA;EACA,kBAAA;EACA,kBAAA;CACF,CAAC;CAED,aAAa;AACf;;;ACrEA,gBAAgB;AAIhB,SAAgB,qBAAqB,MAAc,aAAuC;CACxF,QAAA,GAAA,IAAA,iBAAuB;EACrB,MAAM,UAAU;EAChB,cAAc;EACd,OAAO;GACL,QAAQ;GACR,QAAQ;IAAE,MAAM,CAAC,QAAQ,MAAM;IAAG,SAAS;GAAI;GAC/C,OAAO;IAAE,MAAM,CAAC,QAAQ,MAAM;IAAG,SAAS;GAAO;GACjD,SAAS;GACT,YAAY;IAAE,MAAM;IAAS,SAAS;GAAK;GAC3C,UAAU;IAAE,MAAM;IAAsC,SAAS;GAAS;GAC1E,aAAa;EACf;EACA,OAAO;GAAC;GAAS;GAAY;GAAa;GAAY;GAAuB;EAAU;EACvF,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;GACpC,MAAM,SAAA,GAAA,IAAA,KAAyC;GAC/C,MAAM,UAAA,GAAA,IAAA,iBAAyB;IAAE,GAAG,YAAY,KAAK;IAAG,GAAG,MAAM;GAAO,EAAE;GAC1E,OAAO;IACL,0BAA0B,MAAM,OAAO;IAC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D,MAAM,QAAQ,KAAK,QAAQ,EAC7B,CAAC,CACH,CAAC,CACH,CACF,CACF,CAAC;EACH;CACF;AACF,CAAC;;;AC3DD,IAAa,eAAA,GAAA,IAAA,iBAA8B;CACzC,MAAM;CACN,OAAO;EACL,SAAS;EACT,aAAa;GAAE,MAAM;GAAqD,UAAU;EAAK;EACzF,gBAAgB;GACd,MAAM;GACN,UAAU;EACZ;EACA,QAAQ;EACR,WAAW;GAAE,MAAM;GAAS,SAAS;EAAK;EAC1C,UAAU;CACZ;CACA,MAAM,OAAO;EACX,cAAA,GAAA,IAAA,GAEI,OACA;GACE,OAAO;GACP,iBAAiB,MAAM;GACvB,iBAAiB,MAAM,YAAY,KAAA;GACnC,oBAAoB,MAAM,YAAY,IAAI;EAC5C,GACA,MAAM,SAAS,KAAK,SAAS;GAC3B,MAAM,MAAM,KAAK,WAAW,KAAK,QAAQ;GACzC,MAAM,QAAQ,MAAM,QAAQ,MAAM,MAAM,EAAE,SAAS,GAAG,GAAG,SAAS;GAClE,QAAA,GAAA,IAAA,GACE,OACA;IAAE,OAAO;IAAkC,oBAAoB,MAAM,YAAY,GAAG;GAAE,GACtF,CACE,MAAM,aAAA,GAAA,IAAA,GACA,QAAQ;IACR,OAAO;IACP,OAAO,EAAE,YAAY,aAAa,KAAK,KAAK,EAAE;GAChD,CAAC,IACD,OAAA,GAAA,IAAA,GACF,QAAQ,EAAE,OAAO,qCAAqC,GAAG,KAAK,CAClE,CACF;EACF,CAAC,CACH;CACJ;AACF,CAAC;;;AC5DD,SAAgB,gBAAgB,QAA2D;CACzF,OAAO,OAAO,aAAa,UAAU,CAAC,GAAG,KAAK,SAAS,CAAC,KAAK,MAAM,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9F"}
package/esm/index.mjs CHANGED
@@ -698,6 +698,7 @@ var BarsList = createChartComponent("BarsList", (p) => cartesianOption({
698
698
  //#region src/ChartTooltip/ChartTooltip.ts
699
699
  var ChartTooltip = defineComponent({
700
700
  name: "MantineChartTooltip",
701
+ slots: Object,
701
702
  props: {
702
703
  label: null,
703
704
  payload: Array,
@@ -714,18 +715,22 @@ var ChartTooltip = defineComponent({
714
715
  default: true
715
716
  }
716
717
  },
717
- setup(props) {
718
+ setup(props, { slots }) {
718
719
  const labels = computed(() => Object.fromEntries((props.series ?? []).map((item) => [item.name, item.label ?? item.name])));
719
720
  return () => {
721
+ const label = props.label !== void 0 ? props.label : slots.label?.();
720
722
  const payload = props.segmentId ? props.payload?.filter((item) => item.name === props.segmentId || item.dataKey === props.segmentId) : props.payload;
721
723
  if (!payload?.length) return null;
722
724
  return h("div", {
723
725
  class: "mantine-ChartTooltip-tooltip",
724
726
  "data-type": props.type
725
- }, [props.label != null ? h("div", { class: "mantine-ChartTooltip-tooltipLabel" }, [props.label]) : null, h("div", { class: "mantine-ChartTooltip-tooltipBody" }, payload.map((item) => h("div", { class: "mantine-ChartTooltip-tooltipItem" }, [h("div", { class: "mantine-ChartTooltip-tooltipItemBody" }, [props.showColor ? h("span", {
727
+ }, [label != null ? h("div", { class: "mantine-ChartTooltip-tooltipLabel" }, [label]) : null, h("div", { class: "mantine-ChartTooltip-tooltipBody" }, payload.map((item) => h("div", { class: "mantine-ChartTooltip-tooltipItem" }, [h("div", { class: "mantine-ChartTooltip-tooltipItemBody" }, [props.showColor ? h("span", {
726
728
  class: "mantine-ChartTooltip-tooltipItemColor",
727
729
  style: { background: resolveColor(item.color) }
728
- }) : null, h("span", { class: "mantine-ChartTooltip-tooltipItemName" }, labels.value[item.name ?? ""] ?? item.name)]), h("span", { class: "mantine-ChartTooltip-tooltipItemData" }, `${props.valueFormatter ? props.valueFormatter(Number(item.value)) : item.value ?? ""}${props.unit ?? item.unit ?? ""}`)])))]);
730
+ }) : null, h("span", { class: "mantine-ChartTooltip-tooltipItemName" }, labels.value[item.name ?? ""] ?? item.name)]), h("span", { class: "mantine-ChartTooltip-tooltipItemData" }, [props.valueFormatter ? props.valueFormatter(Number(item.value)) : slots.valueFormatter?.({
731
+ value: Number(item.value),
732
+ item
733
+ }) ?? (item.value == null ? "" : String(item.value)), props.unit ?? item.unit ?? ""])])))]);
729
734
  };
730
735
  }
731
736
  });
package/esm/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/internal/echarts.ts","../src/internal/component.ts","../src/internal/colors.ts","../src/internal/options.ts","../src/charts.ts","../src/ChartTooltip/ChartTooltip.ts","../src/ChartLegend/ChartLegend.ts","../src/utils/get-series-labels/get-series-labels.ts"],"sourcesContent":["import { use } from 'echarts/core'\nimport {\n BarChart as EBarChart,\n EffectScatterChart,\n FunnelChart as EFunnelChart,\n GaugeChart,\n GraphChart,\n HeatmapChart as EHeatmapChart,\n LineChart as ELineChart,\n PieChart as EPieChart,\n RadarChart as ERadarChart,\n SankeyChart as ESankeyChart,\n ScatterChart as EScatterChart,\n TreemapChart as ETreemapChart,\n} from 'echarts/charts'\nimport {\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n} from 'echarts/components'\nimport { CanvasRenderer, SVGRenderer } from 'echarts/renderers'\n\nlet registered = false\n\nexport function registerECharts(): void {\n if (registered) {\n return\n }\n\n use([\n EBarChart,\n EffectScatterChart,\n EFunnelChart,\n GaugeChart,\n GraphChart,\n EHeatmapChart,\n ELineChart,\n EPieChart,\n ERadarChart,\n ESankeyChart,\n EScatterChart,\n ETreemapChart,\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n CanvasRenderer,\n SVGRenderer,\n ])\n\n registered = true\n}\n","import { computed, defineComponent, h, ref, type Component, type PropType } from 'vue'\nimport type { EChartsOption } from 'echarts'\nimport VChart from 'vue-echarts'\nimport { registerECharts } from './echarts'\n\nregisterECharts()\n\nexport type OptionBuilder = (props: Record<string, unknown>) => EChartsOption\n\nexport function createChartComponent(name: string, buildOption: OptionBuilder): Component {\n return defineComponent({\n name: `Mantine${name}`,\n inheritAttrs: false,\n props: {\n option: Object as PropType<EChartsOption>,\n height: { type: [Number, String], default: 300 },\n width: { type: [Number, String], default: '100%' },\n loading: Boolean,\n autoresize: { type: Boolean, default: true },\n renderer: { type: String as PropType<'canvas' | 'svg'>, default: 'canvas' },\n initOptions: Object as PropType<Record<string, unknown>>,\n },\n emits: ['click', 'dblclick', 'mouseover', 'mouseout', 'legendselectchanged', 'datazoom'],\n setup(props, { attrs, emit, expose }) {\n const chart = ref<InstanceType<typeof VChart>>()\n const option = computed(() => ({ ...buildOption(attrs), ...props.option }))\n expose({\n getEchartsInstance: () => chart.value?.chart,\n resize: () => chart.value?.resize(),\n setOption: (next: EChartsOption) => chart.value?.setOption(next),\n })\n const size = (value: string | number) => (typeof value === 'number' ? `${value}px` : value)\n const rootAttributes = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(\n ([key]) =>\n ['id', 'dir', 'role', 'tabindex', 'title'].includes(key) ||\n key.startsWith('aria-') ||\n (key.startsWith('data-') && key !== 'data'),\n ),\n ),\n )\n return () =>\n h(\n 'div',\n {\n ...rootAttributes.value,\n class: ['mantine-Chart-root', `mantine-${name}-root`, attrs.class],\n style: [{ width: size(props.width), height: size(props.height) }, attrs.style],\n },\n [\n h(VChart, {\n ref: chart,\n option: option.value,\n autoresize: props.autoresize,\n loading: props.loading,\n initOptions: { ...props.initOptions, renderer: props.renderer },\n class: 'mantine-Chart-container',\n onClick: (event: unknown) => emit('click', event),\n onDblclick: (event: unknown) => emit('dblclick', event),\n onMouseover: (event: unknown) => emit('mouseover', event),\n onMouseout: (event: unknown) => emit('mouseout', event),\n onLegendselectchanged: (event: unknown) => emit('legendselectchanged', event),\n onDatazoom: (event: unknown) => emit('datazoom', event),\n }),\n ],\n )\n },\n })\n}\n","const shadeMap: Record<string, string[]> = {\n blue: [\n '#e7f5ff',\n '#d0ebff',\n '#a5d8ff',\n '#74c0fc',\n '#4dabf7',\n '#339af0',\n '#228be6',\n '#1c7ed6',\n '#1971c2',\n '#1864ab',\n ],\n cyan: [\n '#e3fafc',\n '#c5f6fa',\n '#99e9f2',\n '#66d9e8',\n '#3bc9db',\n '#22b8cf',\n '#15aabf',\n '#1098ad',\n '#0c8599',\n '#0b7285',\n ],\n green: [\n '#ebfbee',\n '#d3f9d8',\n '#b2f2bb',\n '#8ce99a',\n '#69db7c',\n '#51cf66',\n '#40c057',\n '#37b24d',\n '#2f9e44',\n '#2b8a3e',\n ],\n grape: [\n '#f8f0fc',\n '#f3d9fa',\n '#eebefa',\n '#e599f7',\n '#da77f2',\n '#cc5de8',\n '#be4bdb',\n '#ae3ec9',\n '#9c36b5',\n '#862e9c',\n ],\n gray: [\n '#f8f9fa',\n '#f1f3f5',\n '#e9ecef',\n '#dee2e6',\n '#ced4da',\n '#adb5bd',\n '#868e96',\n '#495057',\n '#343a40',\n '#212529',\n ],\n orange: [\n '#fff4e6',\n '#ffe8cc',\n '#ffd8a8',\n '#ffc078',\n '#ffa94d',\n '#ff922b',\n '#fd7e14',\n '#f76707',\n '#e8590c',\n '#d9480f',\n ],\n pink: [\n '#fff0f6',\n '#ffdeeb',\n '#fcc2d7',\n '#faa2c1',\n '#f783ac',\n '#f06595',\n '#e64980',\n '#d6336c',\n '#c2255c',\n '#a61e4d',\n ],\n red: [\n '#fff5f5',\n '#ffe3e3',\n '#ffc9c9',\n '#ffa8a8',\n '#ff8787',\n '#ff6b6b',\n '#fa5252',\n '#f03e3e',\n '#e03131',\n '#c92a2a',\n ],\n teal: [\n '#e6fcf5',\n '#c3fae8',\n '#96f2d7',\n '#63e6be',\n '#38d9a9',\n '#20c997',\n '#12b886',\n '#0ca678',\n '#099268',\n '#087f5b',\n ],\n violet: [\n '#f3f0ff',\n '#e5dbff',\n '#d0bfff',\n '#b197fc',\n '#9775fa',\n '#845ef7',\n '#7950f2',\n '#7048e8',\n '#6741d9',\n '#5f3dc4',\n ],\n yellow: [\n '#fff9db',\n '#fff3bf',\n '#ffec99',\n '#ffe066',\n '#ffd43b',\n '#fcc419',\n '#fab005',\n '#f59f00',\n '#f08c00',\n '#e67700',\n ],\n}\n\nexport function resolveColor(color: unknown, fallback = '#228be6'): string {\n if (typeof color !== 'string' || !color) return fallback\n const [name, rawShade] = color.split('.')\n const shade = Number(rawShade ?? 6)\n return shadeMap[name]?.[Number.isInteger(shade) ? shade : 6] ?? color\n}\n","import type { EChartsOption, SeriesOption } from 'echarts'\nimport type { ChartDataItem, ChartReferenceLineProps, ChartSeries } from '../types'\nimport { resolveColor } from './colors'\n\ntype Props = Record<string, unknown>\n\nconst bool = (value: unknown, fallback: boolean) => (typeof value === 'boolean' ? value : fallback)\nconst num = (value: unknown, fallback: number) => (typeof value === 'number' ? value : fallback)\nconst obj = (value: unknown) => (value && typeof value === 'object' ? value : {})\nconst list = <T>(value: unknown): T[] => (Array.isArray(value) ? (value as T[]) : [])\nconst formatter = (props: Props) =>\n typeof props.valueFormatter === 'function'\n ? (props.valueFormatter as (value: number) => string)\n : undefined\n\nfunction tooltip(props: Props): EChartsOption['tooltip'] {\n if (!bool(props.withTooltip, true)) return { show: false }\n const format = formatter(props)\n return {\n trigger: 'axis',\n transitionDuration: num(props.tooltipAnimationDuration, 0) / 1000,\n valueFormatter: format ? (value) => format(Number(value)) : undefined,\n ...obj(props.tooltipProps),\n }\n}\n\nfunction markLine(referenceLines: ChartReferenceLineProps[] | undefined) {\n if (!referenceLines?.length) return undefined\n return {\n silent: true,\n symbol: 'none',\n data: referenceLines.map((line) => ({\n xAxis: line.x,\n yAxis: line.y,\n label: typeof line.label === 'string' ? { formatter: line.label } : line.label,\n lineStyle: {\n color: resolveColor(line.color, '#868e96'),\n type: line.strokeDasharray ? 'dashed' : 'solid',\n },\n })),\n }\n}\n\nexport function cartesianOption(\n props: Props,\n kind: 'line' | 'area' | 'bar' | 'composite',\n): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<\n ChartSeries & {\n type?: string\n stackId?: string\n strokeDasharray?: string | number\n curveType?: string\n }\n >(props.series)\n const dataKey = String(props.dataKey ?? 'name')\n const horizontal = props.orientation !== 'vertical'\n const chartType = String(props.type ?? 'default')\n const category = data.map((item) => item[dataKey] as string | number)\n const commonAxis = { axisLabel: { color: resolveColor(props.textColor, '#868e96') } }\n const categoryAxis = { type: 'category' as const, data: category, ...commonAxis }\n const valueAxis = { type: 'value' as const, name: props.yAxisLabel as string, ...commonAxis }\n const mapped = series.map((item, index) => {\n const itemKind = kind === 'composite' ? (item.type ?? 'line') : kind === 'area' ? 'line' : kind\n const color = resolveColor(item.color, resolveColor(`blue.${6 + (index % 3)}`))\n const stack = chartType === 'stacked' || chartType === 'percent' ? 'stack' : item.stackId\n const base = {\n name: item.label ?? item.name,\n data: data.map((entry) => entry[item.name] as number | null),\n yAxisIndex: item.yAxisId ? 1 : 0,\n stack,\n markLine:\n index === 0\n ? markLine(props.referenceLines as ChartReferenceLineProps[] | undefined)\n : undefined,\n }\n if (itemKind === 'bar') {\n return {\n ...base,\n type: 'bar',\n barMaxWidth: props.maxBarWidth as number,\n barMinHeight: num(props.minBarSize, 0),\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n label: {\n show: bool(props.withBarValueLabel, false),\n position: horizontal ? 'top' : 'right',\n },\n }\n }\n return {\n ...base,\n type: 'line',\n smooth: !['linear', 'step', 'stepBefore', 'stepAfter'].includes(\n String(props.curveType ?? item.curveType ?? 'monotone'),\n ),\n step: String(props.curveType).startsWith('step') ? 'middle' : false,\n connectNulls: bool(props.connectNulls, true),\n showSymbol: bool(props.withDots, true),\n symbolSize: 6,\n lineStyle: {\n color,\n width: num(props.strokeWidth, 2),\n type: item.strokeDasharray ? 'dashed' : 'solid',\n },\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n areaStyle: itemKind === 'area' ? { color, opacity: num(props.fillOpacity, 0.2) } : undefined,\n label: { show: bool(props.withPointLabels, false), position: 'top' },\n }\n }) as unknown as SeriesOption[]\n\n return {\n animationDurationUpdate: num(props.tooltipAnimationDuration, 0),\n color: series.map((item) => resolveColor(item.color)),\n grid: {\n left: 48,\n right: bool(props.withRightYAxis, false) ? 48 : 16,\n top: bool(props.withLegend, false) ? 44 : 16,\n bottom: 38,\n containLabel: true,\n ...obj(props.gridProps),\n },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: tooltip(props),\n xAxis: horizontal\n ? {\n ...categoryAxis,\n show: bool(props.withXAxis, true),\n name: props.xAxisLabel as string,\n ...obj(props.xAxisProps),\n }\n : { ...valueAxis, show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: horizontal\n ? [\n { ...valueAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n {\n ...valueAxis,\n show: bool(props.withRightYAxis, false),\n position: 'right',\n name: props.rightYAxisLabel as string,\n ...obj(props.rightYAxisProps),\n },\n ]\n : { ...categoryAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: mapped,\n }\n}\n\nexport function radialOption(props: Props, donut = false): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n color: data.map((item) => resolveColor(item.color)),\n legend: {\n show: bool(props.withLabels, false) || bool(props.withLegend, false),\n ...obj(props.legendProps),\n },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n series: [\n {\n type: 'pie',\n radius: donut ? [`${num(props.thickness, 40)}%`, '75%'] : ['0%', '75%'],\n startAngle: num(props.startAngle, 90),\n minAngle: num(props.minAngle, 0),\n padAngle: num(props.paddingAngle, 0),\n roseType:\n props.type === 'pie'\n ? undefined\n : props.type === 'donut'\n ? undefined\n : (props.type as 'radius' | 'area'),\n label: {\n show: bool(props.withLabels, false),\n formatter: props.withLabelsLine ? '{b}: {d}%' : '{b}',\n },\n labelLine: { show: bool(props.withLabelsLine, false) },\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n },\n ],\n graphic: props.chartLabel\n ? [\n {\n type: 'text',\n left: 'center',\n top: 'middle',\n style: {\n text: String(props.chartLabel),\n fill: resolveColor(props.chartLabelColor, '#212529'),\n fontSize: num(props.chartLabelFontSize, 18),\n },\n },\n ]\n : undefined,\n }\n}\n\nexport function scatterOption(props: Props, bubble = false): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const xKey = String(props.dataKey ?? props.xAxisKey ?? 'x')\n const yKey = String(props.yAxisKey ?? 'y')\n const zKey = String(props.zAxisKey ?? 'z')\n return {\n grid: { containLabel: true, ...obj(props.gridProps) },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n xAxis: { type: 'value', show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: { type: 'value', show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: (series.length\n ? series\n : [{ name: String(props.name ?? 'value'), color: props.color as string }]\n ).map((item) => ({\n type: 'scatter',\n name: item.label ?? item.name,\n data: data\n .filter((entry) => !entry.name || entry.name === item.name)\n .map((entry) => [entry[xKey], entry[yKey], entry[zKey], entry]),\n symbolSize: bubble\n ? (value: unknown[]) => Math.max(4, Math.sqrt(Number(value[2] ?? 1)) * num(props.range, 4))\n : num(props.size, 10),\n itemStyle: { color: resolveColor(item.color) },\n })) as unknown as SeriesOption[],\n }\n}\n\nexport function sparklineOption(props: Props): EChartsOption {\n const data = list<number | null>(props.data)\n const trend = props.trendColors as\n | { positive?: string; negative?: string; neutral?: string }\n | undefined\n const color = trend\n ? resolveColor(\n data.at(-1)! > data[0]!\n ? trend.positive\n : data.at(-1)! < data[0]!\n ? trend.negative\n : trend.neutral,\n )\n : resolveColor(props.color)\n return {\n grid: { left: 0, right: 0, top: 1, bottom: 1 },\n xAxis: { type: 'category', show: false },\n yAxis: { type: 'value', show: false, scale: true },\n series: [\n {\n type: 'line',\n data,\n showSymbol: false,\n connectNulls: bool(props.connectNulls, true),\n smooth: props.curveType !== 'linear',\n lineStyle: { color, width: num(props.strokeWidth, 2) },\n areaStyle: bool(props.withGradient, true)\n ? { color, opacity: num(props.fillOpacity, 0.6) }\n : undefined,\n },\n ],\n }\n}\n\nexport function radarOption(props: Props): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const key = String(props.dataKey ?? 'name')\n const max = num(\n props.maxValue,\n Math.max(1, ...data.flatMap((row) => series.map((s) => Number(row[s.name] ?? 0)))),\n )\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n radar: {\n indicator: data.map((row) => ({ name: String(row[key]), max })),\n shape: props.shape === 'circle' ? 'circle' : 'polygon',\n },\n series: [\n {\n type: 'radar',\n data: series.map((s) => ({\n name: s.label ?? s.name,\n value: data.map((row) => Number(row[s.name] ?? 0)),\n lineStyle: { color: resolveColor(s.color) },\n itemStyle: { color: resolveColor(s.color) },\n areaStyle: bool(props.withPolarGrid, false) ? {} : undefined,\n })),\n },\n ],\n }\n}\n\nexport function simpleOption(type: 'funnel' | 'treemap' | 'sankey', props: Props): EChartsOption {\n const data = list<Record<string, unknown>>(props.data)\n if (type === 'sankey')\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n series: [\n {\n type,\n data: list(props.nodes ?? data),\n links: list(props.links),\n emphasis: { focus: 'adjacency' },\n ...obj(props.sankeyProps),\n },\n ],\n }\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n legend: { show: bool(props.withLegend, false) },\n series: [\n {\n type,\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n ...obj(props[`${type}Props`]),\n },\n ],\n }\n}\n\nexport function radialBarOption(props: Props): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n polar: {},\n angleAxis: { max: num(props.maxValue, 100), show: false },\n radiusAxis: {\n type: 'category',\n data: data.map((i) => i.name),\n show: bool(props.withLabels, true),\n },\n series: [\n {\n type: 'bar',\n coordinateSystem: 'polar',\n roundCap: true,\n data: data.map((i) => ({ value: i.value, itemStyle: { color: resolveColor(i.color) } })),\n },\n ],\n }\n}\n\nexport function heatmapOption(props: Props): EChartsOption {\n const input =\n props.data && typeof props.data === 'object' ? (props.data as Record<string, number>) : {}\n const data = Object.entries(input).map(([date, value]) => [date, value])\n const values = Object.values(input)\n const date = (value: unknown, fallback: string) =>\n value instanceof Date\n ? value.toISOString().slice(0, 10)\n : typeof value === 'string'\n ? value\n : fallback\n const start = date(props.startDate, String(data[0]?.[0] ?? new Date().toISOString().slice(0, 10)))\n const end = date(props.endDate, String(data.at(-1)?.[0] ?? start))\n return {\n tooltip: { show: bool(props.withTooltip, false) },\n visualMap: {\n show: bool(props.withLegend, false),\n min: (props.domain as number[] | undefined)?.[0] ?? Math.min(0, ...values),\n max: (props.domain as number[] | undefined)?.[1] ?? Math.max(1, ...values),\n inRange: {\n color: list<string>(props.colors).length\n ? list<string>(props.colors).map((color) => resolveColor(color))\n : ['#ebfbee', '#2f9e44'],\n },\n orient: 'horizontal',\n left: 'center',\n bottom: 0,\n },\n calendar: {\n range: [start, end],\n cellSize: num(props.rectSize, 10) + num(props.gap, 1),\n dayLabel: {\n show: bool(props.withWeekdayLabels, false),\n firstDay: num(props.firstDayOfWeek, 1),\n },\n monthLabel: { show: bool(props.withMonthLabels, false) },\n itemStyle: {\n borderWidth: num(props.gap, 1),\n borderColor: 'transparent',\n borderRadius: num(props.rectRadius, 2),\n },\n },\n series: [{ type: 'heatmap', coordinateSystem: 'calendar', data }],\n }\n}\n","import type { MantineColor } from '@mantine-vue/core'\nimport type { DefineComponent, HTMLAttributes, VNodeChild } from 'vue'\nimport { createChartComponent } from './internal/component'\nimport {\n cartesianOption,\n heatmapOption,\n radarOption,\n radialBarOption,\n radialOption,\n scatterOption,\n simpleOption,\n sparklineOption,\n} from './internal/options'\nimport type {\n ChartData,\n ChartOptionProps,\n ChartRootProps,\n ChartSeries,\n GridChartBaseProps,\n MantineChartDotProps,\n} from './types'\n\nexport type LineChartCurveType =\n | 'bump'\n | 'linear'\n | 'natural'\n | 'monotone'\n | 'step'\n | 'stepBefore'\n | 'stepAfter'\nexport type AreaChartCurveType = LineChartCurveType\nexport type CompositeChartCurveType = LineChartCurveType\nexport interface LineChartSeries extends ChartSeries {\n strokeDasharray?: string | number\n curveType?: LineChartCurveType\n}\nexport interface AreaChartSeries extends ChartSeries {\n color: MantineColor\n strokeDasharray?: string | number\n curveType?: AreaChartCurveType\n}\nexport interface BarChartSeries extends ChartSeries {\n stackId?: string\n}\nexport interface CompositeChartSeries extends ChartSeries {\n type: 'line' | 'area' | 'bar'\n strokeDasharray?: string | number\n}\n\nexport interface LineChartProps extends GridChartBaseProps {\n series: LineChartSeries[]\n type?: 'default' | 'gradient'\n gradientStops?: { offset: number; color: MantineColor }[]\n curveType?: LineChartCurveType\n fillOpacity?: number\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n lineChartProps?: ChartOptionProps\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: LineChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface AreaChartProps extends GridChartBaseProps {\n series: AreaChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'split'\n withGradient?: boolean\n curveType?: AreaChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n areaChartProps?: ChartOptionProps\n fillOpacity?: number\n splitColors?: [MantineColor, MantineColor]\n splitOffset?: number\n connectNulls?: boolean\n areaProps?: ChartOptionProps | ((series: AreaChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface BarChartProps extends GridChartBaseProps {\n series: BarChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'waterfall'\n fillOpacity?: number\n cursorFill?: MantineColor\n barChartProps?: ChartOptionProps\n barProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n withBarValueLabel?: boolean\n valueLabelProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n minBarSize?: number\n maxBarWidth?: number\n barLabelColor?: MantineColor\n getBarColor?: (value: number, series: BarChartSeries) => MantineColor\n}\nexport interface CompositeChartProps extends Omit<GridChartBaseProps, 'orientation'> {\n series: CompositeChartSeries[]\n curveType?: CompositeChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n areaProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n barProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n withBarValueLabel?: boolean\n minBarSize?: number\n maxBarWidth?: number\n composedChartProps?: ChartOptionProps\n}\n\nexport interface PieChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface PieChartProps extends ChartRootProps {\n data: PieChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLabelsLine?: boolean\n labelsPosition?: 'inside' | 'outside'\n labelsType?: 'value' | 'percent'\n tooltipDataSource?: 'segment' | 'all'\n valueFormatter?: (value: number) => string\n strokeWidth?: number\n size?: number\n startAngle?: number\n endAngle?: number\n paddingAngle?: number\n pieProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\nexport interface DonutChartProps extends PieChartProps {\n thickness?: number\n chartLabel?: string\n chartLabelColor?: MantineColor\n chartLabelFontSize?: number\n chartLabelProps?: ChartOptionProps\n}\n\nexport interface ScatterChartSeries extends ChartSeries {\n data?: ChartData\n}\nexport interface ScatterChartProps extends GridChartBaseProps {\n data: ChartData\n series: ScatterChartSeries[]\n xAxisKey?: string\n yAxisKey?: string\n scatterProps?: ChartOptionProps | ((series: ScatterChartSeries) => ChartOptionProps)\n}\nexport interface BubbleChartProps extends ChartRootProps {\n data: ChartData\n xAxisKey?: string\n yAxisKey?: string\n zAxisKey?: string\n name?: string\n color?: MantineColor\n range?: number\n withTooltip?: boolean\n withXAxis?: boolean\n withYAxis?: boolean\n xAxisProps?: ChartOptionProps\n yAxisProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n gridProps?: ChartOptionProps\n valueFormatter?: (value: number) => string\n}\n\nexport interface RadarChartProps extends GridChartBaseProps {\n series: ChartSeries[]\n maxValue?: number\n withPolarGrid?: boolean\n withAngleAxis?: boolean\n withRadiusAxis?: boolean\n shape?: 'polygon' | 'circle'\n radarProps?: ChartOptionProps\n}\nexport interface RadialBarChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface RadialBarChartProps extends ChartRootProps {\n data: RadialBarChartCell[]\n maxValue?: number\n withLabels?: boolean\n withLegend?: boolean\n withTooltip?: boolean\n startAngle?: number\n endAngle?: number\n barSize?: number\n radialBarProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n legendProps?: ChartOptionProps\n}\nexport interface FunnelChartCell extends PieChartCell {\n label?: string\n}\nexport interface FunnelChartProps extends ChartRootProps {\n data: FunnelChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n funnelProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\n\nexport interface TreemapData {\n name: string\n value?: number\n color?: MantineColor\n children?: TreemapData[]\n}\nexport interface TreemapProps extends ChartRootProps {\n data: TreemapData[]\n withTooltip?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n treemapProps?: ChartOptionProps\n}\nexport interface SankeyChartNode {\n name: string\n color?: MantineColor\n [key: string]: unknown\n}\nexport interface SankeyChartLink {\n source: string | number\n target: string | number\n value: number\n [key: string]: unknown\n}\nexport interface SankeyChartProps extends ChartRootProps {\n data?: SankeyChartNode[]\n nodes?: SankeyChartNode[]\n links: SankeyChartLink[]\n withTooltip?: boolean\n valueFormatter?: (value: number) => string\n sankeyProps?: ChartOptionProps\n}\n\nexport interface SparklineTrendColors {\n positive: MantineColor\n negative: MantineColor\n neutral?: MantineColor\n}\nexport interface SparklineProps extends ChartRootProps {\n data: (number | null)[]\n color?: MantineColor\n withGradient?: boolean\n fillOpacity?: number\n curveType?: LineChartCurveType\n strokeWidth?: number\n trendColors?: SparklineTrendColors\n connectNulls?: boolean\n areaProps?: ChartOptionProps\n}\nexport interface HeatmapRectData {\n date: string\n value: number | null\n}\nexport interface HeatmapProps extends ChartRootProps {\n data: Record<string, number>\n domain?: [number, number]\n startDate?: Date | string\n endDate?: Date | string\n withMonthLabels?: boolean\n monthLabels?: string[]\n withWeekdayLabels?: boolean\n weekdayLabels?: string[]\n withOutsideDates?: boolean\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n rectSize?: number\n gap?: number\n rectRadius?: number\n colors?: string[]\n weekdaysLabelsWidth?: number\n monthsLabelsHeight?: number\n fontSize?: number\n getTooltipLabel?: (input: HeatmapRectData) => VNodeChild\n withTooltip?: boolean\n tooltipProps?: ChartOptionProps\n getRectProps?: (input: HeatmapRectData) => Record<string, unknown>\n splitMonths?: boolean\n withLegend?: boolean\n legendLabels?: [string, string]\n}\n\nexport interface BarsListBarData {\n name: string\n value: number\n color?: MantineColor\n textColor?: MantineColor\n variant?: 'light' | 'filled'\n}\nexport interface BarsListProps extends ChartRootProps {\n data: BarsListBarData[]\n valueFormatter?: (value: number) => string\n barsLabel?: string\n valueLabel?: string\n getBarProps?: (data: BarsListBarData) => HTMLAttributes\n renderBar?: (data: BarsListBarData, defaultBar: VNodeChild) => VNodeChild\n barGap?: string | number\n minBarSize?: string | number\n barHeight?: string | number\n barColor?: MantineColor\n barTextColor?: MantineColor\n autoContrast?: boolean\n}\n\ntype PublicComponent<P> = DefineComponent<P>\nexport const AreaChart = createChartComponent('AreaChart', (p) =>\n cartesianOption(p, 'area'),\n) as PublicComponent<AreaChartProps>\nexport const BarChart = createChartComponent('BarChart', (p) =>\n cartesianOption(p, 'bar'),\n) as PublicComponent<BarChartProps>\nexport const LineChart = createChartComponent('LineChart', (p) =>\n cartesianOption(p, 'line'),\n) as PublicComponent<LineChartProps>\nexport const CompositeChart = createChartComponent('CompositeChart', (p) =>\n cartesianOption(p, 'composite'),\n) as PublicComponent<CompositeChartProps>\nexport const PieChart = createChartComponent('PieChart', (p) =>\n radialOption(p),\n) as PublicComponent<PieChartProps>\nexport const DonutChart = createChartComponent('DonutChart', (p) =>\n radialOption(p, true),\n) as PublicComponent<DonutChartProps>\nexport const ScatterChart = createChartComponent('ScatterChart', (p) =>\n scatterOption(p),\n) as PublicComponent<ScatterChartProps>\nexport const BubbleChart = createChartComponent('BubbleChart', (p) =>\n scatterOption(p, true),\n) as PublicComponent<BubbleChartProps>\nexport const RadarChart = createChartComponent(\n 'RadarChart',\n radarOption,\n) as PublicComponent<RadarChartProps>\nexport const RadialBarChart = createChartComponent(\n 'RadialBarChart',\n radialBarOption,\n) as PublicComponent<RadialBarChartProps>\nexport const FunnelChart = createChartComponent('FunnelChart', (p) =>\n simpleOption('funnel', p),\n) as PublicComponent<FunnelChartProps>\nexport const Treemap = createChartComponent('Treemap', (p) =>\n simpleOption('treemap', p),\n) as PublicComponent<TreemapProps>\nexport const SankeyChart = createChartComponent('SankeyChart', (p) =>\n simpleOption('sankey', p),\n) as PublicComponent<SankeyChartProps>\nexport const Sparkline = createChartComponent(\n 'Sparkline',\n sparklineOption,\n) as PublicComponent<SparklineProps>\nexport const Heatmap = createChartComponent(\n 'Heatmap',\n heatmapOption,\n) as PublicComponent<HeatmapProps>\nexport const BarsList = createChartComponent('BarsList', (p) =>\n cartesianOption(\n {\n ...p,\n dataKey: 'name',\n series: [{ name: 'value', color: p.barColor }],\n orientation: 'vertical',\n withXAxis: false,\n withYAxis: true,\n withTooltip: false,\n maxBarWidth: p.barHeight,\n },\n 'bar',\n ),\n) as PublicComponent<BarsListProps>\n\nexport type AreaChartStylesNames =\n | 'area'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BarChartStylesNames =\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type LineChartStylesNames =\n | 'line'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type CompositeChartStylesNames =\n | 'line'\n | 'area'\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type PieChartStylesNames = 'root' | 'label'\nexport type DonutChartStylesNames = PieChartStylesNames\nexport type ScatterChartStylesNames =\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BubbleChartStylesNames = ScatterChartStylesNames\nexport type RadarChartStylesNames =\n | 'root'\n | 'container'\n | 'axis'\n | 'grid'\n | 'curve'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type RadialBarChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type FunnelChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type TreemapStylesNames = 'root' | 'container'\nexport type SankeyChartStylesNames = 'root' | 'container'\nexport type SparklineStylesNames = 'root'\nexport type HeatmapStylesNames =\n | 'root'\n | 'rect'\n | 'weekdayLabel'\n | 'monthLabel'\n | 'legend'\n | 'legendLabel'\n | 'legendRect'\nexport type BarsListStylesNames = 'root' | 'bar' | 'barLabel' | 'barValue' | 'labelsRow'\n\nexport type ChartTooltipStylesNames =\n | 'tooltip'\n | 'tooltipItem'\n | 'tooltipItemBody'\n | 'tooltipItemColor'\n | 'tooltipItemName'\n | 'tooltipItemData'\n | 'tooltipLabel'\n | 'tooltipBody'\nexport type ChartLegendStylesNames = 'legendItem' | 'legendItemColor' | 'legendItemName' | 'legend'\nexport type ChartCssVariables = Record<string, string>\n","import { computed, defineComponent, h, type PropType } from 'vue'\nimport type { ChartRenderable, ChartSeries, ChartTooltipPayload } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartTooltipProps {\n label?: ChartRenderable\n payload?: readonly ChartTooltipPayload[]\n unit?: string\n type?: 'area' | 'radial' | 'scatter'\n segmentId?: string\n series?: ChartSeries[]\n valueFormatter?: (value: number) => ChartRenderable\n showColor?: boolean\n}\n\nexport const ChartTooltip = defineComponent({\n name: 'MantineChartTooltip',\n props: {\n label: null,\n payload: Array as PropType<readonly ChartTooltipPayload[]>,\n unit: String,\n type: { type: String as PropType<ChartTooltipProps['type']>, default: 'area' },\n segmentId: String,\n series: Array as PropType<ChartSeries[]>,\n valueFormatter: Function as PropType<(value: number) => ChartRenderable>,\n showColor: { type: Boolean, default: true },\n },\n setup(props) {\n const labels = computed(() =>\n Object.fromEntries((props.series ?? []).map((item) => [item.name, item.label ?? item.name])),\n )\n return () => {\n const payload = props.segmentId\n ? props.payload?.filter(\n (item) => item.name === props.segmentId || item.dataKey === props.segmentId,\n )\n : props.payload\n if (!payload?.length) return null\n return h('div', { class: 'mantine-ChartTooltip-tooltip', 'data-type': props.type }, [\n props.label != null\n ? h('div', { class: 'mantine-ChartTooltip-tooltipLabel' }, [props.label])\n : null,\n h(\n 'div',\n { class: 'mantine-ChartTooltip-tooltipBody' },\n payload.map((item) =>\n h('div', { class: 'mantine-ChartTooltip-tooltipItem' }, [\n h('div', { class: 'mantine-ChartTooltip-tooltipItemBody' }, [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartTooltip-tooltipItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h(\n 'span',\n { class: 'mantine-ChartTooltip-tooltipItemName' },\n labels.value[item.name ?? ''] ?? item.name,\n ),\n ]),\n h(\n 'span',\n { class: 'mantine-ChartTooltip-tooltipItemData' },\n `${props.valueFormatter ? props.valueFormatter(Number(item.value)) : (item.value ?? '')}${props.unit ?? item.unit ?? ''}`,\n ),\n ]),\n ),\n ),\n ])\n }\n },\n})\n","import { defineComponent, h, type PropType } from 'vue'\nimport type { ChartSeries } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartLegendPayload {\n dataKey?: string\n name?: string\n color?: string\n [key: string]: unknown\n}\nexport interface ChartLegendProps {\n payload?: readonly ChartLegendPayload[]\n onHighlight: (area: string | null) => void\n legendPosition: 'top' | 'bottom' | 'middle'\n series?: ChartSeries[]\n showColor?: boolean\n centered?: boolean\n}\n\nexport const ChartLegend = defineComponent({\n name: 'MantineChartLegend',\n props: {\n payload: Array as PropType<readonly ChartLegendPayload[]>,\n onHighlight: { type: Function as PropType<(area: string | null) => void>, required: true },\n legendPosition: {\n type: String as PropType<ChartLegendProps['legendPosition']>,\n required: true,\n },\n series: Array as PropType<ChartSeries[]>,\n showColor: { type: Boolean, default: true },\n centered: Boolean,\n },\n setup(props) {\n return () =>\n h(\n 'div',\n {\n class: 'mantine-ChartLegend-legend',\n 'data-position': props.legendPosition,\n 'data-centered': props.centered || undefined,\n onMouseleave: () => props.onHighlight(null),\n },\n props.payload?.map((item) => {\n const key = item.dataKey ?? item.name ?? ''\n const label = props.series?.find((s) => s.name === key)?.label ?? key\n return h(\n 'div',\n { class: 'mantine-ChartLegend-legendItem', onMouseenter: () => props.onHighlight(key) },\n [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartLegend-legendItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h('span', { class: 'mantine-ChartLegend-legendItemName' }, label),\n ],\n )\n }),\n )\n },\n})\n","import type { ChartSeries } from '../../types'\nexport function getSeriesLabels(series: ChartSeries[] | undefined): Record<string, string> {\n return Object.fromEntries((series ?? []).map((item) => [item.name,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CACF,CACF;GACA,aACE,EACE,OACA;IACE,GAAG,eAAe;IAClB,OAAO;KAAC;KAAsB,WAAW,KAAK;KAAQ,MAAM;IAAK;IACjE,OAAO,CAAC;KAAE,OAAO,KAAK,MAAM,KAAK;KAAG,QAAQ,KAAK,MAAM,MAAM;IAAE,GAAG,MAAM,KAAK;GAC/E,GACA,CACE,EAAE,QAAQ;IACR,KAAK;IACL,QAAQ,OAAO;IACf,YAAY,MAAM;IAClB,SAAS,MAAM;IACf,aAAa;KAAE,GAAG,MAAM;KAAa,UAAU,MAAM;IAAS;IAC9D,OAAO;IACP,UAAU,UAAmB,KAAK,SAAS,KAAK;IAChD,aAAa,UAAmB,KAAK,YAAY,KAAK;IACtD,cAAc,UAAmB,KAAK,aAAa,KAAK;IACxD,aAAa,UAAmB,KAAK,YAAY,KAAK;IACtD,wBAAwB,UAAmB,KAAK,uBAAuB,KAAK;IAC5E,aAAa,UAAmB,KAAK,YAAY,KAAK;GACxD,CAAC,CACH,CACF;EACJ;CACF,CAAC;AACH;;;ACrEA,IAAM,WAAqC;CACzC,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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ACR,OAAO;IACP,OAAO,EAAE,YAAY,aAAa,KAAK,KAAK,EAAE;GAChD,CAAC,IACD,MACJ,EAAE,QAAQ,EAAE,OAAO,qCAAqC,GAAG,KAAK,CAClE,CACF;EACF,CAAC,CACH;CACJ;AACF,CAAC;;;AC5DD,SAAgB,gBAAgB,QAA2D;CACzF,OAAO,OAAO,aAAa,UAAU,CAAC,GAAG,KAAK,SAAS,CAAC,KAAK,MAAM,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9F"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/internal/echarts.ts","../src/internal/component.ts","../src/internal/colors.ts","../src/internal/options.ts","../src/charts.ts","../src/ChartTooltip/ChartTooltip.ts","../src/ChartLegend/ChartLegend.ts","../src/utils/get-series-labels/get-series-labels.ts"],"sourcesContent":["import { use } from 'echarts/core'\nimport {\n BarChart as EBarChart,\n EffectScatterChart,\n FunnelChart as EFunnelChart,\n GaugeChart,\n GraphChart,\n HeatmapChart as EHeatmapChart,\n LineChart as ELineChart,\n PieChart as EPieChart,\n RadarChart as ERadarChart,\n SankeyChart as ESankeyChart,\n ScatterChart as EScatterChart,\n TreemapChart as ETreemapChart,\n} from 'echarts/charts'\nimport {\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n} from 'echarts/components'\nimport { CanvasRenderer, SVGRenderer } from 'echarts/renderers'\n\nlet registered = false\n\nexport function registerECharts(): void {\n if (registered) {\n return\n }\n\n use([\n EBarChart,\n EffectScatterChart,\n EFunnelChart,\n GaugeChart,\n GraphChart,\n EHeatmapChart,\n ELineChart,\n EPieChart,\n ERadarChart,\n ESankeyChart,\n EScatterChart,\n ETreemapChart,\n AriaComponent,\n CalendarComponent,\n DatasetComponent,\n DataZoomComponent,\n GraphicComponent,\n GridComponent,\n LegendComponent,\n MarkLineComponent,\n PolarComponent,\n RadarComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n TransformComponent,\n VisualMapComponent,\n CanvasRenderer,\n SVGRenderer,\n ])\n\n registered = true\n}\n","import { computed, defineComponent, h, ref, type Component, type PropType } from 'vue'\nimport type { EChartsOption } from 'echarts'\nimport VChart from 'vue-echarts'\nimport { registerECharts } from './echarts'\n\nregisterECharts()\n\nexport type OptionBuilder = (props: Record<string, unknown>) => EChartsOption\n\nexport function createChartComponent(name: string, buildOption: OptionBuilder): Component {\n return defineComponent({\n name: `Mantine${name}`,\n inheritAttrs: false,\n props: {\n option: Object as PropType<EChartsOption>,\n height: { type: [Number, String], default: 300 },\n width: { type: [Number, String], default: '100%' },\n loading: Boolean,\n autoresize: { type: Boolean, default: true },\n renderer: { type: String as PropType<'canvas' | 'svg'>, default: 'canvas' },\n initOptions: Object as PropType<Record<string, unknown>>,\n },\n emits: ['click', 'dblclick', 'mouseover', 'mouseout', 'legendselectchanged', 'datazoom'],\n setup(props, { attrs, emit, expose }) {\n const chart = ref<InstanceType<typeof VChart>>()\n const option = computed(() => ({ ...buildOption(attrs), ...props.option }))\n expose({\n getEchartsInstance: () => chart.value?.chart,\n resize: () => chart.value?.resize(),\n setOption: (next: EChartsOption) => chart.value?.setOption(next),\n })\n const size = (value: string | number) => (typeof value === 'number' ? `${value}px` : value)\n const rootAttributes = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(\n ([key]) =>\n ['id', 'dir', 'role', 'tabindex', 'title'].includes(key) ||\n key.startsWith('aria-') ||\n (key.startsWith('data-') && key !== 'data'),\n ),\n ),\n )\n return () =>\n h(\n 'div',\n {\n ...rootAttributes.value,\n class: ['mantine-Chart-root', `mantine-${name}-root`, attrs.class],\n style: [{ width: size(props.width), height: size(props.height) }, attrs.style],\n },\n [\n h(VChart, {\n ref: chart,\n option: option.value,\n autoresize: props.autoresize,\n loading: props.loading,\n initOptions: { ...props.initOptions, renderer: props.renderer },\n class: 'mantine-Chart-container',\n onClick: (event: unknown) => emit('click', event),\n onDblclick: (event: unknown) => emit('dblclick', event),\n onMouseover: (event: unknown) => emit('mouseover', event),\n onMouseout: (event: unknown) => emit('mouseout', event),\n onLegendselectchanged: (event: unknown) => emit('legendselectchanged', event),\n onDatazoom: (event: unknown) => emit('datazoom', event),\n }),\n ],\n )\n },\n })\n}\n","const shadeMap: Record<string, string[]> = {\n blue: [\n '#e7f5ff',\n '#d0ebff',\n '#a5d8ff',\n '#74c0fc',\n '#4dabf7',\n '#339af0',\n '#228be6',\n '#1c7ed6',\n '#1971c2',\n '#1864ab',\n ],\n cyan: [\n '#e3fafc',\n '#c5f6fa',\n '#99e9f2',\n '#66d9e8',\n '#3bc9db',\n '#22b8cf',\n '#15aabf',\n '#1098ad',\n '#0c8599',\n '#0b7285',\n ],\n green: [\n '#ebfbee',\n '#d3f9d8',\n '#b2f2bb',\n '#8ce99a',\n '#69db7c',\n '#51cf66',\n '#40c057',\n '#37b24d',\n '#2f9e44',\n '#2b8a3e',\n ],\n grape: [\n '#f8f0fc',\n '#f3d9fa',\n '#eebefa',\n '#e599f7',\n '#da77f2',\n '#cc5de8',\n '#be4bdb',\n '#ae3ec9',\n '#9c36b5',\n '#862e9c',\n ],\n gray: [\n '#f8f9fa',\n '#f1f3f5',\n '#e9ecef',\n '#dee2e6',\n '#ced4da',\n '#adb5bd',\n '#868e96',\n '#495057',\n '#343a40',\n '#212529',\n ],\n orange: [\n '#fff4e6',\n '#ffe8cc',\n '#ffd8a8',\n '#ffc078',\n '#ffa94d',\n '#ff922b',\n '#fd7e14',\n '#f76707',\n '#e8590c',\n '#d9480f',\n ],\n pink: [\n '#fff0f6',\n '#ffdeeb',\n '#fcc2d7',\n '#faa2c1',\n '#f783ac',\n '#f06595',\n '#e64980',\n '#d6336c',\n '#c2255c',\n '#a61e4d',\n ],\n red: [\n '#fff5f5',\n '#ffe3e3',\n '#ffc9c9',\n '#ffa8a8',\n '#ff8787',\n '#ff6b6b',\n '#fa5252',\n '#f03e3e',\n '#e03131',\n '#c92a2a',\n ],\n teal: [\n '#e6fcf5',\n '#c3fae8',\n '#96f2d7',\n '#63e6be',\n '#38d9a9',\n '#20c997',\n '#12b886',\n '#0ca678',\n '#099268',\n '#087f5b',\n ],\n violet: [\n '#f3f0ff',\n '#e5dbff',\n '#d0bfff',\n '#b197fc',\n '#9775fa',\n '#845ef7',\n '#7950f2',\n '#7048e8',\n '#6741d9',\n '#5f3dc4',\n ],\n yellow: [\n '#fff9db',\n '#fff3bf',\n '#ffec99',\n '#ffe066',\n '#ffd43b',\n '#fcc419',\n '#fab005',\n '#f59f00',\n '#f08c00',\n '#e67700',\n ],\n}\n\nexport function resolveColor(color: unknown, fallback = '#228be6'): string {\n if (typeof color !== 'string' || !color) return fallback\n const [name, rawShade] = color.split('.')\n const shade = Number(rawShade ?? 6)\n return shadeMap[name]?.[Number.isInteger(shade) ? shade : 6] ?? color\n}\n","import type { EChartsOption, SeriesOption } from 'echarts'\nimport type { ChartDataItem, ChartReferenceLineProps, ChartSeries } from '../types'\nimport { resolveColor } from './colors'\n\ntype Props = Record<string, unknown>\n\nconst bool = (value: unknown, fallback: boolean) => (typeof value === 'boolean' ? value : fallback)\nconst num = (value: unknown, fallback: number) => (typeof value === 'number' ? value : fallback)\nconst obj = (value: unknown) => (value && typeof value === 'object' ? value : {})\nconst list = <T>(value: unknown): T[] => (Array.isArray(value) ? (value as T[]) : [])\nconst formatter = (props: Props) =>\n typeof props.valueFormatter === 'function'\n ? (props.valueFormatter as (value: number) => string)\n : undefined\n\nfunction tooltip(props: Props): EChartsOption['tooltip'] {\n if (!bool(props.withTooltip, true)) return { show: false }\n const format = formatter(props)\n return {\n trigger: 'axis',\n transitionDuration: num(props.tooltipAnimationDuration, 0) / 1000,\n valueFormatter: format ? (value) => format(Number(value)) : undefined,\n ...obj(props.tooltipProps),\n }\n}\n\nfunction markLine(referenceLines: ChartReferenceLineProps[] | undefined) {\n if (!referenceLines?.length) return undefined\n return {\n silent: true,\n symbol: 'none',\n data: referenceLines.map((line) => ({\n xAxis: line.x,\n yAxis: line.y,\n label: typeof line.label === 'string' ? { formatter: line.label } : line.label,\n lineStyle: {\n color: resolveColor(line.color, '#868e96'),\n type: line.strokeDasharray ? 'dashed' : 'solid',\n },\n })),\n }\n}\n\nexport function cartesianOption(\n props: Props,\n kind: 'line' | 'area' | 'bar' | 'composite',\n): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<\n ChartSeries & {\n type?: string\n stackId?: string\n strokeDasharray?: string | number\n curveType?: string\n }\n >(props.series)\n const dataKey = String(props.dataKey ?? 'name')\n const horizontal = props.orientation !== 'vertical'\n const chartType = String(props.type ?? 'default')\n const category = data.map((item) => item[dataKey] as string | number)\n const commonAxis = { axisLabel: { color: resolveColor(props.textColor, '#868e96') } }\n const categoryAxis = { type: 'category' as const, data: category, ...commonAxis }\n const valueAxis = { type: 'value' as const, name: props.yAxisLabel as string, ...commonAxis }\n const mapped = series.map((item, index) => {\n const itemKind = kind === 'composite' ? (item.type ?? 'line') : kind === 'area' ? 'line' : kind\n const color = resolveColor(item.color, resolveColor(`blue.${6 + (index % 3)}`))\n const stack = chartType === 'stacked' || chartType === 'percent' ? 'stack' : item.stackId\n const base = {\n name: item.label ?? item.name,\n data: data.map((entry) => entry[item.name] as number | null),\n yAxisIndex: item.yAxisId ? 1 : 0,\n stack,\n markLine:\n index === 0\n ? markLine(props.referenceLines as ChartReferenceLineProps[] | undefined)\n : undefined,\n }\n if (itemKind === 'bar') {\n return {\n ...base,\n type: 'bar',\n barMaxWidth: props.maxBarWidth as number,\n barMinHeight: num(props.minBarSize, 0),\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n label: {\n show: bool(props.withBarValueLabel, false),\n position: horizontal ? 'top' : 'right',\n },\n }\n }\n return {\n ...base,\n type: 'line',\n smooth: !['linear', 'step', 'stepBefore', 'stepAfter'].includes(\n String(props.curveType ?? item.curveType ?? 'monotone'),\n ),\n step: String(props.curveType).startsWith('step') ? 'middle' : false,\n connectNulls: bool(props.connectNulls, true),\n showSymbol: bool(props.withDots, true),\n symbolSize: 6,\n lineStyle: {\n color,\n width: num(props.strokeWidth, 2),\n type: item.strokeDasharray ? 'dashed' : 'solid',\n },\n itemStyle: { color, opacity: num(props.fillOpacity, 1) },\n areaStyle: itemKind === 'area' ? { color, opacity: num(props.fillOpacity, 0.2) } : undefined,\n label: { show: bool(props.withPointLabels, false), position: 'top' },\n }\n }) as unknown as SeriesOption[]\n\n return {\n animationDurationUpdate: num(props.tooltipAnimationDuration, 0),\n color: series.map((item) => resolveColor(item.color)),\n grid: {\n left: 48,\n right: bool(props.withRightYAxis, false) ? 48 : 16,\n top: bool(props.withLegend, false) ? 44 : 16,\n bottom: 38,\n containLabel: true,\n ...obj(props.gridProps),\n },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: tooltip(props),\n xAxis: horizontal\n ? {\n ...categoryAxis,\n show: bool(props.withXAxis, true),\n name: props.xAxisLabel as string,\n ...obj(props.xAxisProps),\n }\n : { ...valueAxis, show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: horizontal\n ? [\n { ...valueAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n {\n ...valueAxis,\n show: bool(props.withRightYAxis, false),\n position: 'right',\n name: props.rightYAxisLabel as string,\n ...obj(props.rightYAxisProps),\n },\n ]\n : { ...categoryAxis, show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: mapped,\n }\n}\n\nexport function radialOption(props: Props, donut = false): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n color: data.map((item) => resolveColor(item.color)),\n legend: {\n show: bool(props.withLabels, false) || bool(props.withLegend, false),\n ...obj(props.legendProps),\n },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n series: [\n {\n type: 'pie',\n radius: donut ? [`${num(props.thickness, 40)}%`, '75%'] : ['0%', '75%'],\n startAngle: num(props.startAngle, 90),\n minAngle: num(props.minAngle, 0),\n padAngle: num(props.paddingAngle, 0),\n roseType:\n props.type === 'pie'\n ? undefined\n : props.type === 'donut'\n ? undefined\n : (props.type as 'radius' | 'area'),\n label: {\n show: bool(props.withLabels, false),\n formatter: props.withLabelsLine ? '{b}: {d}%' : '{b}',\n },\n labelLine: { show: bool(props.withLabelsLine, false) },\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n },\n ],\n graphic: props.chartLabel\n ? [\n {\n type: 'text',\n left: 'center',\n top: 'middle',\n style: {\n text: String(props.chartLabel),\n fill: resolveColor(props.chartLabelColor, '#212529'),\n fontSize: num(props.chartLabelFontSize, 18),\n },\n },\n ]\n : undefined,\n }\n}\n\nexport function scatterOption(props: Props, bubble = false): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const xKey = String(props.dataKey ?? props.xAxisKey ?? 'x')\n const yKey = String(props.yAxisKey ?? 'y')\n const zKey = String(props.zAxisKey ?? 'z')\n return {\n grid: { containLabel: true, ...obj(props.gridProps) },\n legend: { show: bool(props.withLegend, false), ...obj(props.legendProps) },\n tooltip: { trigger: 'item', show: bool(props.withTooltip, true), ...obj(props.tooltipProps) },\n xAxis: { type: 'value', show: bool(props.withXAxis, true), ...obj(props.xAxisProps) },\n yAxis: { type: 'value', show: bool(props.withYAxis, true), ...obj(props.yAxisProps) },\n series: (series.length\n ? series\n : [{ name: String(props.name ?? 'value'), color: props.color as string }]\n ).map((item) => ({\n type: 'scatter',\n name: item.label ?? item.name,\n data: data\n .filter((entry) => !entry.name || entry.name === item.name)\n .map((entry) => [entry[xKey], entry[yKey], entry[zKey], entry]),\n symbolSize: bubble\n ? (value: unknown[]) => Math.max(4, Math.sqrt(Number(value[2] ?? 1)) * num(props.range, 4))\n : num(props.size, 10),\n itemStyle: { color: resolveColor(item.color) },\n })) as unknown as SeriesOption[],\n }\n}\n\nexport function sparklineOption(props: Props): EChartsOption {\n const data = list<number | null>(props.data)\n const trend = props.trendColors as\n | { positive?: string; negative?: string; neutral?: string }\n | undefined\n const color = trend\n ? resolveColor(\n data.at(-1)! > data[0]!\n ? trend.positive\n : data.at(-1)! < data[0]!\n ? trend.negative\n : trend.neutral,\n )\n : resolveColor(props.color)\n return {\n grid: { left: 0, right: 0, top: 1, bottom: 1 },\n xAxis: { type: 'category', show: false },\n yAxis: { type: 'value', show: false, scale: true },\n series: [\n {\n type: 'line',\n data,\n showSymbol: false,\n connectNulls: bool(props.connectNulls, true),\n smooth: props.curveType !== 'linear',\n lineStyle: { color, width: num(props.strokeWidth, 2) },\n areaStyle: bool(props.withGradient, true)\n ? { color, opacity: num(props.fillOpacity, 0.6) }\n : undefined,\n },\n ],\n }\n}\n\nexport function radarOption(props: Props): EChartsOption {\n const data = list<ChartDataItem>(props.data)\n const series = list<ChartSeries>(props.series)\n const key = String(props.dataKey ?? 'name')\n const max = num(\n props.maxValue,\n Math.max(1, ...data.flatMap((row) => series.map((s) => Number(row[s.name] ?? 0)))),\n )\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n radar: {\n indicator: data.map((row) => ({ name: String(row[key]), max })),\n shape: props.shape === 'circle' ? 'circle' : 'polygon',\n },\n series: [\n {\n type: 'radar',\n data: series.map((s) => ({\n name: s.label ?? s.name,\n value: data.map((row) => Number(row[s.name] ?? 0)),\n lineStyle: { color: resolveColor(s.color) },\n itemStyle: { color: resolveColor(s.color) },\n areaStyle: bool(props.withPolarGrid, false) ? {} : undefined,\n })),\n },\n ],\n }\n}\n\nexport function simpleOption(type: 'funnel' | 'treemap' | 'sankey', props: Props): EChartsOption {\n const data = list<Record<string, unknown>>(props.data)\n if (type === 'sankey')\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n series: [\n {\n type,\n data: list(props.nodes ?? data),\n links: list(props.links),\n emphasis: { focus: 'adjacency' },\n ...obj(props.sankeyProps),\n },\n ],\n }\n return {\n tooltip: { show: bool(props.withTooltip, true) },\n legend: { show: bool(props.withLegend, false) },\n series: [\n {\n type,\n data: data.map((item) => ({ ...item, itemStyle: { color: resolveColor(item.color) } })),\n ...obj(props[`${type}Props`]),\n },\n ],\n }\n}\n\nexport function radialBarOption(props: Props): EChartsOption {\n const data = list<{ name: string; value: number; color?: string }>(props.data)\n return {\n legend: { show: bool(props.withLegend, false) },\n tooltip: { show: bool(props.withTooltip, true) },\n polar: {},\n angleAxis: { max: num(props.maxValue, 100), show: false },\n radiusAxis: {\n type: 'category',\n data: data.map((i) => i.name),\n show: bool(props.withLabels, true),\n },\n series: [\n {\n type: 'bar',\n coordinateSystem: 'polar',\n roundCap: true,\n data: data.map((i) => ({ value: i.value, itemStyle: { color: resolveColor(i.color) } })),\n },\n ],\n }\n}\n\nexport function heatmapOption(props: Props): EChartsOption {\n const input =\n props.data && typeof props.data === 'object' ? (props.data as Record<string, number>) : {}\n const data = Object.entries(input).map(([date, value]) => [date, value])\n const values = Object.values(input)\n const date = (value: unknown, fallback: string) =>\n value instanceof Date\n ? value.toISOString().slice(0, 10)\n : typeof value === 'string'\n ? value\n : fallback\n const start = date(props.startDate, String(data[0]?.[0] ?? new Date().toISOString().slice(0, 10)))\n const end = date(props.endDate, String(data.at(-1)?.[0] ?? start))\n return {\n tooltip: { show: bool(props.withTooltip, false) },\n visualMap: {\n show: bool(props.withLegend, false),\n min: (props.domain as number[] | undefined)?.[0] ?? Math.min(0, ...values),\n max: (props.domain as number[] | undefined)?.[1] ?? Math.max(1, ...values),\n inRange: {\n color: list<string>(props.colors).length\n ? list<string>(props.colors).map((color) => resolveColor(color))\n : ['#ebfbee', '#2f9e44'],\n },\n orient: 'horizontal',\n left: 'center',\n bottom: 0,\n },\n calendar: {\n range: [start, end],\n cellSize: num(props.rectSize, 10) + num(props.gap, 1),\n dayLabel: {\n show: bool(props.withWeekdayLabels, false),\n firstDay: num(props.firstDayOfWeek, 1),\n },\n monthLabel: { show: bool(props.withMonthLabels, false) },\n itemStyle: {\n borderWidth: num(props.gap, 1),\n borderColor: 'transparent',\n borderRadius: num(props.rectRadius, 2),\n },\n },\n series: [{ type: 'heatmap', coordinateSystem: 'calendar', data }],\n }\n}\n","import type { MantineColor } from '@mantine-vue/core'\nimport type { DefineComponent, HTMLAttributes, VNodeChild } from 'vue'\nimport { createChartComponent } from './internal/component'\nimport {\n cartesianOption,\n heatmapOption,\n radarOption,\n radialBarOption,\n radialOption,\n scatterOption,\n simpleOption,\n sparklineOption,\n} from './internal/options'\nimport type {\n ChartData,\n ChartOptionProps,\n ChartRootProps,\n ChartSeries,\n GridChartBaseProps,\n MantineChartDotProps,\n} from './types'\n\nexport type LineChartCurveType =\n | 'bump'\n | 'linear'\n | 'natural'\n | 'monotone'\n | 'step'\n | 'stepBefore'\n | 'stepAfter'\nexport type AreaChartCurveType = LineChartCurveType\nexport type CompositeChartCurveType = LineChartCurveType\nexport interface LineChartSeries extends ChartSeries {\n strokeDasharray?: string | number\n curveType?: LineChartCurveType\n}\nexport interface AreaChartSeries extends ChartSeries {\n color: MantineColor\n strokeDasharray?: string | number\n curveType?: AreaChartCurveType\n}\nexport interface BarChartSeries extends ChartSeries {\n stackId?: string\n}\nexport interface CompositeChartSeries extends ChartSeries {\n type: 'line' | 'area' | 'bar'\n strokeDasharray?: string | number\n}\n\nexport interface LineChartProps extends GridChartBaseProps {\n series: LineChartSeries[]\n type?: 'default' | 'gradient'\n gradientStops?: { offset: number; color: MantineColor }[]\n curveType?: LineChartCurveType\n fillOpacity?: number\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n lineChartProps?: ChartOptionProps\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: LineChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface AreaChartProps extends GridChartBaseProps {\n series: AreaChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'split'\n withGradient?: boolean\n curveType?: AreaChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n areaChartProps?: ChartOptionProps\n fillOpacity?: number\n splitColors?: [MantineColor, MantineColor]\n splitOffset?: number\n connectNulls?: boolean\n areaProps?: ChartOptionProps | ((series: AreaChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n}\nexport interface BarChartProps extends GridChartBaseProps {\n series: BarChartSeries[]\n type?: 'default' | 'stacked' | 'percent' | 'waterfall'\n fillOpacity?: number\n cursorFill?: MantineColor\n barChartProps?: ChartOptionProps\n barProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n withBarValueLabel?: boolean\n valueLabelProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps)\n minBarSize?: number\n maxBarWidth?: number\n barLabelColor?: MantineColor\n getBarColor?: (value: number, series: BarChartSeries) => MantineColor\n}\nexport interface CompositeChartProps extends Omit<GridChartBaseProps, 'orientation'> {\n series: CompositeChartSeries[]\n curveType?: CompositeChartCurveType\n withDots?: boolean\n dotProps?: MantineChartDotProps\n activeDotProps?: MantineChartDotProps\n strokeWidth?: number\n connectNulls?: boolean\n lineProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n areaProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n barProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps)\n withPointLabels?: boolean\n withBarValueLabel?: boolean\n minBarSize?: number\n maxBarWidth?: number\n composedChartProps?: ChartOptionProps\n}\n\nexport interface PieChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface PieChartProps extends ChartRootProps {\n data: PieChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLabelsLine?: boolean\n labelsPosition?: 'inside' | 'outside'\n labelsType?: 'value' | 'percent'\n tooltipDataSource?: 'segment' | 'all'\n valueFormatter?: (value: number) => string\n strokeWidth?: number\n size?: number\n startAngle?: number\n endAngle?: number\n paddingAngle?: number\n pieProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\nexport interface DonutChartProps extends PieChartProps {\n thickness?: number\n chartLabel?: string\n chartLabelColor?: MantineColor\n chartLabelFontSize?: number\n chartLabelProps?: ChartOptionProps\n}\n\nexport interface ScatterChartSeries extends ChartSeries {\n data?: ChartData\n}\nexport interface ScatterChartProps extends GridChartBaseProps {\n data: ChartData\n series: ScatterChartSeries[]\n xAxisKey?: string\n yAxisKey?: string\n scatterProps?: ChartOptionProps | ((series: ScatterChartSeries) => ChartOptionProps)\n}\nexport interface BubbleChartProps extends ChartRootProps {\n data: ChartData\n xAxisKey?: string\n yAxisKey?: string\n zAxisKey?: string\n name?: string\n color?: MantineColor\n range?: number\n withTooltip?: boolean\n withXAxis?: boolean\n withYAxis?: boolean\n xAxisProps?: ChartOptionProps\n yAxisProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n gridProps?: ChartOptionProps\n valueFormatter?: (value: number) => string\n}\n\nexport interface RadarChartProps extends GridChartBaseProps {\n series: ChartSeries[]\n maxValue?: number\n withPolarGrid?: boolean\n withAngleAxis?: boolean\n withRadiusAxis?: boolean\n shape?: 'polygon' | 'circle'\n radarProps?: ChartOptionProps\n}\nexport interface RadialBarChartCell {\n name: string\n value: number\n color?: MantineColor\n}\nexport interface RadialBarChartProps extends ChartRootProps {\n data: RadialBarChartCell[]\n maxValue?: number\n withLabels?: boolean\n withLegend?: boolean\n withTooltip?: boolean\n startAngle?: number\n endAngle?: number\n barSize?: number\n radialBarProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n legendProps?: ChartOptionProps\n}\nexport interface FunnelChartCell extends PieChartCell {\n label?: string\n}\nexport interface FunnelChartProps extends ChartRootProps {\n data: FunnelChartCell[]\n withTooltip?: boolean\n withLabels?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n funnelProps?: ChartOptionProps\n tooltipProps?: ChartOptionProps\n}\n\nexport interface TreemapData {\n name: string\n value?: number\n color?: MantineColor\n children?: TreemapData[]\n}\nexport interface TreemapProps extends ChartRootProps {\n data: TreemapData[]\n withTooltip?: boolean\n withLegend?: boolean\n valueFormatter?: (value: number) => string\n treemapProps?: ChartOptionProps\n}\nexport interface SankeyChartNode {\n name: string\n color?: MantineColor\n [key: string]: unknown\n}\nexport interface SankeyChartLink {\n source: string | number\n target: string | number\n value: number\n [key: string]: unknown\n}\nexport interface SankeyChartProps extends ChartRootProps {\n data?: SankeyChartNode[]\n nodes?: SankeyChartNode[]\n links: SankeyChartLink[]\n withTooltip?: boolean\n valueFormatter?: (value: number) => string\n sankeyProps?: ChartOptionProps\n}\n\nexport interface SparklineTrendColors {\n positive: MantineColor\n negative: MantineColor\n neutral?: MantineColor\n}\nexport interface SparklineProps extends ChartRootProps {\n data: (number | null)[]\n color?: MantineColor\n withGradient?: boolean\n fillOpacity?: number\n curveType?: LineChartCurveType\n strokeWidth?: number\n trendColors?: SparklineTrendColors\n connectNulls?: boolean\n areaProps?: ChartOptionProps\n}\nexport interface HeatmapRectData {\n date: string\n value: number | null\n}\nexport interface HeatmapProps extends ChartRootProps {\n data: Record<string, number>\n domain?: [number, number]\n startDate?: Date | string\n endDate?: Date | string\n withMonthLabels?: boolean\n monthLabels?: string[]\n withWeekdayLabels?: boolean\n weekdayLabels?: string[]\n withOutsideDates?: boolean\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6\n rectSize?: number\n gap?: number\n rectRadius?: number\n colors?: string[]\n weekdaysLabelsWidth?: number\n monthsLabelsHeight?: number\n fontSize?: number\n getTooltipLabel?: (input: HeatmapRectData) => VNodeChild\n withTooltip?: boolean\n tooltipProps?: ChartOptionProps\n getRectProps?: (input: HeatmapRectData) => Record<string, unknown>\n splitMonths?: boolean\n withLegend?: boolean\n legendLabels?: [string, string]\n}\n\nexport interface BarsListBarData {\n name: string\n value: number\n color?: MantineColor\n textColor?: MantineColor\n variant?: 'light' | 'filled'\n}\nexport interface BarsListProps extends ChartRootProps {\n data: BarsListBarData[]\n valueFormatter?: (value: number) => string\n barsLabel?: string\n valueLabel?: string\n getBarProps?: (data: BarsListBarData) => HTMLAttributes\n renderBar?: (data: BarsListBarData, defaultBar: VNodeChild) => VNodeChild\n barGap?: string | number\n minBarSize?: string | number\n barHeight?: string | number\n barColor?: MantineColor\n barTextColor?: MantineColor\n autoContrast?: boolean\n}\n\ntype PublicComponent<P> = DefineComponent<P>\nexport const AreaChart = createChartComponent('AreaChart', (p) =>\n cartesianOption(p, 'area'),\n) as PublicComponent<AreaChartProps>\nexport const BarChart = createChartComponent('BarChart', (p) =>\n cartesianOption(p, 'bar'),\n) as PublicComponent<BarChartProps>\nexport const LineChart = createChartComponent('LineChart', (p) =>\n cartesianOption(p, 'line'),\n) as PublicComponent<LineChartProps>\nexport const CompositeChart = createChartComponent('CompositeChart', (p) =>\n cartesianOption(p, 'composite'),\n) as PublicComponent<CompositeChartProps>\nexport const PieChart = createChartComponent('PieChart', (p) =>\n radialOption(p),\n) as PublicComponent<PieChartProps>\nexport const DonutChart = createChartComponent('DonutChart', (p) =>\n radialOption(p, true),\n) as PublicComponent<DonutChartProps>\nexport const ScatterChart = createChartComponent('ScatterChart', (p) =>\n scatterOption(p),\n) as PublicComponent<ScatterChartProps>\nexport const BubbleChart = createChartComponent('BubbleChart', (p) =>\n scatterOption(p, true),\n) as PublicComponent<BubbleChartProps>\nexport const RadarChart = createChartComponent(\n 'RadarChart',\n radarOption,\n) as PublicComponent<RadarChartProps>\nexport const RadialBarChart = createChartComponent(\n 'RadialBarChart',\n radialBarOption,\n) as PublicComponent<RadialBarChartProps>\nexport const FunnelChart = createChartComponent('FunnelChart', (p) =>\n simpleOption('funnel', p),\n) as PublicComponent<FunnelChartProps>\nexport const Treemap = createChartComponent('Treemap', (p) =>\n simpleOption('treemap', p),\n) as PublicComponent<TreemapProps>\nexport const SankeyChart = createChartComponent('SankeyChart', (p) =>\n simpleOption('sankey', p),\n) as PublicComponent<SankeyChartProps>\nexport const Sparkline = createChartComponent(\n 'Sparkline',\n sparklineOption,\n) as PublicComponent<SparklineProps>\nexport const Heatmap = createChartComponent(\n 'Heatmap',\n heatmapOption,\n) as PublicComponent<HeatmapProps>\nexport const BarsList = createChartComponent('BarsList', (p) =>\n cartesianOption(\n {\n ...p,\n dataKey: 'name',\n series: [{ name: 'value', color: p.barColor }],\n orientation: 'vertical',\n withXAxis: false,\n withYAxis: true,\n withTooltip: false,\n maxBarWidth: p.barHeight,\n },\n 'bar',\n ),\n) as PublicComponent<BarsListProps>\n\nexport type AreaChartStylesNames =\n | 'area'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BarChartStylesNames =\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type LineChartStylesNames =\n | 'line'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type CompositeChartStylesNames =\n | 'line'\n | 'area'\n | 'bar'\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type PieChartStylesNames = 'root' | 'label'\nexport type DonutChartStylesNames = PieChartStylesNames\nexport type ScatterChartStylesNames =\n | import('./types').BaseChartStylesNames\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type BubbleChartStylesNames = ScatterChartStylesNames\nexport type RadarChartStylesNames =\n | 'root'\n | 'container'\n | 'axis'\n | 'grid'\n | 'curve'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type RadialBarChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type FunnelChartStylesNames =\n | 'root'\n | 'container'\n | 'label'\n | ChartLegendStylesNames\n | ChartTooltipStylesNames\nexport type TreemapStylesNames = 'root' | 'container'\nexport type SankeyChartStylesNames = 'root' | 'container'\nexport type SparklineStylesNames = 'root'\nexport type HeatmapStylesNames =\n | 'root'\n | 'rect'\n | 'weekdayLabel'\n | 'monthLabel'\n | 'legend'\n | 'legendLabel'\n | 'legendRect'\nexport type BarsListStylesNames = 'root' | 'bar' | 'barLabel' | 'barValue' | 'labelsRow'\n\nexport type ChartTooltipStylesNames =\n | 'tooltip'\n | 'tooltipItem'\n | 'tooltipItemBody'\n | 'tooltipItemColor'\n | 'tooltipItemName'\n | 'tooltipItemData'\n | 'tooltipLabel'\n | 'tooltipBody'\nexport type ChartLegendStylesNames = 'legendItem' | 'legendItemColor' | 'legendItemName' | 'legend'\nexport type ChartCssVariables = Record<string, string>\n","import { computed, defineComponent, h, type PropType, type SlotsType, type VNodeChild } from 'vue'\nimport type { ChartRenderable, ChartSeries, ChartTooltipPayload } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartTooltipProps {\n label?: ChartRenderable\n payload?: readonly ChartTooltipPayload[]\n unit?: string\n type?: 'area' | 'radial' | 'scatter'\n segmentId?: string\n series?: ChartSeries[]\n valueFormatter?: (value: number) => ChartRenderable\n showColor?: boolean\n}\n\nexport interface ChartTooltipSlots {\n label?: () => VNodeChild\n valueFormatter?: (input: { value: number; item: ChartTooltipPayload }) => VNodeChild\n}\n\nexport const ChartTooltip = defineComponent({\n name: 'MantineChartTooltip',\n slots: Object as SlotsType<ChartTooltipSlots>,\n props: {\n label: null,\n payload: Array as PropType<readonly ChartTooltipPayload[]>,\n unit: String,\n type: { type: String as PropType<ChartTooltipProps['type']>, default: 'area' },\n segmentId: String,\n series: Array as PropType<ChartSeries[]>,\n valueFormatter: Function as PropType<(value: number) => ChartRenderable>,\n showColor: { type: Boolean, default: true },\n },\n setup(props, { slots }) {\n const labels = computed(() =>\n Object.fromEntries((props.series ?? []).map((item) => [item.name, item.label ?? item.name])),\n )\n return () => {\n const label = props.label !== undefined ? props.label : slots.label?.()\n const payload = props.segmentId\n ? props.payload?.filter(\n (item) => item.name === props.segmentId || item.dataKey === props.segmentId,\n )\n : props.payload\n if (!payload?.length) return null\n return h('div', { class: 'mantine-ChartTooltip-tooltip', 'data-type': props.type }, [\n label != null ? h('div', { class: 'mantine-ChartTooltip-tooltipLabel' }, [label]) : null,\n h(\n 'div',\n { class: 'mantine-ChartTooltip-tooltipBody' },\n payload.map((item) =>\n h('div', { class: 'mantine-ChartTooltip-tooltipItem' }, [\n h('div', { class: 'mantine-ChartTooltip-tooltipItemBody' }, [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartTooltip-tooltipItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h(\n 'span',\n { class: 'mantine-ChartTooltip-tooltipItemName' },\n labels.value[item.name ?? ''] ?? item.name,\n ),\n ]),\n h('span', { class: 'mantine-ChartTooltip-tooltipItemData' }, [\n props.valueFormatter\n ? props.valueFormatter(Number(item.value))\n : (slots.valueFormatter?.({ value: Number(item.value), item }) ??\n (item.value == null ? '' : String(item.value))),\n props.unit ?? item.unit ?? '',\n ]),\n ]),\n ),\n ),\n ])\n }\n },\n})\n","import { defineComponent, h, type PropType } from 'vue'\nimport type { ChartSeries } from '../types'\nimport { resolveColor } from '../internal/colors'\n\nexport interface ChartLegendPayload {\n dataKey?: string\n name?: string\n color?: string\n [key: string]: unknown\n}\nexport interface ChartLegendProps {\n payload?: readonly ChartLegendPayload[]\n onHighlight: (area: string | null) => void\n legendPosition: 'top' | 'bottom' | 'middle'\n series?: ChartSeries[]\n showColor?: boolean\n centered?: boolean\n}\n\nexport const ChartLegend = defineComponent({\n name: 'MantineChartLegend',\n props: {\n payload: Array as PropType<readonly ChartLegendPayload[]>,\n onHighlight: { type: Function as PropType<(area: string | null) => void>, required: true },\n legendPosition: {\n type: String as PropType<ChartLegendProps['legendPosition']>,\n required: true,\n },\n series: Array as PropType<ChartSeries[]>,\n showColor: { type: Boolean, default: true },\n centered: Boolean,\n },\n setup(props) {\n return () =>\n h(\n 'div',\n {\n class: 'mantine-ChartLegend-legend',\n 'data-position': props.legendPosition,\n 'data-centered': props.centered || undefined,\n onMouseleave: () => props.onHighlight(null),\n },\n props.payload?.map((item) => {\n const key = item.dataKey ?? item.name ?? ''\n const label = props.series?.find((s) => s.name === key)?.label ?? key\n return h(\n 'div',\n { class: 'mantine-ChartLegend-legendItem', onMouseenter: () => props.onHighlight(key) },\n [\n props.showColor\n ? h('span', {\n class: 'mantine-ChartLegend-legendItemColor',\n style: { background: resolveColor(item.color) },\n })\n : null,\n h('span', { class: 'mantine-ChartLegend-legendItemName' }, label),\n ],\n )\n }),\n )\n },\n})\n","import type { ChartSeries } from '../../types'\nexport function getSeriesLabels(series: ChartSeries[] | undefined): Record<string, string> {\n return Object.fromEntries((series ?? []).map((item) => [item.name, item.label ?? item.name]))\n}\n"],"mappings":";;;;;;;AAkCA,IAAI,aAAa;AAEjB,SAAgB,kBAAwB;CACtC,IAAI,YACF;CAGF,IAAI;EACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,aAAa;AACf;;;ACrEA,gBAAgB;AAIhB,SAAgB,qBAAqB,MAAc,aAAuC;CACxF,OAAO,gBAAgB;EACrB,MAAM,UAAU;EAChB,cAAc;EACd,OAAO;GACL,QAAQ;GACR,QAAQ;IAAE,MAAM,CAAC,QAAQ,MAAM;IAAG,SAAS;GAAI;GAC/C,OAAO;IAAE,MAAM,CAAC,QAAQ,MAAM;IAAG,SAAS;GAAO;GACjD,SAAS;GACT,YAAY;IAAE,MAAM;IAAS,SAAS;GAAK;GAC3C,UAAU;IAAE,MAAM;IAAsC,SAAS;GAAS;GAC1E,aAAa;EACf;EACA,OAAO;GAAC;GAAS;GAAY;GAAa;GAAY;GAAuB;EAAU;EACvF,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;GACpC,MAAM,QAAQ,IAAiC;GAC/C,MAAM,SAAS,gBAAgB;IAAE,GAAG,YAAY,KAAK;IAAG,GAAG,MAAM;GAAO,EAAE;GAC1E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CACN,OAAO;EACL,SAAS;EACT,aAAa;GAAE,MAAM;GAAqD,UAAU;EAAK;EACzF,gBAAgB;GACd,MAAM;GACN,UAAU;EACZ;EACA,QAAQ;EACR,WAAW;GAAE,MAAM;GAAS,SAAS;EAAK;EAC1C,UAAU;CACZ;CACA,MAAM,OAAO;EACX,aACE,EACE,OACA;GACE,OAAO;GACP,iBAAiB,MAAM;GACvB,iBAAiB,MAAM,YAAY,KAAA;GACnC,oBAAoB,MAAM,YAAY,IAAI;EAC5C,GACA,MAAM,SAAS,KAAK,SAAS;GAC3B,MAAM,MAAM,KAAK,WAAW,KAAK,QAAQ;GACzC,MAAM,QAAQ,MAAM,QAAQ,MAAM,MAAM,EAAE,SAAS,GAAG,GAAG,SAAS;GAClE,OAAO,EACL,OACA;IAAE,OAAO;IAAkC,oBAAoB,MAAM,YAAY,GAAG;GAAE,GACtF,CACE,MAAM,YACF,EAAE,QAAQ;IACR,OAAO;IACP,OAAO,EAAE,YAAY,aAAa,KAAK,KAAK,EAAE;GAChD,CAAC,IACD,MACJ,EAAE,QAAQ,EAAE,OAAO,qCAAqC,GAAG,KAAK,CAClE,CACF;EACF,CAAC,CACH;CACJ;AACF,CAAC;;;AC5DD,SAAgB,gBAAgB,QAA2D;CACzF,OAAO,OAAO,aAAa,UAAU,CAAC,GAAG,KAAK,SAAS,CAAC,KAAK,MAAM,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC;AAC9F"}
@@ -1,4 +1,4 @@
1
- import { type PropType } from 'vue';
1
+ import { type PropType, type SlotsType, type VNodeChild } from 'vue';
2
2
  import type { ChartRenderable, ChartSeries, ChartTooltipPayload } from '../types';
3
3
  export interface ChartTooltipProps {
4
4
  label?: ChartRenderable;
@@ -10,6 +10,13 @@ export interface ChartTooltipProps {
10
10
  valueFormatter?: (value: number) => ChartRenderable;
11
11
  showColor?: boolean;
12
12
  }
13
+ export interface ChartTooltipSlots {
14
+ label?: () => VNodeChild;
15
+ valueFormatter?: (input: {
16
+ value: number;
17
+ item: ChartTooltipPayload;
18
+ }) => VNodeChild;
19
+ }
13
20
  export declare const ChartTooltip: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
14
21
  label: null;
15
22
  payload: PropType<readonly ChartTooltipPayload[]>;
@@ -45,4 +52,4 @@ export declare const ChartTooltip: import("vue").DefineComponent<import("vue").E
45
52
  }>> & Readonly<{}>, {
46
53
  type: "area" | "scatter" | "radial" | undefined;
47
54
  showColor: boolean;
48
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
55
+ }, SlotsType<ChartTooltipSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,2 +1,2 @@
1
1
  export { ChartTooltip } from './ChartTooltip';
2
- export type { ChartTooltipProps } from './ChartTooltip';
2
+ export type { ChartTooltipProps, ChartTooltipSlots } from './ChartTooltip';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mantine-vue/charts",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Charts components built with Apache ECharts and Mantine Vue",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "vue-echarts": "^8.0.1"
39
39
  },
40
40
  "peerDependencies": {
41
- "@mantine-vue/core": "2.3.0",
41
+ "@mantine-vue/core": "2.4.0",
42
42
  "echarts": ">=6.0.0",
43
43
  "vue": "^3.5.0",
44
44
  "vue-echarts": ">=8.0.0"