@lobehub/charts 5.7.2 → 6.0.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.
Files changed (107) hide show
  1. package/README.md +3 -3
  2. package/es/AccuracyBarChart/index.mjs +1 -3
  3. package/es/AccuracyBarChart/index.mjs.map +1 -1
  4. package/es/AccuracyBarChart/styles.mjs +1 -1
  5. package/es/AccuracyBarChart/styles.mjs.map +1 -1
  6. package/es/AreaChart/index.mjs +1 -3
  7. package/es/AreaChart/index.mjs.map +1 -1
  8. package/es/AreaChart/styles.mjs +1 -1
  9. package/es/AreaChart/styles.mjs.map +1 -1
  10. package/es/BarChart/index.mjs +1 -3
  11. package/es/BarChart/index.mjs.map +1 -1
  12. package/es/BarChart/styles.mjs +1 -1
  13. package/es/BarChart/styles.mjs.map +1 -1
  14. package/es/BarList/index.mjs +1 -3
  15. package/es/BarList/index.mjs.map +1 -1
  16. package/es/BarList/styles.mjs +1 -1
  17. package/es/BarList/styles.mjs.map +1 -1
  18. package/es/BenchmarkColumnChart/index.mjs +1 -3
  19. package/es/BenchmarkColumnChart/index.mjs.map +1 -1
  20. package/es/BenchmarkColumnChart/styles.mjs +1 -1
  21. package/es/BenchmarkColumnChart/styles.mjs.map +1 -1
  22. package/es/BenchmarkRankingChart/index.mjs +1 -3
  23. package/es/BenchmarkRankingChart/index.mjs.map +1 -1
  24. package/es/BenchmarkRankingChart/styles.mjs +1 -1
  25. package/es/BenchmarkRankingChart/styles.mjs.map +1 -1
  26. package/es/BenchmarkScatterChart/index.mjs +1 -3
  27. package/es/BenchmarkScatterChart/index.mjs.map +1 -1
  28. package/es/BenchmarkScatterChart/styles.mjs +1 -1
  29. package/es/BenchmarkScatterChart/styles.mjs.map +1 -1
  30. package/es/ComposedChart/index.mjs +1 -3
  31. package/es/ComposedChart/index.mjs.map +1 -1
  32. package/es/ComposedChart/styles.mjs +1 -1
  33. package/es/ComposedChart/styles.mjs.map +1 -1
  34. package/es/DataBars/CategoryBar.mjs +1 -3
  35. package/es/DataBars/CategoryBar.mjs.map +1 -1
  36. package/es/DataBars/DeltaBar.mjs +1 -3
  37. package/es/DataBars/DeltaBar.mjs.map +1 -1
  38. package/es/DataBars/MarkerBar.mjs +1 -3
  39. package/es/DataBars/MarkerBar.mjs.map +1 -1
  40. package/es/DataBars/ProgressBar.mjs +1 -3
  41. package/es/DataBars/ProgressBar.mjs.map +1 -1
  42. package/es/DataBars/styles.mjs +1 -1
  43. package/es/DataBars/styles.mjs.map +1 -1
  44. package/es/DonutChart/index.mjs +1 -3
  45. package/es/DonutChart/index.mjs.map +1 -1
  46. package/es/DonutChart/styles.mjs +1 -1
  47. package/es/DonutChart/styles.mjs.map +1 -1
  48. package/es/FunnelChart/index.mjs +1 -3
  49. package/es/FunnelChart/index.mjs.map +1 -1
  50. package/es/FunnelChart/styles.mjs +1 -1
  51. package/es/FunnelChart/styles.mjs.map +1 -1
  52. package/es/Heatmaps/Calendar.mjs +1 -2
  53. package/es/Heatmaps/Calendar.mjs.map +1 -1
  54. package/es/Heatmaps/ChartLabels.mjs +1 -1
  55. package/es/Heatmaps/ChartLabels.mjs.map +1 -1
  56. package/es/Heatmaps/Footer.mjs +1 -1
  57. package/es/Heatmaps/Footer.mjs.map +1 -1
  58. package/es/Heatmaps/index.mjs +1 -3
  59. package/es/Heatmaps/index.mjs.map +1 -1
  60. package/es/Heatmaps/styles.mjs +1 -1
  61. package/es/Heatmaps/styles.mjs.map +1 -1
  62. package/es/Legend/LegendItem.mjs +1 -3
  63. package/es/Legend/LegendItem.mjs.map +1 -1
  64. package/es/Legend/ScrollButton.mjs +1 -2
  65. package/es/Legend/ScrollButton.mjs.map +1 -1
  66. package/es/Legend/index.mjs +1 -2
  67. package/es/Legend/index.mjs.map +1 -1
  68. package/es/LineChart/index.mjs +1 -3
  69. package/es/LineChart/index.mjs.map +1 -1
  70. package/es/LineChart/styles.mjs +1 -1
  71. package/es/LineChart/styles.mjs.map +1 -1
  72. package/es/RadarChart/index.mjs +1 -3
  73. package/es/RadarChart/index.mjs.map +1 -1
  74. package/es/RadarChart/styles.mjs +1 -1
  75. package/es/RadarChart/styles.mjs.map +1 -1
  76. package/es/ScatterChart/ScatterChartTooltip.mjs +1 -3
  77. package/es/ScatterChart/ScatterChartTooltip.mjs.map +1 -1
  78. package/es/ScatterChart/ScatterChartTooltipRow.mjs +1 -3
  79. package/es/ScatterChart/ScatterChartTooltipRow.mjs.map +1 -1
  80. package/es/ScatterChart/index.mjs +1 -3
  81. package/es/ScatterChart/index.mjs.map +1 -1
  82. package/es/ScatterChart/styles.mjs +1 -1
  83. package/es/ScatterChart/styles.mjs.map +1 -1
  84. package/es/SparkChart/SparkAreaChart.mjs +1 -3
  85. package/es/SparkChart/SparkAreaChart.mjs.map +1 -1
  86. package/es/SparkChart/SparkBarChart.mjs +1 -3
  87. package/es/SparkChart/SparkBarChart.mjs.map +1 -1
  88. package/es/SparkChart/SparkLineChart.mjs +1 -3
  89. package/es/SparkChart/SparkLineChart.mjs.map +1 -1
  90. package/es/Tracker/TrackerBlock.mjs +1 -3
  91. package/es/Tracker/TrackerBlock.mjs.map +1 -1
  92. package/es/Tracker/index.mjs +1 -3
  93. package/es/Tracker/index.mjs.map +1 -1
  94. package/es/Tracker/styles.mjs +1 -1
  95. package/es/Tracker/styles.mjs.map +1 -1
  96. package/es/common/ChartTooltip/ChartTooltipFrame.mjs +1 -2
  97. package/es/common/ChartTooltip/ChartTooltipFrame.mjs.map +1 -1
  98. package/es/common/ChartTooltip/ChartTooltipRow.mjs +1 -3
  99. package/es/common/ChartTooltip/ChartTooltipRow.mjs.map +1 -1
  100. package/es/common/ChartTooltip/index.mjs +1 -3
  101. package/es/common/ChartTooltip/index.mjs.map +1 -1
  102. package/es/common/CustomYAxisTick.mjs +1 -1
  103. package/es/common/CustomYAxisTick.mjs.map +1 -1
  104. package/es/hooks/useThemeColorRange.d.mts +1 -1
  105. package/es/hooks/useThemeColorRange.mjs +1 -1
  106. package/es/hooks/useThemeColorRange.mjs.map +1 -1
  107. package/package.json +6 -9
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/BenchmarkScatterChart/index.tsx"],"sourcesContent":["'use client';\n\nimport { A } from '@lobehub/ui';\nimport { Segmented, Skeleton, Tooltip } from '@lobehub/ui/base-ui';\nimport { useSize } from 'ahooks';\nimport { cssVar, cx, useTheme } from 'antd-style';\nimport { type CSSProperties, type ReactNode, forwardRef, useMemo, useRef, useState } from 'react';\n\nimport ChartTooltip from '@/common/ChartTooltip';\nimport NoData from '@/common/NoData';\nimport {\n type BenchmarkBaseProps,\n type BenchmarkEventProps,\n type BenchmarkPointShape,\n type NormalizedBenchmarkItem,\n defaultBenchmarkErrorFormatter,\n defaultBenchmarkValueFormatter,\n normalizeBenchmarkData,\n} from '@/common/benchmark';\nimport { constructCategoryColors } from '@/common/utils';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { getTextWidth } from '@/utils/getMaxLabelLength';\n\nimport { styles } from './styles';\nimport {\n type Box,\n type LabelCandidate,\n type PlacedLabel,\n type ScaleType,\n createScale,\n getParetoFrontier,\n placeLabels,\n} from './utils';\n\nexport interface BenchmarkScatterMetric {\n /**\n * Axis title; falls back to `label`\n */\n axisLabel?: string;\n /**\n * Which direction is better on this axis (drives the Pareto frontier)\n * @default 'lower'\n */\n direction?: 'lower' | 'higher';\n formatter?: (value: number) => string;\n /**\n * Record field holding this metric\n */\n key: string;\n /**\n * Label shown in the metric switcher and tooltip\n */\n label: string;\n max?: number;\n min?: number;\n /**\n * @default 'linear'\n */\n scale?: ScaleType;\n}\n\nexport interface BenchmarkScatterChartProps extends Omit<BenchmarkBaseProps, 'sortOrder'> {\n /**\n * Initially selected metric key when `metrics` is provided (uncontrolled)\n */\n defaultMetric?: string;\n /**\n * Pareto frontier line color\n * @default theme.orange\n */\n frontierColor?: string;\n /**\n * @default 2\n */\n frontierWidth?: number;\n /**\n * Size of consumer-provided icons; should match the size the icon renders at.\n * Icons are scaled down from this size in the legend.\n * @default 20\n */\n iconSize?: number;\n /**\n * Font size for the point name label\n * @default 12\n */\n labelFontSize?: number;\n /**\n * Size of the fallback shape marker when an item has no icon\n * @default 12\n */\n markerSize?: number;\n maxX?: number;\n maxY?: number;\n /**\n * Selected metric key (controlled)\n */\n metric?: string;\n /**\n * Switchable X metrics (e.g. Cost / Speed). Overrides `xKey`, `xScale`,\n * `xFormatter`, `xAxisLabel` and `xDirection` for the active metric.\n */\n metrics?: BenchmarkScatterMetric[];\n minX?: number;\n minY?: number;\n onMetricChange?: (metric: string) => void;\n /**\n * On hover, shade the region the point dominates (worse X and lower Y)\n * and gray out the points inside it. When off, all other points are dimmed instead.\n * @default true\n */\n showDominatedArea?: boolean;\n /**\n * Draw vertical error bars when records have `error`\n * @default true\n */\n showErrorBars?: boolean;\n /**\n * Connect non-dominated points with a Pareto frontier line\n * @default true\n */\n showFrontier?: boolean;\n /**\n * @default true\n */\n showGridLines?: boolean;\n /**\n * Show name labels next to points (placed automatically to avoid overlap)\n * @default true\n */\n showLabels?: boolean;\n /**\n * @default true\n */\n showLegend?: boolean;\n /**\n * @default true\n */\n showTooltip?: boolean;\n /**\n * Show `y · x` values under each point label\n * @default true\n */\n showValueLabel?: boolean;\n /**\n * @default true\n */\n showXAxis?: boolean;\n /**\n * @default true\n */\n showYAxis?: boolean;\n /**\n * Font size for the `y · x` value line\n * @default 11\n */\n valueLabelFontSize?: number;\n xAxisLabel?: string;\n /**\n * Which direction is better on X (drives the Pareto frontier)\n * @default 'lower'\n */\n xDirection?: 'lower' | 'higher';\n xFormatter?: (value: number) => string;\n /**\n * Record field used for the X axis\n * @default 'x'\n */\n xKey?: string;\n /**\n * X axis scale\n * @default 'linear'\n */\n xScale?: ScaleType;\n yAxisLabel?: string;\n}\n\ninterface PlotPoint {\n color: string;\n item: NormalizedBenchmarkItem;\n key: string | number;\n x: number;\n y: number;\n}\n\nconst labelPriority = (point: PlotPoint, frontierKeys: ReadonlySet<string | number>) =>\n (frontierKeys.has(point.key) ? 0 : 2) + (point.item.highlighted ? 0 : 1);\n\nconst MARGIN_TOP = 12;\nconst MARGIN_RIGHT = 16;\nconst TICK_GAP = 8;\nconst AXIS_TITLE_SIZE = 22;\n// Monospace glyph advance relative to font size (Geist Mono / SF Mono ≈ 0.6em)\nconst MONO_CHAR_RATIO = 0.62;\n\nconst renderShape = (\n shape: BenchmarkPointShape | undefined,\n color: string,\n size: number,\n ring = false,\n) => {\n const half = size / 2;\n let node: ReactNode;\n switch (shape) {\n case 'square': {\n node = (\n <rect\n fill={color}\n height={size * 0.84}\n width={size * 0.84}\n x={size * 0.08}\n y={size * 0.08}\n />\n );\n break;\n }\n case 'diamond': {\n node = <path d={`M${half},0 L${size},${half} L${half},${size} L0,${half} Z`} fill={color} />;\n break;\n }\n case 'triangle': {\n node = <path d={`M${half},0 L${size},${size * 0.9} L0,${size * 0.9} Z`} fill={color} />;\n break;\n }\n default: {\n node = <circle cx={half} cy={half} fill={color} r={half} />;\n }\n }\n return (\n <svg height={size} style={{ display: 'block', overflow: 'visible' }} width={size}>\n {ring ? (\n <g paintOrder=\"stroke\" stroke={cssVar.colorBgContainer} strokeWidth={4}>\n {node}\n </g>\n ) : (\n node\n )}\n </svg>\n );\n};\n\nconst toLabelText = (name: ReactNode) => String(name ?? '').replaceAll('\\n', ' ');\n\nconst BenchmarkScatterChart = forwardRef<HTMLDivElement, BenchmarkScatterChartProps>(\n (props, ref) => {\n const theme = useTheme();\n const themeColorRange = useThemeColorRange();\n const {\n data = [],\n index,\n valueKey,\n providerKey,\n iconKey,\n colorKey,\n errorKey,\n renderIcon,\n valueFormatter = defaultBenchmarkValueFormatter,\n accuracyFormatter,\n errorFormatter = defaultBenchmarkErrorFormatter,\n showError = true,\n showErrorBars = true,\n showAnimation = false,\n onValueChange,\n className,\n style,\n loading,\n width = '100%',\n height = 420,\n noDataText,\n highlightColor,\n frontierColor,\n frontierWidth = 2,\n iconSize = 20,\n markerSize = 12,\n labelFontSize = 12,\n valueLabelFontSize = 11,\n metrics,\n metric,\n defaultMetric,\n onMetricChange,\n minX,\n maxX,\n minY,\n maxY,\n showDominatedArea = true,\n showFrontier = true,\n showGridLines = true,\n showLabels = true,\n showLegend = true,\n showTooltip = true,\n showValueLabel = true,\n showXAxis = true,\n showYAxis = true,\n xAxisLabel,\n xDirection = 'lower',\n xFormatter = defaultBenchmarkValueFormatter,\n xKey = 'x',\n xScale = 'linear',\n yAxisLabel,\n ...rest\n } = props;\n\n const plotRef = useRef<HTMLDivElement>(null);\n const size = useSize(plotRef);\n const [innerMetric, setInnerMetric] = useState(defaultMetric);\n const [hoverKey, setHoverKey] = useState<string | number | undefined>();\n const [selectedKey, setSelectedKey] = useState<string | number | undefined>();\n\n const resolvedHighlightColor = highlightColor ?? theme.gold;\n const resolvedFrontierColor = frontierColor ?? theme.orange;\n const yFormatter = accuracyFormatter ?? valueFormatter;\n const yName = yAxisLabel || (accuracyFormatter ? 'Accuracy' : 'Score');\n\n const activeMetric = useMemo(() => {\n if (metrics?.length) {\n const key = metric ?? innerMetric;\n const found = metrics.find((m) => m.key === key) ?? metrics[0];\n return {\n axisLabel: found.axisLabel ?? found.label,\n direction: found.direction ?? 'lower',\n formatter: found.formatter ?? defaultBenchmarkValueFormatter,\n key: found.key,\n label: found.label,\n max: found.max ?? maxX,\n min: found.min ?? minX,\n scale: found.scale ?? 'linear',\n };\n }\n return {\n axisLabel: xAxisLabel,\n direction: xDirection,\n formatter: xFormatter,\n key: xKey,\n label: xAxisLabel || 'X',\n max: maxX,\n min: minX,\n scale: xScale,\n };\n }, [\n innerMetric,\n maxX,\n metric,\n metrics,\n minX,\n xAxisLabel,\n xDirection,\n xFormatter,\n xKey,\n xScale,\n ]);\n\n const items = useMemo(\n () =>\n normalizeBenchmarkData({\n colorKey,\n data,\n errorKey,\n iconKey,\n index,\n providerKey,\n renderIcon,\n sortOrder: 'descending',\n valueKey,\n }),\n [colorKey, data, errorKey, iconKey, index, providerKey, renderIcon, valueKey],\n );\n\n const categoryColors = useMemo(\n () =>\n constructCategoryColors(\n items.map((item) => String(item.key)),\n themeColorRange,\n ),\n [items, themeColorRange],\n );\n\n const points: PlotPoint[] = useMemo(\n () =>\n items\n .map((item) => ({\n color: item.color ?? categoryColors.get(String(item.key)) ?? cssVar.colorPrimary,\n item,\n key: item.key,\n x: Number(item.original[activeMetric.key]),\n y: item.value,\n }))\n .filter(\n (p) =>\n Number.isFinite(p.x) &&\n Number.isFinite(p.y) &&\n (activeMetric.scale !== 'log' || p.x > 0),\n ),\n [activeMetric.key, activeMetric.scale, categoryColors, items],\n );\n\n const frontier = useMemo(\n () => (showFrontier ? getParetoFrontier(points, activeMetric.direction) : []),\n [activeMetric.direction, points, showFrontier],\n );\n const frontierKeys = useMemo(() => new Set(frontier.map((p) => p.key)), [frontier]);\n\n const enableErrorBars = showError && showErrorBars;\n const yValues = useMemo(\n () =>\n points.flatMap((p) =>\n enableErrorBars && p.item.error ? [p.y - p.item.error, p.y + p.item.error] : [p.y],\n ),\n [enableErrorBars, points],\n );\n\n const labelSizes = useMemo(() => {\n const map = new Map<string | number, { height: number; width: number }>();\n if (!showLabels) return map;\n const nameScale = (labelFontSize / 12) * 1.1;\n for (const p of points) {\n const nameWidth = getTextWidth(toLabelText(p.item.name)) * nameScale;\n const valueWidth = showValueLabel\n ? `${yFormatter(p.y)} · ${activeMetric.formatter(p.x)}`.length *\n valueLabelFontSize *\n MONO_CHAR_RATIO\n : 0;\n map.set(p.key, {\n height: Math.ceil(labelFontSize * 1.3 + (showValueLabel ? valueLabelFontSize * 1.3 : 0)),\n width: Math.ceil(Math.max(nameWidth, valueWidth)) + 2,\n });\n }\n return map;\n }, [\n activeMetric,\n labelFontSize,\n points,\n showLabels,\n showValueLabel,\n valueLabelFontSize,\n yFormatter,\n ]);\n\n const plotWidth = size?.width || (typeof width === 'number' ? width : 0);\n const plotHeight = typeof height === 'number' ? height : 420;\n\n const layout = useMemo(() => {\n if (!plotWidth || !points.length) return null;\n\n const probeY = createScale({ max: maxY, min: minY, range: [0, 1], values: yValues });\n const yTickWidth = showYAxis\n ? Math.max(...probeY.ticks.map((t) => yFormatter(t).length * 12 * MONO_CHAR_RATIO), 0)\n : 0;\n\n const left = (showYAxis ? yTickWidth + TICK_GAP + 4 : 4) + (yAxisLabel ? AXIS_TITLE_SIZE : 0);\n const bottom = (showXAxis ? 26 : 4) + (activeMetric.axisLabel ? AXIS_TITLE_SIZE : 0);\n const innerRight = plotWidth - MARGIN_RIGHT;\n const innerBottom = plotHeight - bottom;\n\n const xScaleObj = createScale({\n max: activeMetric.max,\n min: activeMetric.min,\n range: [left, innerRight],\n type: activeMetric.scale,\n values: points.map((p) => p.x),\n });\n const yScaleObj = createScale({\n max: maxY,\n min: minY,\n range: [innerBottom, MARGIN_TOP],\n values: yValues,\n });\n\n const positions = new Map<string | number, { px: number; py: number; radius: number }>();\n for (const p of points) {\n positions.set(p.key, {\n px: xScaleObj.map(p.x),\n py: yScaleObj.map(p.y),\n radius: (p.item.icon ? iconSize : markerSize) / 2,\n });\n }\n\n const frontierPath = frontier\n .map((p, i) => {\n const pos = positions.get(p.key)!;\n return `${i === 0 ? 'M' : 'L'}${pos.px.toFixed(2)},${pos.py.toFixed(2)}`;\n })\n .join(' ');\n\n let labels = new Map<string | number, PlacedLabel>();\n if (showLabels) {\n const lineBoxes: Box[] = [];\n for (let i = 1; i < frontier.length; i++) {\n const a = positions.get(frontier[i - 1].key)!;\n const b = positions.get(frontier[i].key)!;\n const steps = Math.max(1, Math.ceil(Math.hypot(b.px - a.px, b.py - a.py) / 10));\n for (let s = 0; s <= steps; s++) {\n const t = s / steps;\n lineBoxes.push({\n height: 6,\n width: 6,\n x: a.px + (b.px - a.px) * t - 3,\n y: a.py + (b.py - a.py) * t - 3,\n });\n }\n }\n\n const ordered = [...points].sort(\n (a, b) => labelPriority(a, frontierKeys) - labelPriority(b, frontierKeys) || b.y - a.y,\n );\n const candidates: LabelCandidate[] = ordered.map((p) => {\n const pos = positions.get(p.key)!;\n const labelSize = labelSizes.get(p.key) ?? { height: 16, width: 40 };\n return { ...labelSize, key: p.key, ...pos };\n });\n\n labels = placeLabels(\n candidates,\n { height: innerBottom, width: plotWidth - left + MARGIN_RIGHT, x: left, y: 0 },\n { lines: lineBoxes },\n );\n }\n\n return {\n bottom,\n frontierPath,\n innerBottom,\n innerRight,\n labels,\n left,\n positions,\n xScale: xScaleObj,\n yScale: yScaleObj,\n };\n }, [\n activeMetric,\n frontier,\n frontierKeys,\n iconSize,\n labelSizes,\n markerSize,\n maxY,\n minY,\n plotHeight,\n plotWidth,\n points,\n showLabels,\n showXAxis,\n showYAxis,\n yAxisLabel,\n yFormatter,\n yValues,\n ]);\n\n if (loading || !data) return <Skeleton height={plotHeight} width={width} />;\n\n const focusKey = hoverKey ?? selectedKey;\n const focusPoint =\n focusKey === undefined ? undefined : points.find((point) => point.key === focusKey);\n const dominatedKeys = new Set<string | number>();\n if (showDominatedArea && focusPoint) {\n for (const point of points) {\n if (point.key === focusPoint.key || point.y > focusPoint.y) continue;\n const worseX =\n activeMetric.direction === 'lower' ? point.x >= focusPoint.x : point.x <= focusPoint.x;\n if (worseX) dominatedKeys.add(point.key);\n }\n }\n const getEmphasis = (key: string | number): 'normal' | 'dimmed' | 'dominated' => {\n if (focusKey === undefined || key === focusKey) return 'normal';\n if (!showDominatedArea) return 'dimmed';\n return dominatedKeys.has(key) ? 'dominated' : 'normal';\n };\n const isDimmed = (key: string | number) => getEmphasis(key) !== 'normal';\n const animatedCls = showAnimation ? undefined : styles.noTransition;\n\n const handleClick = (item: NormalizedBenchmarkItem) => {\n if (!onValueChange) return;\n if (selectedKey === item.key) {\n setSelectedKey(undefined);\n onValueChange(null);\n return;\n }\n setSelectedKey(item.key);\n const payload: BenchmarkEventProps = {\n ...item.original,\n eventType: 'point',\n rank: item.rank,\n value: item.value,\n };\n onValueChange(payload);\n };\n\n const handleMetricChange = (key: string) => {\n if (metric === undefined) setInnerMetric(key);\n onMetricChange?.(key);\n };\n\n const renderTooltip = (point: PlotPoint, child: ReactNode) => {\n if (!showTooltip) return child;\n\n const { item } = point;\n const rows: Array<{ format: (_value: number) => string; name: string; value: number }> = [];\n if (metrics?.length) {\n for (const m of metrics) {\n const value = Number(item.original[m.key]);\n if (!Number.isFinite(value)) continue;\n rows.push({\n format: m.formatter ?? defaultBenchmarkValueFormatter,\n name: m.label,\n value,\n });\n }\n } else {\n rows.push({ format: activeMetric.formatter, name: activeMetric.label, value: point.x });\n }\n rows.reverse();\n rows.push({\n format: (v) =>\n showError && item.error !== undefined\n ? `${yFormatter(v)} ± ${errorFormatter(item.error)}`\n : yFormatter(v),\n name: yName,\n value: point.y,\n });\n\n const formatters = new Map(rows.map((row) => [row.name, row.format]));\n const modelName = toLabelText(item.name);\n\n return (\n <Tooltip\n arrow={false}\n mouseEnterDelay={0.05}\n mouseLeaveDelay={0}\n styles={{\n container: {\n background: 'transparent',\n boxShadow: 'none',\n maxWidth: 'none',\n padding: 0,\n pointerEvents: 'none',\n width: 'max-content',\n },\n content: {\n color: cssVar.colorText,\n fontSize: cssVar.fontSize,\n lineHeight: cssVar.lineHeight,\n maxWidth: 'none',\n overflow: 'visible',\n padding: 0,\n },\n root: { maxWidth: 'none', pointerEvents: 'none' },\n }}\n title={\n <ChartTooltip\n active\n categoryColors={new Map(rows.map((row) => [row.name, point.color]))}\n label={item.provider ? `${modelName} · ${String(item.provider)}` : modelName}\n payload={rows.map((row) => ({ dataKey: row.name, name: row.name, value: row.value }))}\n valueFormatter={(value: number, name?: string) =>\n (formatters.get(name ?? '') ?? String)(Number(value))\n }\n />\n }\n >\n {child}\n </Tooltip>\n );\n };\n\n const renderMarker = (point: PlotPoint, markerSizePx: number, ring = false) =>\n point.item.icon ? (\n <span\n className={ring ? styles.markerIconRing : undefined}\n style={{\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: iconSize,\n justifyContent: 'center',\n transform: markerSizePx === iconSize ? undefined : `scale(${markerSizePx / iconSize})`,\n width: iconSize,\n }}\n >\n {point.item.icon}\n </span>\n ) : (\n renderShape(point.item.original.shape, point.color, markerSizePx, ring)\n );\n\n const hasMetricSwitch = (metrics?.length ?? 0) > 1;\n\n return (\n <div\n className={cx(styles.container, className)}\n ref={ref}\n style={\n {\n '--benchmark-label-font-size': `${labelFontSize}px`,\n '--benchmark-value-label-font-size': `${valueLabelFontSize}px`,\n 'width': width,\n ...style,\n } as CSSProperties\n }\n {...rest}\n >\n {(showLegend && points.length > 0) || hasMetricSwitch ? (\n <div className={styles.header}>\n <div className={styles.legend}>\n {showLegend\n ? points.map((point) => (\n <span\n className={styles.legendItem}\n key={`legend-${point.key}`}\n onClick={() => handleClick(point.item)}\n onMouseEnter={() => setHoverKey(point.key)}\n onMouseLeave={() => setHoverKey(undefined)}\n style={{\n color: point.item.highlighted ? resolvedHighlightColor : undefined,\n cursor: onValueChange ? 'pointer' : undefined,\n opacity: isDimmed(point.key) ? 0.4 : 1,\n }}\n >\n <span className={styles.legendMarker}>{renderMarker(point, 12)}</span>\n {toLabelText(point.item.name)}\n </span>\n ))\n : null}\n </div>\n {hasMetricSwitch ? (\n <Segmented\n onChange={(value) => handleMetricChange(String(value))}\n options={metrics!.map((m) => ({ label: m.label, value: m.key }))}\n size=\"small\"\n value={activeMetric.key}\n />\n ) : null}\n </div>\n ) : null}\n\n <div className={styles.plot} ref={plotRef} style={{ height: plotHeight }}>\n {!points.length ? <NoData noDataText={noDataText} /> : null}\n {layout ? (\n <>\n <svg\n height={plotHeight}\n role=\"img\"\n style={{ display: 'block', overflow: 'visible' }}\n width={plotWidth}\n >\n {showGridLines ? (\n <g>\n {layout.yScale.ticks.map((tick) => {\n const y = layout.yScale.map(tick);\n return (\n <line\n className={styles.gridLine}\n key={`gy-${tick}`}\n x1={layout.left}\n x2={layout.innerRight}\n y1={y}\n y2={y}\n />\n );\n })}\n {layout.xScale.ticks.map((tick) => {\n const x = layout.xScale.map(tick);\n return (\n <line\n className={styles.gridLine}\n key={`gx-${tick}`}\n x1={x}\n x2={x}\n y1={MARGIN_TOP}\n y2={layout.innerBottom}\n />\n );\n })}\n </g>\n ) : null}\n\n {showYAxis ? (\n <g>\n {layout.yScale.ticks.map((tick) => (\n <text\n className={styles.tickLabel}\n dominantBaseline=\"middle\"\n key={`ty-${tick}`}\n textAnchor=\"end\"\n x={layout.left - TICK_GAP}\n y={layout.yScale.map(tick)}\n >\n {yFormatter(tick)}\n </text>\n ))}\n </g>\n ) : null}\n\n {showXAxis ? (\n <g>\n <line\n className={styles.axisLine}\n x1={layout.left}\n x2={layout.innerRight}\n y1={layout.innerBottom}\n y2={layout.innerBottom}\n />\n {layout.xScale.ticks.map((tick) => (\n <text\n className={styles.tickLabel}\n dominantBaseline=\"hanging\"\n key={`tx-${tick}`}\n textAnchor=\"middle\"\n x={layout.xScale.map(tick)}\n y={layout.innerBottom + TICK_GAP}\n >\n {activeMetric.formatter(tick)}\n </text>\n ))}\n </g>\n ) : null}\n\n {yAxisLabel ? (\n <text\n className={styles.axisLabel}\n dominantBaseline=\"hanging\"\n textAnchor=\"middle\"\n transform={`rotate(-90, 0, ${(MARGIN_TOP + layout.innerBottom) / 2})`}\n x={0}\n y={(MARGIN_TOP + layout.innerBottom) / 2}\n >\n {yAxisLabel}\n </text>\n ) : null}\n\n {activeMetric.axisLabel ? (\n <text\n className={styles.axisLabel}\n dominantBaseline=\"auto\"\n textAnchor=\"middle\"\n x={(layout.left + layout.innerRight) / 2}\n y={plotHeight - 4}\n >\n {activeMetric.axisLabel}\n </text>\n ) : null}\n\n {showDominatedArea && focusPoint\n ? (() => {\n const pos = layout.positions.get(focusPoint.key)!;\n const toRight = activeMetric.direction === 'lower';\n const x0 = toRight ? pos.px : layout.left;\n const x1 = toRight ? layout.innerRight : pos.px;\n return (\n <g\n className={styles.dominatedArea}\n data-testid=\"benchmark-scatter-dominated-area\"\n >\n <rect\n fill={resolvedFrontierColor}\n fillOpacity={0.08}\n height={Math.max(0, layout.innerBottom - pos.py)}\n width={Math.max(0, x1 - x0)}\n x={x0}\n y={pos.py}\n />\n <line\n className={styles.dominatedGuide}\n x1={x0}\n x2={x1}\n y1={pos.py}\n y2={pos.py}\n />\n <line\n className={styles.dominatedGuide}\n x1={pos.px}\n x2={pos.px}\n y1={pos.py}\n y2={layout.innerBottom}\n />\n </g>\n );\n })()\n : null}\n\n {enableErrorBars\n ? points.map((point) => {\n const { error } = point.item;\n if (!error) return null;\n const pos = layout.positions.get(point.key)!;\n const top = layout.yScale.map(point.y + error);\n const bottom = layout.yScale.map(point.y - error);\n return (\n <g\n className={styles.errorBar}\n data-testid=\"benchmark-scatter-error-bar\"\n key={`err-${point.key}`}\n opacity={isDimmed(point.key) ? 0.25 : 0.7}\n stroke={point.color}\n >\n <line x1={pos.px} x2={pos.px} y1={top} y2={bottom} />\n <line x1={pos.px - 4} x2={pos.px + 4} y1={top} y2={top} />\n <line x1={pos.px - 4} x2={pos.px + 4} y1={bottom} y2={bottom} />\n </g>\n );\n })\n : null}\n\n {layout.frontierPath ? (\n <path\n className={styles.frontier}\n d={layout.frontierPath}\n data-testid=\"benchmark-scatter-frontier\"\n opacity={\n !showDominatedArea && focusKey !== undefined && !frontierKeys.has(focusKey)\n ? 0.35\n : 1\n }\n stroke={resolvedFrontierColor}\n strokeWidth={frontierWidth}\n style={showAnimation ? { transition: `d 0.4s, opacity 0.2s` } : undefined}\n />\n ) : null}\n </svg>\n\n <div className={styles.overlay}>\n {points.map((point) => {\n const pos = layout.positions.get(point.key)!;\n const markerPx = point.item.icon ? iconSize : markerSize;\n return (\n <div key={`marker-${point.key}`}>\n {renderTooltip(\n point,\n <div\n aria-label={`${toLabelText(point.item.name)}: ${yFormatter(point.y)}, ${activeMetric.formatter(point.x)}`}\n className={cx(styles.marker, animatedCls)}\n onClick={() => handleClick(point.item)}\n onMouseEnter={() => setHoverKey(point.key)}\n onMouseLeave={() => setHoverKey(undefined)}\n role=\"button\"\n style={{\n cursor: onValueChange ? 'pointer' : 'default',\n filter:\n getEmphasis(point.key) === 'dominated' ? 'grayscale(1)' : undefined,\n height: markerPx,\n left: pos.px,\n opacity: { dimmed: 0.25, dominated: 0.5, normal: 1 }[\n getEmphasis(point.key)\n ],\n top: pos.py,\n width: markerPx,\n }}\n >\n {renderMarker(point, markerPx, true)}\n </div>,\n )}\n </div>\n );\n })}\n\n {showLabels\n ? points.map((point) => {\n const label = layout.labels.get(point.key);\n if (!label) return null;\n const emphasis = getEmphasis(point.key);\n const textColor =\n emphasis === 'dominated'\n ? cssVar.colorTextQuaternary\n : point.item.highlighted\n ? resolvedHighlightColor\n : undefined;\n const isKeyLabel =\n emphasis !== 'dominated' &&\n (frontierKeys.has(point.key) ||\n point.item.highlighted ||\n point.key === focusKey);\n const align = label.placement.endsWith('left')\n ? 'right'\n : label.placement === 'top' || label.placement === 'bottom'\n ? 'center'\n : 'left';\n const name = toLabelText(point.item.name);\n\n return (\n <div\n className={cx(styles.label, animatedCls)}\n key={`label-${point.key}`}\n onClick={() => handleClick(point.item)}\n onMouseEnter={() => setHoverKey(point.key)}\n onMouseLeave={() => setHoverKey(undefined)}\n style={{\n cursor: onValueChange ? 'pointer' : 'default',\n height: label.height,\n left: label.x,\n opacity: emphasis === 'dimmed' ? 0.25 : 1,\n textAlign: align,\n top: label.y,\n width: label.width,\n }}\n >\n <div\n className={cx(styles.labelName, isKeyLabel && styles.labelNameEmphasis)}\n style={textColor ? { color: textColor } : undefined}\n >\n {point.item.href ? (\n <A\n className={styles.labelNameLink}\n href={point.item.href}\n onClick={(event) => event.stopPropagation()}\n target={point.item.target}\n >\n {name}\n </A>\n ) : (\n name\n )}\n </div>\n {showValueLabel ? (\n <div className={styles.labelValue}>\n {yFormatter(point.y)} · {activeMetric.formatter(point.x)}\n </div>\n ) : null}\n </div>\n );\n })\n : null}\n </div>\n </>\n ) : null}\n </div>\n </div>\n );\n },\n);\n\nBenchmarkScatterChart.displayName = 'BenchmarkScatterChart';\n\nexport default BenchmarkScatterChart;\n"],"mappings":";;;;;;;;;;;;;;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A;QACG,WAAW,MAAM,CAAC;QAAE;QAAI,aAAa,UAAU,MAAM,CAAC;OACpD;MACH,CAAA,IAAA,IACD;KApCE,GAAA,SAAS,MAAM,KAoCjB;IAET,CAAC,IACD,IACD;GACL,CAAA,CAAA,EAAA,CAAA,IACA,IACD;EACF,CAAA,CAAA;;AAET,CACF;AAEA,sBAAsB,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/BenchmarkScatterChart/index.tsx"],"sourcesContent":["'use client';\n\nimport { A, Segmented, Skeleton, Tooltip, cssVar, cx, useTheme } from '@lobehub/ui';\nimport { useSize } from 'ahooks';\nimport { type CSSProperties, type ReactNode, forwardRef, useMemo, useRef, useState } from 'react';\n\nimport ChartTooltip from '@/common/ChartTooltip';\nimport NoData from '@/common/NoData';\nimport {\n type BenchmarkBaseProps,\n type BenchmarkEventProps,\n type BenchmarkPointShape,\n type NormalizedBenchmarkItem,\n defaultBenchmarkErrorFormatter,\n defaultBenchmarkValueFormatter,\n normalizeBenchmarkData,\n} from '@/common/benchmark';\nimport { constructCategoryColors } from '@/common/utils';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { getTextWidth } from '@/utils/getMaxLabelLength';\n\nimport { styles } from './styles';\nimport {\n type Box,\n type LabelCandidate,\n type PlacedLabel,\n type ScaleType,\n createScale,\n getParetoFrontier,\n placeLabels,\n} from './utils';\n\nexport interface BenchmarkScatterMetric {\n /**\n * Axis title; falls back to `label`\n */\n axisLabel?: string;\n /**\n * Which direction is better on this axis (drives the Pareto frontier)\n * @default 'lower'\n */\n direction?: 'lower' | 'higher';\n formatter?: (value: number) => string;\n /**\n * Record field holding this metric\n */\n key: string;\n /**\n * Label shown in the metric switcher and tooltip\n */\n label: string;\n max?: number;\n min?: number;\n /**\n * @default 'linear'\n */\n scale?: ScaleType;\n}\n\nexport interface BenchmarkScatterChartProps extends Omit<BenchmarkBaseProps, 'sortOrder'> {\n /**\n * Initially selected metric key when `metrics` is provided (uncontrolled)\n */\n defaultMetric?: string;\n /**\n * Pareto frontier line color\n * @default theme.orange\n */\n frontierColor?: string;\n /**\n * @default 2\n */\n frontierWidth?: number;\n /**\n * Size of consumer-provided icons; should match the size the icon renders at.\n * Icons are scaled down from this size in the legend.\n * @default 20\n */\n iconSize?: number;\n /**\n * Font size for the point name label\n * @default 12\n */\n labelFontSize?: number;\n /**\n * Size of the fallback shape marker when an item has no icon\n * @default 12\n */\n markerSize?: number;\n maxX?: number;\n maxY?: number;\n /**\n * Selected metric key (controlled)\n */\n metric?: string;\n /**\n * Switchable X metrics (e.g. Cost / Speed). Overrides `xKey`, `xScale`,\n * `xFormatter`, `xAxisLabel` and `xDirection` for the active metric.\n */\n metrics?: BenchmarkScatterMetric[];\n minX?: number;\n minY?: number;\n onMetricChange?: (metric: string) => void;\n /**\n * On hover, shade the region the point dominates (worse X and lower Y)\n * and gray out the points inside it. When off, all other points are dimmed instead.\n * @default true\n */\n showDominatedArea?: boolean;\n /**\n * Draw vertical error bars when records have `error`\n * @default true\n */\n showErrorBars?: boolean;\n /**\n * Connect non-dominated points with a Pareto frontier line\n * @default true\n */\n showFrontier?: boolean;\n /**\n * @default true\n */\n showGridLines?: boolean;\n /**\n * Show name labels next to points (placed automatically to avoid overlap)\n * @default true\n */\n showLabels?: boolean;\n /**\n * @default true\n */\n showLegend?: boolean;\n /**\n * @default true\n */\n showTooltip?: boolean;\n /**\n * Show `y · x` values under each point label\n * @default true\n */\n showValueLabel?: boolean;\n /**\n * @default true\n */\n showXAxis?: boolean;\n /**\n * @default true\n */\n showYAxis?: boolean;\n /**\n * Font size for the `y · x` value line\n * @default 11\n */\n valueLabelFontSize?: number;\n xAxisLabel?: string;\n /**\n * Which direction is better on X (drives the Pareto frontier)\n * @default 'lower'\n */\n xDirection?: 'lower' | 'higher';\n xFormatter?: (value: number) => string;\n /**\n * Record field used for the X axis\n * @default 'x'\n */\n xKey?: string;\n /**\n * X axis scale\n * @default 'linear'\n */\n xScale?: ScaleType;\n yAxisLabel?: string;\n}\n\ninterface PlotPoint {\n color: string;\n item: NormalizedBenchmarkItem;\n key: string | number;\n x: number;\n y: number;\n}\n\nconst labelPriority = (point: PlotPoint, frontierKeys: ReadonlySet<string | number>) =>\n (frontierKeys.has(point.key) ? 0 : 2) + (point.item.highlighted ? 0 : 1);\n\nconst MARGIN_TOP = 12;\nconst MARGIN_RIGHT = 16;\nconst TICK_GAP = 8;\nconst AXIS_TITLE_SIZE = 22;\n// Monospace glyph advance relative to font size (Geist Mono / SF Mono ≈ 0.6em)\nconst MONO_CHAR_RATIO = 0.62;\n\nconst renderShape = (\n shape: BenchmarkPointShape | undefined,\n color: string,\n size: number,\n ring = false,\n) => {\n const half = size / 2;\n let node: ReactNode;\n switch (shape) {\n case 'square': {\n node = (\n <rect\n fill={color}\n height={size * 0.84}\n width={size * 0.84}\n x={size * 0.08}\n y={size * 0.08}\n />\n );\n break;\n }\n case 'diamond': {\n node = <path d={`M${half},0 L${size},${half} L${half},${size} L0,${half} Z`} fill={color} />;\n break;\n }\n case 'triangle': {\n node = <path d={`M${half},0 L${size},${size * 0.9} L0,${size * 0.9} Z`} fill={color} />;\n break;\n }\n default: {\n node = <circle cx={half} cy={half} fill={color} r={half} />;\n }\n }\n return (\n <svg height={size} style={{ display: 'block', overflow: 'visible' }} width={size}>\n {ring ? (\n <g paintOrder=\"stroke\" stroke={cssVar.colorBgContainer} strokeWidth={4}>\n {node}\n </g>\n ) : (\n node\n )}\n </svg>\n );\n};\n\nconst toLabelText = (name: ReactNode) => String(name ?? '').replaceAll('\\n', ' ');\n\nconst BenchmarkScatterChart = forwardRef<HTMLDivElement, BenchmarkScatterChartProps>(\n (props, ref) => {\n const theme = useTheme();\n const themeColorRange = useThemeColorRange();\n const {\n data = [],\n index,\n valueKey,\n providerKey,\n iconKey,\n colorKey,\n errorKey,\n renderIcon,\n valueFormatter = defaultBenchmarkValueFormatter,\n accuracyFormatter,\n errorFormatter = defaultBenchmarkErrorFormatter,\n showError = true,\n showErrorBars = true,\n showAnimation = false,\n onValueChange,\n className,\n style,\n loading,\n width = '100%',\n height = 420,\n noDataText,\n highlightColor,\n frontierColor,\n frontierWidth = 2,\n iconSize = 20,\n markerSize = 12,\n labelFontSize = 12,\n valueLabelFontSize = 11,\n metrics,\n metric,\n defaultMetric,\n onMetricChange,\n minX,\n maxX,\n minY,\n maxY,\n showDominatedArea = true,\n showFrontier = true,\n showGridLines = true,\n showLabels = true,\n showLegend = true,\n showTooltip = true,\n showValueLabel = true,\n showXAxis = true,\n showYAxis = true,\n xAxisLabel,\n xDirection = 'lower',\n xFormatter = defaultBenchmarkValueFormatter,\n xKey = 'x',\n xScale = 'linear',\n yAxisLabel,\n ...rest\n } = props;\n\n const plotRef = useRef<HTMLDivElement>(null);\n const size = useSize(plotRef);\n const [innerMetric, setInnerMetric] = useState(defaultMetric);\n const [hoverKey, setHoverKey] = useState<string | number | undefined>();\n const [selectedKey, setSelectedKey] = useState<string | number | undefined>();\n\n const resolvedHighlightColor = highlightColor ?? theme.gold;\n const resolvedFrontierColor = frontierColor ?? theme.orange;\n const yFormatter = accuracyFormatter ?? valueFormatter;\n const yName = yAxisLabel || (accuracyFormatter ? 'Accuracy' : 'Score');\n\n const activeMetric = useMemo(() => {\n if (metrics?.length) {\n const key = metric ?? innerMetric;\n const found = metrics.find((m) => m.key === key) ?? metrics[0];\n return {\n axisLabel: found.axisLabel ?? found.label,\n direction: found.direction ?? 'lower',\n formatter: found.formatter ?? defaultBenchmarkValueFormatter,\n key: found.key,\n label: found.label,\n max: found.max ?? maxX,\n min: found.min ?? minX,\n scale: found.scale ?? 'linear',\n };\n }\n return {\n axisLabel: xAxisLabel,\n direction: xDirection,\n formatter: xFormatter,\n key: xKey,\n label: xAxisLabel || 'X',\n max: maxX,\n min: minX,\n scale: xScale,\n };\n }, [\n innerMetric,\n maxX,\n metric,\n metrics,\n minX,\n xAxisLabel,\n xDirection,\n xFormatter,\n xKey,\n xScale,\n ]);\n\n const items = useMemo(\n () =>\n normalizeBenchmarkData({\n colorKey,\n data,\n errorKey,\n iconKey,\n index,\n providerKey,\n renderIcon,\n sortOrder: 'descending',\n valueKey,\n }),\n [colorKey, data, errorKey, iconKey, index, providerKey, renderIcon, valueKey],\n );\n\n const categoryColors = useMemo(\n () =>\n constructCategoryColors(\n items.map((item) => String(item.key)),\n themeColorRange,\n ),\n [items, themeColorRange],\n );\n\n const points: PlotPoint[] = useMemo(\n () =>\n items\n .map((item) => ({\n color: item.color ?? categoryColors.get(String(item.key)) ?? cssVar.colorPrimary,\n item,\n key: item.key,\n x: Number(item.original[activeMetric.key]),\n y: item.value,\n }))\n .filter(\n (p) =>\n Number.isFinite(p.x) &&\n Number.isFinite(p.y) &&\n (activeMetric.scale !== 'log' || p.x > 0),\n ),\n [activeMetric.key, activeMetric.scale, categoryColors, items],\n );\n\n const frontier = useMemo(\n () => (showFrontier ? getParetoFrontier(points, activeMetric.direction) : []),\n [activeMetric.direction, points, showFrontier],\n );\n const frontierKeys = useMemo(() => new Set(frontier.map((p) => p.key)), [frontier]);\n\n const enableErrorBars = showError && showErrorBars;\n const yValues = useMemo(\n () =>\n points.flatMap((p) =>\n enableErrorBars && p.item.error ? [p.y - p.item.error, p.y + p.item.error] : [p.y],\n ),\n [enableErrorBars, points],\n );\n\n const labelSizes = useMemo(() => {\n const map = new Map<string | number, { height: number; width: number }>();\n if (!showLabels) return map;\n const nameScale = (labelFontSize / 12) * 1.1;\n for (const p of points) {\n const nameWidth = getTextWidth(toLabelText(p.item.name)) * nameScale;\n const valueWidth = showValueLabel\n ? `${yFormatter(p.y)} · ${activeMetric.formatter(p.x)}`.length *\n valueLabelFontSize *\n MONO_CHAR_RATIO\n : 0;\n map.set(p.key, {\n height: Math.ceil(labelFontSize * 1.3 + (showValueLabel ? valueLabelFontSize * 1.3 : 0)),\n width: Math.ceil(Math.max(nameWidth, valueWidth)) + 2,\n });\n }\n return map;\n }, [\n activeMetric,\n labelFontSize,\n points,\n showLabels,\n showValueLabel,\n valueLabelFontSize,\n yFormatter,\n ]);\n\n const plotWidth = size?.width || (typeof width === 'number' ? width : 0);\n const plotHeight = typeof height === 'number' ? height : 420;\n\n const layout = useMemo(() => {\n if (!plotWidth || !points.length) return null;\n\n const probeY = createScale({ max: maxY, min: minY, range: [0, 1], values: yValues });\n const yTickWidth = showYAxis\n ? Math.max(...probeY.ticks.map((t) => yFormatter(t).length * 12 * MONO_CHAR_RATIO), 0)\n : 0;\n\n const left = (showYAxis ? yTickWidth + TICK_GAP + 4 : 4) + (yAxisLabel ? AXIS_TITLE_SIZE : 0);\n const bottom = (showXAxis ? 26 : 4) + (activeMetric.axisLabel ? AXIS_TITLE_SIZE : 0);\n const innerRight = plotWidth - MARGIN_RIGHT;\n const innerBottom = plotHeight - bottom;\n\n const xScaleObj = createScale({\n max: activeMetric.max,\n min: activeMetric.min,\n range: [left, innerRight],\n type: activeMetric.scale,\n values: points.map((p) => p.x),\n });\n const yScaleObj = createScale({\n max: maxY,\n min: minY,\n range: [innerBottom, MARGIN_TOP],\n values: yValues,\n });\n\n const positions = new Map<string | number, { px: number; py: number; radius: number }>();\n for (const p of points) {\n positions.set(p.key, {\n px: xScaleObj.map(p.x),\n py: yScaleObj.map(p.y),\n radius: (p.item.icon ? iconSize : markerSize) / 2,\n });\n }\n\n const frontierPath = frontier\n .map((p, i) => {\n const pos = positions.get(p.key)!;\n return `${i === 0 ? 'M' : 'L'}${pos.px.toFixed(2)},${pos.py.toFixed(2)}`;\n })\n .join(' ');\n\n let labels = new Map<string | number, PlacedLabel>();\n if (showLabels) {\n const lineBoxes: Box[] = [];\n for (let i = 1; i < frontier.length; i++) {\n const a = positions.get(frontier[i - 1].key)!;\n const b = positions.get(frontier[i].key)!;\n const steps = Math.max(1, Math.ceil(Math.hypot(b.px - a.px, b.py - a.py) / 10));\n for (let s = 0; s <= steps; s++) {\n const t = s / steps;\n lineBoxes.push({\n height: 6,\n width: 6,\n x: a.px + (b.px - a.px) * t - 3,\n y: a.py + (b.py - a.py) * t - 3,\n });\n }\n }\n\n const ordered = [...points].sort(\n (a, b) => labelPriority(a, frontierKeys) - labelPriority(b, frontierKeys) || b.y - a.y,\n );\n const candidates: LabelCandidate[] = ordered.map((p) => {\n const pos = positions.get(p.key)!;\n const labelSize = labelSizes.get(p.key) ?? { height: 16, width: 40 };\n return { ...labelSize, key: p.key, ...pos };\n });\n\n labels = placeLabels(\n candidates,\n { height: innerBottom, width: plotWidth - left + MARGIN_RIGHT, x: left, y: 0 },\n { lines: lineBoxes },\n );\n }\n\n return {\n bottom,\n frontierPath,\n innerBottom,\n innerRight,\n labels,\n left,\n positions,\n xScale: xScaleObj,\n yScale: yScaleObj,\n };\n }, [\n activeMetric,\n frontier,\n frontierKeys,\n iconSize,\n labelSizes,\n markerSize,\n maxY,\n minY,\n plotHeight,\n plotWidth,\n points,\n showLabels,\n showXAxis,\n showYAxis,\n yAxisLabel,\n yFormatter,\n yValues,\n ]);\n\n if (loading || !data) return <Skeleton height={plotHeight} width={width} />;\n\n const focusKey = hoverKey ?? selectedKey;\n const focusPoint =\n focusKey === undefined ? undefined : points.find((point) => point.key === focusKey);\n const dominatedKeys = new Set<string | number>();\n if (showDominatedArea && focusPoint) {\n for (const point of points) {\n if (point.key === focusPoint.key || point.y > focusPoint.y) continue;\n const worseX =\n activeMetric.direction === 'lower' ? point.x >= focusPoint.x : point.x <= focusPoint.x;\n if (worseX) dominatedKeys.add(point.key);\n }\n }\n const getEmphasis = (key: string | number): 'normal' | 'dimmed' | 'dominated' => {\n if (focusKey === undefined || key === focusKey) return 'normal';\n if (!showDominatedArea) return 'dimmed';\n return dominatedKeys.has(key) ? 'dominated' : 'normal';\n };\n const isDimmed = (key: string | number) => getEmphasis(key) !== 'normal';\n const animatedCls = showAnimation ? undefined : styles.noTransition;\n\n const handleClick = (item: NormalizedBenchmarkItem) => {\n if (!onValueChange) return;\n if (selectedKey === item.key) {\n setSelectedKey(undefined);\n onValueChange(null);\n return;\n }\n setSelectedKey(item.key);\n const payload: BenchmarkEventProps = {\n ...item.original,\n eventType: 'point',\n rank: item.rank,\n value: item.value,\n };\n onValueChange(payload);\n };\n\n const handleMetricChange = (key: string) => {\n if (metric === undefined) setInnerMetric(key);\n onMetricChange?.(key);\n };\n\n const renderTooltip = (point: PlotPoint, child: ReactNode) => {\n if (!showTooltip) return child;\n\n const { item } = point;\n const rows: Array<{ format: (_value: number) => string; name: string; value: number }> = [];\n if (metrics?.length) {\n for (const m of metrics) {\n const value = Number(item.original[m.key]);\n if (!Number.isFinite(value)) continue;\n rows.push({\n format: m.formatter ?? defaultBenchmarkValueFormatter,\n name: m.label,\n value,\n });\n }\n } else {\n rows.push({ format: activeMetric.formatter, name: activeMetric.label, value: point.x });\n }\n rows.reverse();\n rows.push({\n format: (v) =>\n showError && item.error !== undefined\n ? `${yFormatter(v)} ± ${errorFormatter(item.error)}`\n : yFormatter(v),\n name: yName,\n value: point.y,\n });\n\n const formatters = new Map(rows.map((row) => [row.name, row.format]));\n const modelName = toLabelText(item.name);\n\n return (\n <Tooltip\n arrow={false}\n mouseEnterDelay={0.05}\n mouseLeaveDelay={0}\n styles={{\n container: {\n background: 'transparent',\n boxShadow: 'none',\n maxWidth: 'none',\n padding: 0,\n pointerEvents: 'none',\n width: 'max-content',\n },\n content: {\n color: cssVar.colorText,\n fontSize: cssVar.fontSize,\n lineHeight: cssVar.lineHeight,\n maxWidth: 'none',\n overflow: 'visible',\n padding: 0,\n },\n root: { maxWidth: 'none', pointerEvents: 'none' },\n }}\n title={\n <ChartTooltip\n active\n categoryColors={new Map(rows.map((row) => [row.name, point.color]))}\n label={item.provider ? `${modelName} · ${String(item.provider)}` : modelName}\n payload={rows.map((row) => ({ dataKey: row.name, name: row.name, value: row.value }))}\n valueFormatter={(value: number, name?: string) =>\n (formatters.get(name ?? '') ?? String)(Number(value))\n }\n />\n }\n >\n {child}\n </Tooltip>\n );\n };\n\n const renderMarker = (point: PlotPoint, markerSizePx: number, ring = false) =>\n point.item.icon ? (\n <span\n className={ring ? styles.markerIconRing : undefined}\n style={{\n alignItems: 'center',\n display: 'flex',\n flexShrink: 0,\n height: iconSize,\n justifyContent: 'center',\n transform: markerSizePx === iconSize ? undefined : `scale(${markerSizePx / iconSize})`,\n width: iconSize,\n }}\n >\n {point.item.icon}\n </span>\n ) : (\n renderShape(point.item.original.shape, point.color, markerSizePx, ring)\n );\n\n const hasMetricSwitch = (metrics?.length ?? 0) > 1;\n\n return (\n <div\n className={cx(styles.container, className)}\n ref={ref}\n style={\n {\n '--benchmark-label-font-size': `${labelFontSize}px`,\n '--benchmark-value-label-font-size': `${valueLabelFontSize}px`,\n 'width': width,\n ...style,\n } as CSSProperties\n }\n {...rest}\n >\n {(showLegend && points.length > 0) || hasMetricSwitch ? (\n <div className={styles.header}>\n <div className={styles.legend}>\n {showLegend\n ? points.map((point) => (\n <span\n className={styles.legendItem}\n key={`legend-${point.key}`}\n onClick={() => handleClick(point.item)}\n onMouseEnter={() => setHoverKey(point.key)}\n onMouseLeave={() => setHoverKey(undefined)}\n style={{\n color: point.item.highlighted ? resolvedHighlightColor : undefined,\n cursor: onValueChange ? 'pointer' : undefined,\n opacity: isDimmed(point.key) ? 0.4 : 1,\n }}\n >\n <span className={styles.legendMarker}>{renderMarker(point, 12)}</span>\n {toLabelText(point.item.name)}\n </span>\n ))\n : null}\n </div>\n {hasMetricSwitch ? (\n <Segmented\n onChange={(value) => handleMetricChange(String(value))}\n options={metrics!.map((m) => ({ label: m.label, value: m.key }))}\n size=\"small\"\n value={activeMetric.key}\n />\n ) : null}\n </div>\n ) : null}\n\n <div className={styles.plot} ref={plotRef} style={{ height: plotHeight }}>\n {!points.length ? <NoData noDataText={noDataText} /> : null}\n {layout ? (\n <>\n <svg\n height={plotHeight}\n role=\"img\"\n style={{ display: 'block', overflow: 'visible' }}\n width={plotWidth}\n >\n {showGridLines ? (\n <g>\n {layout.yScale.ticks.map((tick) => {\n const y = layout.yScale.map(tick);\n return (\n <line\n className={styles.gridLine}\n key={`gy-${tick}`}\n x1={layout.left}\n x2={layout.innerRight}\n y1={y}\n y2={y}\n />\n );\n })}\n {layout.xScale.ticks.map((tick) => {\n const x = layout.xScale.map(tick);\n return (\n <line\n className={styles.gridLine}\n key={`gx-${tick}`}\n x1={x}\n x2={x}\n y1={MARGIN_TOP}\n y2={layout.innerBottom}\n />\n );\n })}\n </g>\n ) : null}\n\n {showYAxis ? (\n <g>\n {layout.yScale.ticks.map((tick) => (\n <text\n className={styles.tickLabel}\n dominantBaseline=\"middle\"\n key={`ty-${tick}`}\n textAnchor=\"end\"\n x={layout.left - TICK_GAP}\n y={layout.yScale.map(tick)}\n >\n {yFormatter(tick)}\n </text>\n ))}\n </g>\n ) : null}\n\n {showXAxis ? (\n <g>\n <line\n className={styles.axisLine}\n x1={layout.left}\n x2={layout.innerRight}\n y1={layout.innerBottom}\n y2={layout.innerBottom}\n />\n {layout.xScale.ticks.map((tick) => (\n <text\n className={styles.tickLabel}\n dominantBaseline=\"hanging\"\n key={`tx-${tick}`}\n textAnchor=\"middle\"\n x={layout.xScale.map(tick)}\n y={layout.innerBottom + TICK_GAP}\n >\n {activeMetric.formatter(tick)}\n </text>\n ))}\n </g>\n ) : null}\n\n {yAxisLabel ? (\n <text\n className={styles.axisLabel}\n dominantBaseline=\"hanging\"\n textAnchor=\"middle\"\n transform={`rotate(-90, 0, ${(MARGIN_TOP + layout.innerBottom) / 2})`}\n x={0}\n y={(MARGIN_TOP + layout.innerBottom) / 2}\n >\n {yAxisLabel}\n </text>\n ) : null}\n\n {activeMetric.axisLabel ? (\n <text\n className={styles.axisLabel}\n dominantBaseline=\"auto\"\n textAnchor=\"middle\"\n x={(layout.left + layout.innerRight) / 2}\n y={plotHeight - 4}\n >\n {activeMetric.axisLabel}\n </text>\n ) : null}\n\n {showDominatedArea && focusPoint\n ? (() => {\n const pos = layout.positions.get(focusPoint.key)!;\n const toRight = activeMetric.direction === 'lower';\n const x0 = toRight ? pos.px : layout.left;\n const x1 = toRight ? layout.innerRight : pos.px;\n return (\n <g\n className={styles.dominatedArea}\n data-testid=\"benchmark-scatter-dominated-area\"\n >\n <rect\n fill={resolvedFrontierColor}\n fillOpacity={0.08}\n height={Math.max(0, layout.innerBottom - pos.py)}\n width={Math.max(0, x1 - x0)}\n x={x0}\n y={pos.py}\n />\n <line\n className={styles.dominatedGuide}\n x1={x0}\n x2={x1}\n y1={pos.py}\n y2={pos.py}\n />\n <line\n className={styles.dominatedGuide}\n x1={pos.px}\n x2={pos.px}\n y1={pos.py}\n y2={layout.innerBottom}\n />\n </g>\n );\n })()\n : null}\n\n {enableErrorBars\n ? points.map((point) => {\n const { error } = point.item;\n if (!error) return null;\n const pos = layout.positions.get(point.key)!;\n const top = layout.yScale.map(point.y + error);\n const bottom = layout.yScale.map(point.y - error);\n return (\n <g\n className={styles.errorBar}\n data-testid=\"benchmark-scatter-error-bar\"\n key={`err-${point.key}`}\n opacity={isDimmed(point.key) ? 0.25 : 0.7}\n stroke={point.color}\n >\n <line x1={pos.px} x2={pos.px} y1={top} y2={bottom} />\n <line x1={pos.px - 4} x2={pos.px + 4} y1={top} y2={top} />\n <line x1={pos.px - 4} x2={pos.px + 4} y1={bottom} y2={bottom} />\n </g>\n );\n })\n : null}\n\n {layout.frontierPath ? (\n <path\n className={styles.frontier}\n d={layout.frontierPath}\n data-testid=\"benchmark-scatter-frontier\"\n opacity={\n !showDominatedArea && focusKey !== undefined && !frontierKeys.has(focusKey)\n ? 0.35\n : 1\n }\n stroke={resolvedFrontierColor}\n strokeWidth={frontierWidth}\n style={showAnimation ? { transition: `d 0.4s, opacity 0.2s` } : undefined}\n />\n ) : null}\n </svg>\n\n <div className={styles.overlay}>\n {points.map((point) => {\n const pos = layout.positions.get(point.key)!;\n const markerPx = point.item.icon ? iconSize : markerSize;\n return (\n <div key={`marker-${point.key}`}>\n {renderTooltip(\n point,\n <div\n aria-label={`${toLabelText(point.item.name)}: ${yFormatter(point.y)}, ${activeMetric.formatter(point.x)}`}\n className={cx(styles.marker, animatedCls)}\n onClick={() => handleClick(point.item)}\n onMouseEnter={() => setHoverKey(point.key)}\n onMouseLeave={() => setHoverKey(undefined)}\n role=\"button\"\n style={{\n cursor: onValueChange ? 'pointer' : 'default',\n filter:\n getEmphasis(point.key) === 'dominated' ? 'grayscale(1)' : undefined,\n height: markerPx,\n left: pos.px,\n opacity: { dimmed: 0.25, dominated: 0.5, normal: 1 }[\n getEmphasis(point.key)\n ],\n top: pos.py,\n width: markerPx,\n }}\n >\n {renderMarker(point, markerPx, true)}\n </div>,\n )}\n </div>\n );\n })}\n\n {showLabels\n ? points.map((point) => {\n const label = layout.labels.get(point.key);\n if (!label) return null;\n const emphasis = getEmphasis(point.key);\n const textColor =\n emphasis === 'dominated'\n ? cssVar.colorTextQuaternary\n : point.item.highlighted\n ? resolvedHighlightColor\n : undefined;\n const isKeyLabel =\n emphasis !== 'dominated' &&\n (frontierKeys.has(point.key) ||\n point.item.highlighted ||\n point.key === focusKey);\n const align = label.placement.endsWith('left')\n ? 'right'\n : label.placement === 'top' || label.placement === 'bottom'\n ? 'center'\n : 'left';\n const name = toLabelText(point.item.name);\n\n return (\n <div\n className={cx(styles.label, animatedCls)}\n key={`label-${point.key}`}\n onClick={() => handleClick(point.item)}\n onMouseEnter={() => setHoverKey(point.key)}\n onMouseLeave={() => setHoverKey(undefined)}\n style={{\n cursor: onValueChange ? 'pointer' : 'default',\n height: label.height,\n left: label.x,\n opacity: emphasis === 'dimmed' ? 0.25 : 1,\n textAlign: align,\n top: label.y,\n width: label.width,\n }}\n >\n <div\n className={cx(styles.labelName, isKeyLabel && styles.labelNameEmphasis)}\n style={textColor ? { color: textColor } : undefined}\n >\n {point.item.href ? (\n <A\n className={styles.labelNameLink}\n href={point.item.href}\n onClick={(event) => event.stopPropagation()}\n target={point.item.target}\n >\n {name}\n </A>\n ) : (\n name\n )}\n </div>\n {showValueLabel ? (\n <div className={styles.labelValue}>\n {yFormatter(point.y)} · {activeMetric.formatter(point.x)}\n </div>\n ) : null}\n </div>\n );\n })\n : null}\n </div>\n </>\n ) : null}\n </div>\n </div>\n );\n },\n);\n\nBenchmarkScatterChart.displayName = 'BenchmarkScatterChart';\n\nexport default BenchmarkScatterChart;\n"],"mappings":";;;;;;;;;;;;;;AAsLA,MAAM,iBAAiB,OAAkB,kBACtC,aAAa,IAAI,MAAM,GAAG,IAAI,IAAI,MAAM,MAAM,KAAK,cAAc,IAAI;AAExE,MAAM,aAAa;AACnB,MAAM,eAAe;AACrB,MAAM,WAAW;AACjB,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,eACJ,OACA,OACA,MACA,OAAO,UACJ;CACH,MAAM,OAAO,OAAO;CACpB,IAAI;CACJ,QAAQ,OAAR;EACE,KAAK;GACH,OACE,oBAAC,QAAD;IACE,MAAM;IACN,QAAQ,OAAO;IACf,OAAO,OAAO;IACd,GAAG,OAAO;IACV,GAAG,OAAO;GACX,CAAA;GAEH;EAEF,KAAK;GACH,OAAO,oBAAC,QAAD;IAAM,GAAG,IAAI,KAAK,MAAM,KAAK,GAAG,KAAK,IAAI,KAAK,GAAG,KAAK,MAAM,KAAK;IAAK,MAAM;GAAQ,CAAA;GAC3F;EAEF,KAAK;GACH,OAAO,oBAAC,QAAD;IAAM,GAAG,IAAI,KAAK,MAAM,KAAK,GAAG,OAAO,GAAI,MAAM,OAAO,GAAI;IAAK,MAAM;GAAQ,CAAA;GACtF;EAEF,SACE,OAAO,oBAAC,UAAD;GAAQ,IAAI;GAAM,IAAI;GAAM,MAAM;GAAO,GAAG;EAAO,CAAA;CAE9D;CACA,OACE,oBAAC,OAAD;EAAK,QAAQ;EAAM,OAAO;GAAE,SAAS;GAAS,UAAU;EAAU;EAAG,OAAO;EACzE,UAAA,OACC,oBAAC,KAAD;GAAG,YAAW;GAAS,QAAQ,OAAO;GAAkB,aAAa;GAClE,UAAA;EACA,CAAA,IAEH;CAEC,CAAA;AAET;AAEA,MAAM,eAAe,SAAoB,OAAO,QAAQ,EAAE,CAAC,CAAC,WAAW,MAAM,G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M,gBAAgB;QAC1C,QAAQ,MAAM,KAAK;QAElB,UAAA;OACA,CAAA,IAEH;MAEC,CAAA,GACJ,iBACC,qBAAC,OAAD;OAAK,WAAW,OAAO;OAAvB,UAAA;QACG,WAAW,MAAM,CAAC;QAAE;QAAI,aAAa,UAAU,MAAM,CAAC;OACpD;MACH,CAAA,IAAA,IACD;KApCE,GAAA,SAAS,MAAM,KAoCjB;IAET,CAAC,IACD,IACD;GACL,CAAA,CAAA,EAAA,CAAA,IACA,IACD;EACF,CAAA,CAAA;;AAET,CACF;AAEA,sBAAsB,cAAc"}
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/BenchmarkScatterChart/styles.ts
3
3
  const mono = `'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace`;
4
4
  const styles = createStaticStyles(({ css, cssVar }) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"styles.mjs","names":[],"sources":["../../src/BenchmarkScatterChart/styles.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nconst mono = `'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace`;\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n axisLabel: css`\n font-size: 12px;\n fill: ${cssVar.colorTextTertiary};\n `,\n axisLine: css`\n stroke: ${cssVar.colorBorderSecondary};\n stroke-width: 1;\n `,\n container: css`\n position: relative;\n min-width: 0;\n `,\n dominatedArea: css`\n pointer-events: none;\n animation: benchmark-scatter-fade-in 0.2s ${cssVar.motionEaseOut};\n\n @keyframes benchmark-scatter-fade-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n `,\n dominatedGuide: css`\n stroke: ${cssVar.colorTextQuaternary};\n stroke-dasharray: 3 3;\n stroke-width: 1;\n `,\n errorBar: css`\n pointer-events: none;\n stroke-width: 1.5;\n `,\n frontier: css`\n pointer-events: none;\n fill: none;\n stroke-linecap: round;\n stroke-linejoin: round;\n `,\n gridLine: css`\n stroke: ${cssVar.colorFillTertiary};\n stroke-width: 1;\n `,\n header: css`\n display: flex;\n gap: 16px;\n align-items: center;\n justify-content: space-between;\n\n margin-block-end: 12px;\n `,\n label: css`\n pointer-events: auto;\n cursor: default;\n\n position: absolute;\n z-index: 2;\n\n display: flex;\n flex-direction: column;\n gap: 1px;\n justify-content: center;\n\n white-space: nowrap;\n\n transition:\n left 0.4s ${cssVar.motionEaseInOut},\n top 0.4s ${cssVar.motionEaseInOut},\n opacity 0.2s;\n `,\n labelName: css`\n overflow: hidden;\n\n font-size: var(--benchmark-label-font-size, 12px);\n font-weight: 500;\n line-height: 1.25;\n color: ${cssVar.colorTextSecondary};\n text-overflow: ellipsis;\n\n transition: color 0.2s;\n `,\n labelNameEmphasis: css`\n font-weight: 600;\n color: ${cssVar.colorText};\n `,\n labelNameLink: css`\n color: inherit !important;\n\n &:hover {\n color: ${cssVar.colorLinkHover} !important;\n }\n `,\n labelValue: css`\n font-family: ${mono};\n font-size: var(--benchmark-value-label-font-size, 11px);\n font-variant-numeric: tabular-nums;\n line-height: 1.25;\n color: ${cssVar.colorTextQuaternary};\n `,\n legend: css`\n display: flex;\n flex: 1;\n flex-flow: row wrap;\n gap: 4px 12px;\n align-items: center;\n\n min-width: 0;\n\n font-size: 12px;\n line-height: 16px;\n color: ${cssVar.colorTextTertiary};\n `,\n legendItem: css`\n cursor: default;\n\n display: inline-flex;\n flex-shrink: 0;\n gap: 5px;\n align-items: center;\n\n transition:\n opacity 0.2s,\n color 0.2s;\n\n &:hover {\n color: ${cssVar.colorText};\n }\n `,\n legendMarker: css`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n width: 12px;\n height: 12px;\n `,\n marker: css`\n position: absolute;\n z-index: 3;\n transform: translate(-50%, -50%);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n transition:\n left 0.4s ${cssVar.motionEaseInOut},\n top 0.4s ${cssVar.motionEaseInOut},\n opacity 0.2s,\n filter 0.2s,\n transform 0.2s;\n\n &:hover {\n transform: translate(-50%, -50%) scale(1.15);\n }\n `,\n markerIconRing: css`\n border-radius: 50%;\n box-shadow: 0 0 0 2px ${cssVar.colorBgContainer};\n `,\n noTransition: css`\n transition: none !important;\n `,\n overlay: css`\n pointer-events: none;\n position: absolute;\n inset: 0;\n\n > * {\n pointer-events: auto;\n }\n `,\n plot: css`\n position: relative;\n width: 100%;\n `,\n tickLabel: css`\n font-family: ${mono};\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n fill: ${cssVar.colorTextQuaternary};\n `,\n}));\n"],"mappings":";;AAEA,MAAM,OAAO;AAEb,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,WAAW,GAAG;;YAEJ,OAAO,kBAAkB;;CAEnC,UAAU,GAAG;cACD,OAAO,qBAAqB;;;CAGxC,WAAW,GAAG;;;;CAId,eAAe,GAAG;;gDAE4B,OAAO,cAAc;;;;;;;;;;;;CAYnE,gBAAgB,GAAG;cACP,OAAO,oBAAoB;;;;CAIvC,UAAU,GAAG;;;;CAIb,UAAU,GAAG;;;;;;CAMb,UAAU,GAAG;cACD,OAAO,kBAAkB;;;CAGrC,QAAQ,GAAG;;;;;;;;CAQX,OAAO,GAAG;;;;;;;;;;;;;;;kBAeM,OAAO,gBAAgB;iBACxB,OAAO,gBAAgB;;;CAGtC,WAAW,GAAG;;;;;;aAMH,OAAO,mBAAmB;;;;;CAKrC,mBAAmB,GAAG;;aAEX,OAAO,UAAU;;CAE5B,eAAe,GAAG;;;;eAIL,OAAO,eAAe;;;CAGnC,YAAY,GAAG;mBACE,KAAK;;;;aAIX,OAAO,oBAAoB;;CAEtC,QAAQ,GAAG;;;;;;;;;;;aAWA,OAAO,kBAAkB;;CAEpC,YAAY,GAAG;;;;;;;;;;;;;eAaF,OAAO,UAAU;;;CAG9B,cAAc,GAAG;;;;;;;;CAQjB,QAAQ,GAAG;;;;;;;;;;kBAUK,OAAO,gBAAgB;iBACxB,OAAO,gBAAgB;;;;;;;;;CAStC,gBAAgB,GAAG;;4BAEO,OAAO,iBAAiB;;CAElD,cAAc,GAAG;;;CAGjB,SAAS,GAAG;;;;;;;;;CASZ,MAAM,GAAG;;;;CAIT,WAAW,GAAG;mBACG,KAAK;;;YAGZ,OAAO,oBAAoB;;AAEvC,EAAE"}
1
+ {"version":3,"file":"styles.mjs","names":[],"sources":["../../src/BenchmarkScatterChart/styles.ts"],"sourcesContent":["import { createStaticStyles } from '@lobehub/ui';\n\nconst mono = `'Geist Mono', SFMono-Regular, Consolas, 'Liberation Mono', monospace`;\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n axisLabel: css`\n font-size: 12px;\n fill: ${cssVar.colorTextTertiary};\n `,\n axisLine: css`\n stroke: ${cssVar.colorBorderSecondary};\n stroke-width: 1;\n `,\n container: css`\n position: relative;\n min-width: 0;\n `,\n dominatedArea: css`\n pointer-events: none;\n animation: benchmark-scatter-fade-in 0.2s ${cssVar.motionEaseOut};\n\n @keyframes benchmark-scatter-fade-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n }\n `,\n dominatedGuide: css`\n stroke: ${cssVar.colorTextQuaternary};\n stroke-dasharray: 3 3;\n stroke-width: 1;\n `,\n errorBar: css`\n pointer-events: none;\n stroke-width: 1.5;\n `,\n frontier: css`\n pointer-events: none;\n fill: none;\n stroke-linecap: round;\n stroke-linejoin: round;\n `,\n gridLine: css`\n stroke: ${cssVar.colorFillTertiary};\n stroke-width: 1;\n `,\n header: css`\n display: flex;\n gap: 16px;\n align-items: center;\n justify-content: space-between;\n\n margin-block-end: 12px;\n `,\n label: css`\n pointer-events: auto;\n cursor: default;\n\n position: absolute;\n z-index: 2;\n\n display: flex;\n flex-direction: column;\n gap: 1px;\n justify-content: center;\n\n white-space: nowrap;\n\n transition:\n left 0.4s ${cssVar.motionEaseInOut},\n top 0.4s ${cssVar.motionEaseInOut},\n opacity 0.2s;\n `,\n labelName: css`\n overflow: hidden;\n\n font-size: var(--benchmark-label-font-size, 12px);\n font-weight: 500;\n line-height: 1.25;\n color: ${cssVar.colorTextSecondary};\n text-overflow: ellipsis;\n\n transition: color 0.2s;\n `,\n labelNameEmphasis: css`\n font-weight: 600;\n color: ${cssVar.colorText};\n `,\n labelNameLink: css`\n color: inherit !important;\n\n &:hover {\n color: ${cssVar.colorLinkHover} !important;\n }\n `,\n labelValue: css`\n font-family: ${mono};\n font-size: var(--benchmark-value-label-font-size, 11px);\n font-variant-numeric: tabular-nums;\n line-height: 1.25;\n color: ${cssVar.colorTextQuaternary};\n `,\n legend: css`\n display: flex;\n flex: 1;\n flex-flow: row wrap;\n gap: 4px 12px;\n align-items: center;\n\n min-width: 0;\n\n font-size: 12px;\n line-height: 16px;\n color: ${cssVar.colorTextTertiary};\n `,\n legendItem: css`\n cursor: default;\n\n display: inline-flex;\n flex-shrink: 0;\n gap: 5px;\n align-items: center;\n\n transition:\n opacity 0.2s,\n color 0.2s;\n\n &:hover {\n color: ${cssVar.colorText};\n }\n `,\n legendMarker: css`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n width: 12px;\n height: 12px;\n `,\n marker: css`\n position: absolute;\n z-index: 3;\n transform: translate(-50%, -50%);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n transition:\n left 0.4s ${cssVar.motionEaseInOut},\n top 0.4s ${cssVar.motionEaseInOut},\n opacity 0.2s,\n filter 0.2s,\n transform 0.2s;\n\n &:hover {\n transform: translate(-50%, -50%) scale(1.15);\n }\n `,\n markerIconRing: css`\n border-radius: 50%;\n box-shadow: 0 0 0 2px ${cssVar.colorBgContainer};\n `,\n noTransition: css`\n transition: none !important;\n `,\n overlay: css`\n pointer-events: none;\n position: absolute;\n inset: 0;\n\n > * {\n pointer-events: auto;\n }\n `,\n plot: css`\n position: relative;\n width: 100%;\n `,\n tickLabel: css`\n font-family: ${mono};\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n fill: ${cssVar.colorTextQuaternary};\n `,\n}));\n"],"mappings":";;AAEA,MAAM,OAAO;AAEb,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,WAAW,GAAG;;YAEJ,OAAO,kBAAkB;;CAEnC,UAAU,GAAG;cACD,OAAO,qBAAqB;;;CAGxC,WAAW,GAAG;;;;CAId,eAAe,GAAG;;gDAE4B,OAAO,cAAc;;;;;;;;;;;;CAYnE,gBAAgB,GAAG;cACP,OAAO,oBAAoB;;;;CAIvC,UAAU,GAAG;;;;CAIb,UAAU,GAAG;;;;;;CAMb,UAAU,GAAG;cACD,OAAO,kBAAkB;;;CAGrC,QAAQ,GAAG;;;;;;;;CAQX,OAAO,GAAG;;;;;;;;;;;;;;;kBAeM,OAAO,gBAAgB;iBACxB,OAAO,gBAAgB;;;CAGtC,WAAW,GAAG;;;;;;aAMH,OAAO,mBAAmB;;;;;CAKrC,mBAAmB,GAAG;;aAEX,OAAO,UAAU;;CAE5B,eAAe,GAAG;;;;eAIL,OAAO,eAAe;;;CAGnC,YAAY,GAAG;mBACE,KAAK;;;;aAIX,OAAO,oBAAoB;;CAEtC,QAAQ,GAAG;;;;;;;;;;;aAWA,OAAO,kBAAkB;;CAEpC,YAAY,GAAG;;;;;;;;;;;;;eAaF,OAAO,UAAU;;;CAG9B,cAAc,GAAG;;;;;;;;CAQjB,QAAQ,GAAG;;;;;;;;;;kBAUK,OAAO,gBAAgB;iBACxB,OAAO,gBAAgB;;;;;;;;;CAStC,gBAAgB,GAAG;;4BAEO,OAAO,iBAAiB;;CAElD,cAAc,GAAG;;;CAGjB,SAAS,GAAG;;;;;;;;;CASZ,MAAM,GAAG;;;;CAIT,WAAW,GAAG;mBACG,KAAK;;;YAGZ,OAAO,oBAAoB;;AAEvC,EAAE"}
@@ -7,9 +7,7 @@ import CustomYAxisTick from "../common/CustomYAxisTick.mjs";
7
7
  import NoData from "../common/NoData.mjs";
8
8
  import { getMaxLabelLength } from "../utils/getMaxLabelLength.mjs";
9
9
  import { styles } from "./styles.mjs";
10
- import { Flexbox } from "@lobehub/ui";
11
- import { Skeleton } from "@lobehub/ui/base-ui";
12
- import { css, cssVar, cx } from "antd-style";
10
+ import { Flexbox, Skeleton, css, cssVar, cx } from "@lobehub/ui";
13
11
  import { forwardRef, useMemo, useState } from "react";
14
12
  import { Bar, CartesianGrid, ComposedChart as ComposedChart$1, Label, Legend, Line, ResponsiveContainer, Tooltip as Tooltip$1, XAxis, YAxis } from "recharts";
15
13
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["ReChartsComposedChart","Tooltip"],"sources":["../../src/ComposedChart/index.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox } from '@lobehub/ui';\nimport { Skeleton } from '@lobehub/ui/base-ui';\nimport { css, cssVar, cx } from 'antd-style';\nimport { forwardRef, useMemo, useState } from 'react';\nimport {\n Bar,\n CartesianGrid,\n Label,\n Legend,\n Line,\n ComposedChart as ReChartsComposedChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport ChartLegend from '@/common/ChartLegend';\nimport ChartTooltip from '@/common/ChartTooltip';\nimport CustomYAxisTick from '@/common/CustomYAxisTick';\nimport NoData from '@/common/NoData';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { defaultValueFormatter } from '@/utils';\nimport { getMaxLabelLength } from '@/utils/getMaxLabelLength';\n\nimport { styles } from './styles';\nimport type { ComposedChartProps } from './types';\n\nexport type { ComposedChartProps, SeriesItem, YAxisConfig } from './types';\n\nconst ComposedChart = forwardRef<HTMLDivElement, ComposedChartProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n const {\n data = [],\n index,\n series = [],\n yAxisLeft,\n yAxisRight,\n colors = themeColorRange,\n xAxisLabelFormatter = defaultValueFormatter,\n startEndOnly = false,\n animationDuration = 900,\n showAnimation = false,\n showXAxis = true,\n showYAxis = true,\n intervalType = 'equidistantPreserveStart',\n showTooltip = true,\n showLegend = true,\n showGridLines = true,\n allowDecimals = true,\n noDataText,\n enableLegendSlider = false,\n rotateLabelX,\n tickGap = 5,\n loading,\n xAxisLabel,\n className,\n width = '100%',\n height = 280,\n style,\n ...rest\n } = props;\n\n const [legendHeight, setLegendHeight] = useState(60);\n\n const seriesColorMap = useMemo(() => {\n const map = new Map<string, string>();\n series.forEach((s, i) => {\n map.set(s.key, s.color ?? colors[i % colors.length]);\n });\n return map;\n }, [series, colors]);\n\n const categoryColors = seriesColorMap;\n const customCategories = useMemo(() => {\n return series.reduce<Record<string, string>>((acc, item) => {\n if (item.name) acc[item.key] = item.name;\n return acc;\n }, {});\n }, [series]);\n\n const hasRightAxis = series.some((s) => s.axis === 'right');\n\n const leftYAxisWidth = useMemo(() => {\n if (yAxisLeft?.width) return yAxisLeft.width;\n const leftFormatter = yAxisLeft?.valueFormatter ?? defaultValueFormatter;\n return getMaxLabelLength({ data, index, layout: 'horizontal', valueFormatter: leftFormatter });\n }, [yAxisLeft, data, index]);\n\n const rightYAxisWidth = useMemo(() => {\n if (yAxisRight?.width) return yAxisRight.width;\n const rightFormatter = yAxisRight?.valueFormatter ?? defaultValueFormatter;\n return getMaxLabelLength({ data, index, layout: 'horizontal', valueFormatter: rightFormatter });\n }, [yAxisRight, data, index]);\n\n if (loading || !data) return <Skeleton height={height} width={width} />;\n\n const paddingValue = !showXAxis && !showYAxis ? 0 : 20;\n\n return (\n <Flexbox\n className={className}\n height={height}\n ref={ref}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n <ResponsiveContainer>\n {data?.length ? (\n <ReChartsComposedChart\n data={data}\n margin={{\n bottom: xAxisLabel ? 30 : undefined,\n left: yAxisLeft?.label ? 20 : undefined,\n right: hasRightAxis ? (yAxisRight?.label ? 20 : 5) : undefined,\n top: 5,\n }}\n >\n {showGridLines && (\n <CartesianGrid className={styles.gridLines} horizontal vertical={false} />\n )}\n\n <XAxis\n angle={rotateLabelX?.angle}\n axisLine={false}\n className={styles.label}\n dataKey={index}\n dy={rotateLabelX?.verticalShift}\n fill=\"\"\n hide={!showXAxis}\n interval={startEndOnly ? 'preserveStartEnd' : intervalType}\n minTickGap={tickGap}\n padding={{ left: paddingValue, right: paddingValue }}\n stroke=\"\"\n tick={{ transform: 'translate(0, 6)' }}\n tickFormatter={xAxisLabelFormatter}\n tickLine={false}\n ticks={startEndOnly ? [data[0][index], data.at(-1)?.[index]] : undefined}\n >\n {xAxisLabel && (\n <Label\n className={cx(styles.strongLabel, styles.emphasis)}\n offset={-20}\n position=\"insideBottom\"\n style={{\n fill: cssVar.colorTextSecondary,\n fontWeight: 500,\n textAnchor: 'middle',\n }}\n >\n {xAxisLabel}\n </Label>\n )}\n </XAxis>\n\n {/* Left Y Axis */}\n <YAxis\n allowDecimals={allowDecimals}\n axisLine={false}\n className={styles.label}\n domain={yAxisLeft?.domain}\n fill=\"\"\n hide={!showYAxis}\n orientation=\"left\"\n stroke=\"\"\n tick={(tickProps) => (\n <CustomYAxisTick\n {...tickProps}\n align=\"left\"\n formatter={yAxisLeft?.valueFormatter ?? defaultValueFormatter}\n yAxisLabel={Boolean(yAxisLeft?.label)}\n />\n )}\n tickFormatter={yAxisLeft?.valueFormatter ?? defaultValueFormatter}\n tickLine={false}\n type=\"number\"\n width={leftYAxisWidth}\n yAxisId=\"left\"\n >\n {yAxisLeft?.label && (\n <Label\n angle={-90}\n className={styles.emphasis}\n offset={-15}\n position=\"insideLeft\"\n style={{\n fill: cssVar.colorTextSecondary,\n fontWeight: 500,\n textAnchor: 'middle',\n }}\n >\n {yAxisLeft.label}\n </Label>\n )}\n </YAxis>\n\n {/* Right Y Axis */}\n {hasRightAxis && (\n <YAxis\n allowDecimals={allowDecimals}\n axisLine={false}\n className={styles.label}\n domain={yAxisRight?.domain}\n fill=\"\"\n hide={!showYAxis}\n orientation=\"right\"\n stroke=\"\"\n tick={(tickProps) => (\n <CustomYAxisTick\n {...tickProps}\n align=\"right\"\n anchor=\"start\"\n formatter={yAxisRight?.valueFormatter ?? defaultValueFormatter}\n yAxisLabel={Boolean(yAxisRight?.label)}\n />\n )}\n tickFormatter={yAxisRight?.valueFormatter ?? defaultValueFormatter}\n tickLine={false}\n type=\"number\"\n width={rightYAxisWidth}\n yAxisId=\"right\"\n >\n {yAxisRight?.label && (\n <Label\n angle={90}\n className={styles.emphasis}\n offset={-15}\n position=\"insideRight\"\n style={{\n fill: cssVar.colorTextSecondary,\n fontWeight: 500,\n textAnchor: 'middle',\n }}\n >\n {yAxisRight.label}\n </Label>\n )}\n </YAxis>\n )}\n\n {showLegend && (\n <Legend\n content={({ payload }) =>\n ChartLegend(\n { payload },\n categoryColors,\n setLegendHeight,\n undefined,\n undefined,\n enableLegendSlider,\n customCategories,\n )\n }\n height={legendHeight}\n verticalAlign=\"top\"\n />\n )}\n\n {series.map((s) => {\n const color = seriesColorMap.get(s.key) ?? cssVar.colorPrimary;\n const axisId = s.axis ?? 'left';\n\n if (s.type === 'bar') {\n return (\n <Bar\n animationDuration={animationDuration}\n className={cx(css`\n fill: ${color};\n `)}\n dataKey={s.key}\n fill=\"\"\n isAnimationActive={showAnimation}\n key={s.key}\n name={s.key}\n yAxisId={axisId}\n />\n );\n }\n\n if (s.type === 'line') {\n return (\n <Line\n animationDuration={animationDuration}\n className={cx(css`\n stroke: ${color};\n `)}\n dataKey={s.key}\n dot={false}\n isAnimationActive={showAnimation}\n key={s.key}\n name={s.key}\n stroke=\"\"\n strokeWidth={2}\n type=\"monotone\"\n yAxisId={axisId}\n />\n );\n }\n\n return null;\n })}\n\n {showTooltip && (\n <Tooltip\n content={({ active, payload, label }) => (\n <ChartTooltip\n active={active}\n categoryColors={categoryColors}\n customCategories={customCategories}\n label={label}\n payload={payload}\n valueFormatter={(value, name) => {\n const currentSeries = series.find((item) => item.key === name);\n const formatter =\n currentSeries?.valueFormatter ??\n (currentSeries?.axis === 'right'\n ? yAxisRight?.valueFormatter\n : yAxisLeft?.valueFormatter) ??\n defaultValueFormatter;\n\n return formatter(value);\n }}\n />\n )}\n cursor={{ stroke: cssVar.colorTextSecondary, strokeWidth: 1 }}\n isAnimationActive={false}\n position={{ y: 0 }}\n wrapperStyle={{ outline: 'none' }}\n />\n )}\n </ReChartsComposedChart>\n ) : (\n <NoData noDataText={noDataText} />\n )}\n </ResponsiveContainer>\n </Flexbox>\n );\n});\n\nComposedChart.displayName = 'ComposedChart';\n\nexport default ComposedChart;\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAM,gBAAgB,YAAgD,OAAO,QAAQ;CACnF,MAAM,kBAAkB,mBAAmB;CAC3C,MAAM,EACJ,OAAO,CAAC,GACR,OACA,SAAS,CAAC,GACV,WACA,YACA,SAAS,iBACT,sBAAsB,uBACtB,eAAe,OACf,oBAAoB,KACpB,gBAAgB,OAChB,YAAY,MACZ,YAAY,MACZ,eAAe,4BACf,cAAc,MACd,aAAa,MACb,gBAAgB,MAChB,gBAAgB,MAChB,YACA,qBAAqB,OACrB,cACA,UAAU,GACV,SACA,YACA,WACA,QAAQ,QACR,SAAS,KACT,OACA,GAAG,SACD;CAEJ,MAAM,CAAC,cAAc,mBAAmB,SAAS,EAAE;CAEnD,MAAM,iBAAiB,cAAc;EACnC,MAAM,sBAAM,IAAI,IAAoB;EACpC,OAAO,SAAS,GAAG,MAAM;GACvB,IAAI,IAAI,EAAE,KAAK,EAAE,SAAS,OAAO,IAAI,OAAO,OAAO;EACrD,CAAC;EACD,OAAO;CACT,GAAG,CAAC,QAAQ,MAAM,CAAC;CAEnB,MAAM,iBAAiB;CACvB,MAAM,mBAAmB,cAAc;EACrC,OAAO,OAAO,QAAgC,KAAK,SAAS;GAC1D,IAAI,KAAK,MAAM,IAAI,KAAK,OAAO,KAAK;GACpC,OAAO;EACT,GAAG,CAAC,CAAC;CACP,GAAG,CAAC,MAAM,CAAC;CAEX,MAAM,eAAe,OAAO,MAAM,MAAM,EAAE,SAAS,OAAO;CAE1D,MAAM,iBAAiB,cAAc;EACnC,IAAI,WAAW,OAAO,OAAO,UAAU;EACvC,MAAM,gBAAgB,WA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 {"version":3,"file":"index.mjs","names":["ReChartsComposedChart","Tooltip"],"sources":["../../src/ComposedChart/index.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, Skeleton, css, cssVar, cx } from '@lobehub/ui';\nimport { forwardRef, useMemo, useState } from 'react';\nimport {\n Bar,\n CartesianGrid,\n Label,\n Legend,\n Line,\n ComposedChart as ReChartsComposedChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport ChartLegend from '@/common/ChartLegend';\nimport ChartTooltip from '@/common/ChartTooltip';\nimport CustomYAxisTick from '@/common/CustomYAxisTick';\nimport NoData from '@/common/NoData';\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { defaultValueFormatter } from '@/utils';\nimport { getMaxLabelLength } from '@/utils/getMaxLabelLength';\n\nimport { styles } from './styles';\nimport type { ComposedChartProps } from './types';\n\nexport type { ComposedChartProps, SeriesItem, YAxisConfig } from './types';\n\nconst ComposedChart = forwardRef<HTMLDivElement, ComposedChartProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n const {\n data = [],\n index,\n series = [],\n yAxisLeft,\n yAxisRight,\n colors = themeColorRange,\n xAxisLabelFormatter = defaultValueFormatter,\n startEndOnly = false,\n animationDuration = 900,\n showAnimation = false,\n showXAxis = true,\n showYAxis = true,\n intervalType = 'equidistantPreserveStart',\n showTooltip = true,\n showLegend = true,\n showGridLines = true,\n allowDecimals = true,\n noDataText,\n enableLegendSlider = false,\n rotateLabelX,\n tickGap = 5,\n loading,\n xAxisLabel,\n className,\n width = '100%',\n height = 280,\n style,\n ...rest\n } = props;\n\n const [legendHeight, setLegendHeight] = useState(60);\n\n const seriesColorMap = useMemo(() => {\n const map = new Map<string, string>();\n series.forEach((s, i) => {\n map.set(s.key, s.color ?? colors[i % colors.length]);\n });\n return map;\n }, [series, colors]);\n\n const categoryColors = seriesColorMap;\n const customCategories = useMemo(() => {\n return series.reduce<Record<string, string>>((acc, item) => {\n if (item.name) acc[item.key] = item.name;\n return acc;\n }, {});\n }, [series]);\n\n const hasRightAxis = series.some((s) => s.axis === 'right');\n\n const leftYAxisWidth = useMemo(() => {\n if (yAxisLeft?.width) return yAxisLeft.width;\n const leftFormatter = yAxisLeft?.valueFormatter ?? defaultValueFormatter;\n return getMaxLabelLength({ data, index, layout: 'horizontal', valueFormatter: leftFormatter });\n }, [yAxisLeft, data, index]);\n\n const rightYAxisWidth = useMemo(() => {\n if (yAxisRight?.width) return yAxisRight.width;\n const rightFormatter = yAxisRight?.valueFormatter ?? defaultValueFormatter;\n return getMaxLabelLength({ data, index, layout: 'horizontal', valueFormatter: rightFormatter });\n }, [yAxisRight, data, index]);\n\n if (loading || !data) return <Skeleton height={height} width={width} />;\n\n const paddingValue = !showXAxis && !showYAxis ? 0 : 20;\n\n return (\n <Flexbox\n className={className}\n height={height}\n ref={ref}\n style={{ position: 'relative', ...style }}\n width={width}\n {...rest}\n >\n <ResponsiveContainer>\n {data?.length ? (\n <ReChartsComposedChart\n data={data}\n margin={{\n bottom: xAxisLabel ? 30 : undefined,\n left: yAxisLeft?.label ? 20 : undefined,\n right: hasRightAxis ? (yAxisRight?.label ? 20 : 5) : undefined,\n top: 5,\n }}\n >\n {showGridLines && (\n <CartesianGrid className={styles.gridLines} horizontal vertical={false} />\n )}\n\n <XAxis\n angle={rotateLabelX?.angle}\n axisLine={false}\n className={styles.label}\n dataKey={index}\n dy={rotateLabelX?.verticalShift}\n fill=\"\"\n hide={!showXAxis}\n interval={startEndOnly ? 'preserveStartEnd' : intervalType}\n minTickGap={tickGap}\n padding={{ left: paddingValue, right: paddingValue }}\n stroke=\"\"\n tick={{ transform: 'translate(0, 6)' }}\n tickFormatter={xAxisLabelFormatter}\n tickLine={false}\n ticks={startEndOnly ? [data[0][index], data.at(-1)?.[index]] : undefined}\n >\n {xAxisLabel && (\n <Label\n className={cx(styles.strongLabel, styles.emphasis)}\n offset={-20}\n position=\"insideBottom\"\n style={{\n fill: cssVar.colorTextSecondary,\n fontWeight: 500,\n textAnchor: 'middle',\n }}\n >\n {xAxisLabel}\n </Label>\n )}\n </XAxis>\n\n {/* Left Y Axis */}\n <YAxis\n allowDecimals={allowDecimals}\n axisLine={false}\n className={styles.label}\n domain={yAxisLeft?.domain}\n fill=\"\"\n hide={!showYAxis}\n orientation=\"left\"\n stroke=\"\"\n tick={(tickProps) => (\n <CustomYAxisTick\n {...tickProps}\n align=\"left\"\n formatter={yAxisLeft?.valueFormatter ?? defaultValueFormatter}\n yAxisLabel={Boolean(yAxisLeft?.label)}\n />\n )}\n tickFormatter={yAxisLeft?.valueFormatter ?? defaultValueFormatter}\n tickLine={false}\n type=\"number\"\n width={leftYAxisWidth}\n yAxisId=\"left\"\n >\n {yAxisLeft?.label && (\n <Label\n angle={-90}\n className={styles.emphasis}\n offset={-15}\n position=\"insideLeft\"\n style={{\n fill: cssVar.colorTextSecondary,\n fontWeight: 500,\n textAnchor: 'middle',\n }}\n >\n {yAxisLeft.label}\n </Label>\n )}\n </YAxis>\n\n {/* Right Y Axis */}\n {hasRightAxis && (\n <YAxis\n allowDecimals={allowDecimals}\n axisLine={false}\n className={styles.label}\n domain={yAxisRight?.domain}\n fill=\"\"\n hide={!showYAxis}\n orientation=\"right\"\n stroke=\"\"\n tick={(tickProps) => (\n <CustomYAxisTick\n {...tickProps}\n align=\"right\"\n anchor=\"start\"\n formatter={yAxisRight?.valueFormatter ?? defaultValueFormatter}\n yAxisLabel={Boolean(yAxisRight?.label)}\n />\n )}\n tickFormatter={yAxisRight?.valueFormatter ?? defaultValueFormatter}\n tickLine={false}\n type=\"number\"\n width={rightYAxisWidth}\n yAxisId=\"right\"\n >\n {yAxisRight?.label && (\n <Label\n angle={90}\n className={styles.emphasis}\n offset={-15}\n position=\"insideRight\"\n style={{\n fill: cssVar.colorTextSecondary,\n fontWeight: 500,\n textAnchor: 'middle',\n }}\n >\n {yAxisRight.label}\n </Label>\n )}\n </YAxis>\n )}\n\n {showLegend && (\n <Legend\n content={({ payload }) =>\n ChartLegend(\n { payload },\n categoryColors,\n setLegendHeight,\n undefined,\n undefined,\n enableLegendSlider,\n customCategories,\n )\n }\n height={legendHeight}\n verticalAlign=\"top\"\n />\n )}\n\n {series.map((s) => {\n const color = seriesColorMap.get(s.key) ?? cssVar.colorPrimary;\n const axisId = s.axis ?? 'left';\n\n if (s.type === 'bar') {\n return (\n <Bar\n animationDuration={animationDuration}\n className={cx(css`\n fill: ${color};\n `)}\n dataKey={s.key}\n fill=\"\"\n isAnimationActive={showAnimation}\n key={s.key}\n name={s.key}\n yAxisId={axisId}\n />\n );\n }\n\n if (s.type === 'line') {\n return (\n <Line\n animationDuration={animationDuration}\n className={cx(css`\n stroke: ${color};\n `)}\n dataKey={s.key}\n dot={false}\n isAnimationActive={showAnimation}\n key={s.key}\n name={s.key}\n stroke=\"\"\n strokeWidth={2}\n type=\"monotone\"\n yAxisId={axisId}\n />\n );\n }\n\n return null;\n })}\n\n {showTooltip && (\n <Tooltip\n content={({ active, payload, label }) => (\n <ChartTooltip\n active={active}\n categoryColors={categoryColors}\n customCategories={customCategories}\n label={label}\n payload={payload}\n valueFormatter={(value, name) => {\n const currentSeries = series.find((item) => item.key === name);\n const formatter =\n currentSeries?.valueFormatter ??\n (currentSeries?.axis === 'right'\n ? yAxisRight?.valueFormatter\n : yAxisLeft?.valueFormatter) ??\n defaultValueFormatter;\n\n return formatter(value);\n }}\n />\n )}\n cursor={{ stroke: cssVar.colorTextSecondary, strokeWidth: 1 }}\n isAnimationActive={false}\n position={{ y: 0 }}\n wrapperStyle={{ outline: 'none' }}\n />\n )}\n </ReChartsComposedChart>\n ) : (\n <NoData noDataText={noDataText} />\n )}\n </ResponsiveContainer>\n </Flexbox>\n );\n});\n\nComposedChart.displayName = 'ComposedChart';\n\nexport default ComposedChart;\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,gBAAgB,YAAgD,OAAO,QAAQ;CACnF,MAAM,kBAAkB,mBAAmB;CAC3C,MAAM,EACJ,OAAO,CAAC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SAAS,EAAE;MACX,MAAK;MACL,mBAAmB;MAEnB,MAAM,EAAE;MACR,SAAS;KACV,GAHM,EAAE,GAGR;KAIL,IAAI,EAAE,SAAS,QACb,OACE,oBAAC,MAAD;MACqB;MACnB,WAAW,GAAG,GAAG;gCACL,MAAM;qBACjB;MACD,SAAS,EAAE;MACX,KAAK;MACL,mBAAmB;MAEnB,MAAM,EAAE;MACR,QAAO;MACP,aAAa;MACb,MAAK;MACL,SAAS;KACV,GANM,EAAE,GAMR;KAIL,OAAO;IACT,CAAC;IAEA,eACC,oBAACC,WAAD;KACE,UAAU,EAAE,QAAQ,SAAS,YAC3B,oBAAC,cAAD;MACU;MACQ;MACE;MACX;MACE;MACT,iBAAiB,OAAO,SAAS;OAC/B,MAAM,gBAAgB,OAAO,MAAM,SAAS,KAAK,QAAQ,IAAI;OAQ7D,QANE,eAAe,mBACd,eAAe,SAAS,UACrB,YAAY,iBACZ,WAAW,mBACf,sBAAA,CAEe,KAAK;MACxB;KACD,CAAA;KAEH,QAAQ;MAAE,QAAQ,OAAO;MAAoB,aAAa;KAAE;KAC5D,mBAAmB;KACnB,UAAU,EAAE,GAAG,EAAE;KACjB,cAAc,EAAE,SAAS,OAAO;IACjC,CAAA;GAEkB;EAEvB,CAAA,IAAA,oBAAC,QAAD,EAAoB,WAAa,CAAA,EAEhB,CAAA;CACd,CAAA;AAEb,CAAC;AAED,cAAc,cAAc"}
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/ComposedChart/styles.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => ({
4
4
  emphasis: css`
@@ -1 +1 @@
1
- {"version":3,"file":"styles.mjs","names":[],"sources":["../../src/ComposedChart/styles.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n gridLines: css`\n stroke: ${cssVar.colorBorderSecondary};\n stroke-width: 1;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n fill: ${cssVar.colorTextDescription};\n `,\n strongLabel: css`\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n fill: ${cssVar.colorTextSecondary};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,UAAU,GAAG;;;;;CAKb,WAAW,GAAG;cACF,OAAO,qBAAqB;;;CAGxC,OAAO,GAAG;;;YAGA,OAAO,qBAAqB;;CAEtC,aAAa,GAAG;;;;YAIN,OAAO,mBAAmB;;AAEtC,EAAE"}
1
+ {"version":3,"file":"styles.mjs","names":[],"sources":["../../src/ComposedChart/styles.ts"],"sourcesContent":["import { createStaticStyles } from '@lobehub/ui';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n gridLines: css`\n stroke: ${cssVar.colorBorderSecondary};\n stroke-width: 1;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n fill: ${cssVar.colorTextDescription};\n `,\n strongLabel: css`\n font-size: 12px;\n font-weight: 500;\n line-height: 16px;\n fill: ${cssVar.colorTextSecondary};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,UAAU,GAAG;;;;;CAKb,WAAW,GAAG;cACF,OAAO,qBAAqB;;;CAGxC,OAAO,GAAG;;;YAGA,OAAO,qBAAqB;;CAEtC,aAAa,GAAG;;;;YAIN,OAAO,mBAAmB;;AAEtC,EAAE"}
@@ -2,9 +2,7 @@
2
2
  import { useThemeColorRange } from "../hooks/useThemeColorRange.mjs";
3
3
  import { defaultValueFormatter, sumNumericArray } from "../utils/index.mjs";
4
4
  import { styles } from "./styles.mjs";
5
- import { Flexbox } from "@lobehub/ui";
6
- import { Tooltip } from "@lobehub/ui/base-ui";
7
- import { cssVar, cx } from "antd-style";
5
+ import { Flexbox, Tooltip, cssVar, cx } from "@lobehub/ui";
8
6
  import { forwardRef, memo, useMemo } from "react";
9
7
  import { jsx, jsxs } from "react/jsx-runtime";
10
8
  //#region src/DataBars/CategoryBar.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryBar.mjs","names":[],"sources":["../../src/DataBars/CategoryBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { Tooltip } from '@lobehub/ui/base-ui';\nimport { cssVar, cx } from 'antd-style';\nimport { forwardRef, memo, useMemo } from 'react';\n\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { ValueFormatter } from '@/types/charts';\nimport { defaultValueFormatter, sumNumericArray } from '@/utils';\n\nimport { styles } from './styles';\n\nconst getMarkerBgColor = (\n markerValue: number | undefined,\n values: number[],\n colors: string[],\n): string => {\n if (markerValue === undefined) return '';\n\n let prefixSum = 0;\n for (const [i, currentWidthPercentage] of values.entries()) {\n const currentBgColor = colors[i];\n\n prefixSum += currentWidthPercentage;\n if (prefixSum >= markerValue) return currentBgColor;\n }\n\n return '';\n};\n\nconst getPositionLeft = (value: number | undefined, maxValue: number): number =>\n value ? (value / maxValue) * 100 : 0;\n\nconst BarLabels = memo<{ valueFormatter?: ValueFormatter; values: number[] }>(\n ({ values, valueFormatter }) => {\n const sumValues = useMemo(() => sumNumericArray(values), [values]);\n let prefixSum = 0;\n let sumConsecutiveHiddenLabels = 0;\n return (\n <Flexbox\n className={cx(styles.label, styles.emphasis)}\n horizontal\n style={{\n position: 'relative',\n }}\n >\n {values.slice(0, values.length).map((widthPercentage, idx) => {\n prefixSum += widthPercentage;\n const showLabel =\n (widthPercentage >= 0.1 * sumValues ||\n sumConsecutiveHiddenLabels >= 0.09 * sumValues) &&\n sumValues - prefixSum >= 0.15 * sumValues &&\n prefixSum >= 0.1 * sumValues;\n sumConsecutiveHiddenLabels = showLabel\n ? 0\n : (sumConsecutiveHiddenLabels += widthPercentage);\n\n const widthPositionLeft = getPositionLeft(widthPercentage, sumValues);\n\n if (prefixSum === sumValues) return null;\n\n return (\n <Flexbox\n align={'center'}\n horizontal\n justify={'flex-end'}\n key={`item-${idx}`}\n style={{ width: `${widthPositionLeft}%` }}\n >\n <span\n style={{\n display: showLabel ? 'block' : 'hidden',\n left: '50%',\n transform: 'translateX(50%)',\n }}\n >\n {valueFormatter ? valueFormatter(prefixSum) : prefixSum}\n </span>\n </Flexbox>\n );\n })}\n <Flexbox align={'center'} horizontal style={{ bottom: 0, left: 0, position: 'absolute' }}>\n {valueFormatter ? valueFormatter(0) : 0}\n </Flexbox>\n <Flexbox align={'center'} horizontal style={{ bottom: 0, position: 'absolute', right: 0 }}>\n {valueFormatter ? valueFormatter(sumValues) : sumValues}\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nexport interface CategoryBarProps extends FlexboxProps {\n colors?: string[];\n markerValue?: number;\n showAnimation?: boolean;\n showLabels?: boolean;\n size?: number;\n tooltip?: string;\n valueFormatter?: ValueFormatter;\n values: number[];\n}\n\nconst CategoryBar = forwardRef<HTMLDivElement, CategoryBarProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n const {\n values = [],\n colors = themeColorRange,\n valueFormatter = defaultValueFormatter,\n markerValue,\n showLabels = true,\n tooltip,\n showAnimation = false,\n className,\n width = '100%',\n size = 8,\n style,\n ...rest\n } = props;\n\n const colorGroup = colors.concat(themeColorRange);\n\n const markerBgColor = useMemo(\n () => getMarkerBgColor(markerValue, values, colorGroup),\n [markerValue, values, colorGroup],\n );\n\n const maxValue = useMemo(() => sumNumericArray(values), [values]);\n\n const markerPositionLeft: number = useMemo(\n () => getPositionLeft(markerValue, maxValue),\n [markerValue, maxValue],\n );\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n className={className}\n gap={8}\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n {showLabels && <BarLabels valueFormatter={valueFormatter} values={values} />}\n <Flexbox\n align={'center'}\n className={cx('relative w-full flex items-center h-2')}\n height={size}\n horizontal\n style={{\n position: 'relative',\n }}\n >\n <Flexbox\n align={'center'}\n height={'100%'}\n horizontal\n style={{\n borderRadius: size / 2,\n overflow: 'hidden',\n }}\n width={'100%'}\n >\n {values.map((value, idx) => {\n const baseColor = colorGroup[idx] ?? cssVar.colorPrimary;\n const percentage = (value / maxValue) * 100;\n return (\n <Flexbox\n height={'100%'}\n key={`item-${idx}`}\n style={{ background: baseColor, width: `${percentage}%` }}\n />\n );\n })}\n </Flexbox>\n {markerValue === undefined ? undefined : (\n <div\n className={cx(styles.markerWrapper, showAnimation && styles.showAnimation)}\n style={{\n left: `${markerPositionLeft}%`,\n }}\n >\n <div\n className={styles.marker}\n style={{\n background: markerBgColor || cssVar.colorPrimary,\n height: size + 8,\n }}\n />\n </div>\n )}\n </Flexbox>\n </Flexbox>\n </Tooltip>\n );\n});\n\nCategoryBar.displayName = 'CategoryBar';\n\nexport default CategoryBar;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,oBACJ,aACA,QACA,WACW;CACX,IAAI,gBAAgB,KAAA,GAAW,OAAO;CAEtC,IAAI,YAAY;CAChB,KAAK,MAAM,CAAC,GAAG,2BAA2B,OAAO,QAAQ,GAAG;EAC1D,MAAM,iBAAiB,OAAO;EAE9B,aAAa;EACb,IAAI,aAAa,aAAa,OAAO;CACvC;CAEA,OAAO;AACT;AAEA,MAAM,mBAAmB,OAA2B,aAClD,QAAS,QAAQ,WAAY,MAAM;AAErC,MAAM,YAAY,MACf,EAAE,QAAQ,qBAAqB;CAC9B,MAAM,YAAY,cAAc,gBAAgB,MAAM,GAAG,CAAC,MAAM,CAAC;CACjE,IAAI,YAAY;CAChB,IAAI,6BAA6B;CACjC,OACE,qBAAC,SAAD;EACE,WAAW,GAAG,OAAO,OAAO,OAAO,QAAQ;EAC3C,YAAA;EACA,OAAO,EACL,UAAU,WACZ;EALF,UAAA;GAOG,OAAO,M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B,MAAM,GAAG,CAAC,MAAM,CAAC;CAEhE,MAAM,qBAA6B,cAC3B,gBAAgB,aAAa,QAAQ,GAC3C,CAAC,aAAa,QAAQ,CACxB;CAEA,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,qBAAC,SAAD;GACa;GACX,KAAK;GACA;GACL,OAAO;IACL,UAAU;IACV,GAAG;GACL;GACO;GACP,GAAI;GATN,UAAA,CAWG,cAAc,oBAAC,WAAD;IAA2B;IAAwB;GAAS,CAAA,GAC3E,qBAAC,SAAD;IACE,OAAO;IACP,WAAW,GAAG,uCAAuC;IACrD,QAAQ;IACR,YAAA;IACA,OAAO,EACL,UAAU,WACZ;IAPF,UAAA,CASE,oBAAC,SAAD;KACE,OAAO;KACP,QAAQ;KACR,YAAA;KACA,OAAO;MACL,cAAc,OAAO;MACrB,UAAU;KACZ;KACA,OAAO;KAEN,UAAA,OAAO,KAAK,OAAO,QAAQ;MAC1B,MAAM,YAAY,WAAW,QAAQ,OAAO;MAC5C,MAAM,aAAc,QAAQ,WAAY;MACxC,OACE,oBAAC,SAAD;OACE,QAAQ;OAER,OAAO;QAAE,YAAY;QAAW,OAAO,GAAG,WAAW;OAAG;MACzD,GAFM,QAAQ,KAEd;KAEL,CAAC;IACM,CAAA,GACR,gBAAgB,KAAA,IAAY,KAAA,IAC3B,oBAAC,OAAD;KACE,WAAW,GAAG,OAAO,eAAe,iBAAiB,OAAO,aAAa;KACzE,OAAO,EACL,MAAM,GAAG,mBAAmB,GAC9B;KAEA,UAAA,oBAAC,OAAD;MACE,WAAW,OAAO;MAClB,OAAO;OACL,YAAY,iBAAiB,OAAO;OACpC,QAAQ,OAAO;MACjB;KACD,CAAA;IACE,CAAA,CAEA;GACF,CAAA,CAAA;;CACF,CAAA;AAEb,CAAC;AAED,YAAY,cAAc"}
1
+ {"version":3,"file":"CategoryBar.mjs","names":[],"sources":["../../src/DataBars/CategoryBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps, Tooltip, cssVar, cx } from '@lobehub/ui';\nimport { forwardRef, memo, useMemo } from 'react';\n\nimport { useThemeColorRange } from '@/hooks/useThemeColorRange';\nimport { ValueFormatter } from '@/types/charts';\nimport { defaultValueFormatter, sumNumericArray } from '@/utils';\n\nimport { styles } from './styles';\n\nconst getMarkerBgColor = (\n markerValue: number | undefined,\n values: number[],\n colors: string[],\n): string => {\n if (markerValue === undefined) return '';\n\n let prefixSum = 0;\n for (const [i, currentWidthPercentage] of values.entries()) {\n const currentBgColor = colors[i];\n\n prefixSum += currentWidthPercentage;\n if (prefixSum >= markerValue) return currentBgColor;\n }\n\n return '';\n};\n\nconst getPositionLeft = (value: number | undefined, maxValue: number): number =>\n value ? (value / maxValue) * 100 : 0;\n\nconst BarLabels = memo<{ valueFormatter?: ValueFormatter; values: number[] }>(\n ({ values, valueFormatter }) => {\n const sumValues = useMemo(() => sumNumericArray(values), [values]);\n let prefixSum = 0;\n let sumConsecutiveHiddenLabels = 0;\n return (\n <Flexbox\n className={cx(styles.label, styles.emphasis)}\n horizontal\n style={{\n position: 'relative',\n }}\n >\n {values.slice(0, values.length).map((widthPercentage, idx) => {\n prefixSum += widthPercentage;\n const showLabel =\n (widthPercentage >= 0.1 * sumValues ||\n sumConsecutiveHiddenLabels >= 0.09 * sumValues) &&\n sumValues - prefixSum >= 0.15 * sumValues &&\n prefixSum >= 0.1 * sumValues;\n sumConsecutiveHiddenLabels = showLabel\n ? 0\n : (sumConsecutiveHiddenLabels += widthPercentage);\n\n const widthPositionLeft = getPositionLeft(widthPercentage, sumValues);\n\n if (prefixSum === sumValues) return null;\n\n return (\n <Flexbox\n align={'center'}\n horizontal\n justify={'flex-end'}\n key={`item-${idx}`}\n style={{ width: `${widthPositionLeft}%` }}\n >\n <span\n style={{\n display: showLabel ? 'block' : 'hidden',\n left: '50%',\n transform: 'translateX(50%)',\n }}\n >\n {valueFormatter ? valueFormatter(prefixSum) : prefixSum}\n </span>\n </Flexbox>\n );\n })}\n <Flexbox align={'center'} horizontal style={{ bottom: 0, left: 0, position: 'absolute' }}>\n {valueFormatter ? valueFormatter(0) : 0}\n </Flexbox>\n <Flexbox align={'center'} horizontal style={{ bottom: 0, position: 'absolute', right: 0 }}>\n {valueFormatter ? valueFormatter(sumValues) : sumValues}\n </Flexbox>\n </Flexbox>\n );\n },\n);\n\nexport interface CategoryBarProps extends FlexboxProps {\n colors?: string[];\n markerValue?: number;\n showAnimation?: boolean;\n showLabels?: boolean;\n size?: number;\n tooltip?: string;\n valueFormatter?: ValueFormatter;\n values: number[];\n}\n\nconst CategoryBar = forwardRef<HTMLDivElement, CategoryBarProps>((props, ref) => {\n const themeColorRange = useThemeColorRange();\n const {\n values = [],\n colors = themeColorRange,\n valueFormatter = defaultValueFormatter,\n markerValue,\n showLabels = true,\n tooltip,\n showAnimation = false,\n className,\n width = '100%',\n size = 8,\n style,\n ...rest\n } = props;\n\n const colorGroup = colors.concat(themeColorRange);\n\n const markerBgColor = useMemo(\n () => getMarkerBgColor(markerValue, values, colorGroup),\n [markerValue, values, colorGroup],\n );\n\n const maxValue = useMemo(() => sumNumericArray(values), [values]);\n\n const markerPositionLeft: number = useMemo(\n () => getPositionLeft(markerValue, maxValue),\n [markerValue, maxValue],\n );\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n className={className}\n gap={8}\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n {showLabels && <BarLabels valueFormatter={valueFormatter} values={values} />}\n <Flexbox\n align={'center'}\n className={cx('relative w-full flex items-center h-2')}\n height={size}\n horizontal\n style={{\n position: 'relative',\n }}\n >\n <Flexbox\n align={'center'}\n height={'100%'}\n horizontal\n style={{\n borderRadius: size / 2,\n overflow: 'hidden',\n }}\n width={'100%'}\n >\n {values.map((value, idx) => {\n const baseColor = colorGroup[idx] ?? cssVar.colorPrimary;\n const percentage = (value / maxValue) * 100;\n return (\n <Flexbox\n height={'100%'}\n key={`item-${idx}`}\n style={{ background: baseColor, width: `${percentage}%` }}\n />\n );\n })}\n </Flexbox>\n {markerValue === undefined ? undefined : (\n <div\n className={cx(styles.markerWrapper, showAnimation && styles.showAnimation)}\n style={{\n left: `${markerPositionLeft}%`,\n }}\n >\n <div\n className={styles.marker}\n style={{\n background: markerBgColor || cssVar.colorPrimary,\n height: size + 8,\n }}\n />\n </div>\n )}\n </Flexbox>\n </Flexbox>\n </Tooltip>\n );\n});\n\nCategoryBar.displayName = 'CategoryBar';\n\nexport default CategoryBar;\n"],"mappings":";;;;;;;;AAWA,MAAM,oBACJ,aACA,QACA,WACW;CACX,IAAI,gBAAgB,KAAA,GAAW,OAAO;CAEtC,IAAI,YAAY;CAChB,KAAK,MAAM,CAAC,GAAG,2BAA2B,OAAO,QAAQ,GAAG;EAC1D,MAAM,iBAAiB,OAAO;EAE9B,aAAa;EACb,IAAI,aAAa,aAAa,OAAO;CACvC;CAEA,OAAO;AACT;AAEA,MAAM,mBAAmB,OAA2B,aAClD,QAAS,QAAQ,WAAY,MAAM;AAErC,MAAM,YAAY,MACf,EAAE,QAAQ,qBAAqB;CAC9B,MAAM,YAAY,cAAc,gBAAgB,MAAM,GAAG,CAAC,MAAM,CAAC;CACjE,IAAI,YAAY;CAChB,IAAI,6BAA6B;CACjC,OACE,qBAAC,SAAD;EACE,WAAW,GAAG,OAAO,OAAO,OAAO,QAAQ;EAC3C,YAAA;EACA,OAAO,EACL,UAAU,WACZ;EALF,UAAA;GAOG,OAAO,MAAM,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK,iBAAiB,QAAQ;IAC5D,aAAa;IACb,MAAM,aACH,mBAAmB,KAAM,aACxB,8BAA8B,MAAO,cACvC,YAAY,aAAa,MAAO,aAChC,aAAa,KAAM;IACrB,6BAA6B,YACzB,IACC,8BAA8B;IAEnC,MAAM,oBAAoB,gBAAgB,iBAAiB,SAAS;IAEpE,IAAI,cAAc,WAAW,OAAO;IAEpC,OACE,oBAAC,SAAD;KACE,OAAO;KACP,YAAA;KACA,SAAS;KAET,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E,OAAO;IACP,WAAW,GAAG,uCAAuC;IACrD,QAAQ;IACR,YAAA;IACA,OAAO,EACL,UAAU,WACZ;IAPF,UAAA,CASE,oBAAC,SAAD;KACE,OAAO;KACP,QAAQ;KACR,YAAA;KACA,OAAO;MACL,cAAc,OAAO;MACrB,UAAU;KACZ;KACA,OAAO;KAEN,UAAA,OAAO,KAAK,OAAO,QAAQ;MAC1B,MAAM,YAAY,WAAW,QAAQ,OAAO;MAC5C,MAAM,aAAc,QAAQ,WAAY;MACxC,OACE,oBAAC,SAAD;OACE,QAAQ;OAER,OAAO;QAAE,YAAY;QAAW,OAAO,GAAG,WAAW;OAAG;MACzD,GAFM,QAAQ,KAEd;KAEL,CAAC;IACM,CAAA,GACR,gBAAgB,KAAA,IAAY,KAAA,IAC3B,oBAAC,OAAD;KACE,WAAW,GAAG,OAAO,eAAe,iBAAiB,OAAO,aAAa;KACzE,OAAO,EACL,MAAM,GAAG,mBAAmB,GAC9B;KAEA,UAAA,oBAAC,OAAD;MACE,WAAW,OAAO;MAClB,OAAO;OACL,YAAY,iBAAiB,OAAO;OACpC,QAAQ,OAAO;MACjB;KACD,CAAA;IACE,CAAA,CAEA;GACF,CAAA,CAAA;;CACF,CAAA;AAEb,CAAC;AAED,YAAY,cAAc"}
@@ -2,9 +2,7 @@
2
2
  import { DeltaTypes } from "../types/charts.mjs";
3
3
  import { mapInputsToDeltaType } from "../utils/index.mjs";
4
4
  import { styles } from "./styles.mjs";
5
- import { Flexbox } from "@lobehub/ui";
6
- import { Tooltip } from "@lobehub/ui/base-ui";
7
- import { cssVar, cx } from "antd-style";
5
+ import { Flexbox, Tooltip, cssVar, cx } from "@lobehub/ui";
8
6
  import { forwardRef } from "react";
9
7
  import { jsx, jsxs } from "react/jsx-runtime";
10
8
  //#region src/DataBars/DeltaBar.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"DeltaBar.mjs","names":[],"sources":["../../src/DataBars/DeltaBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { Tooltip } from '@lobehub/ui/base-ui';\nimport { cssVar, cx } from 'antd-style';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { DeltaTypes } from '@/types/charts';\nimport { mapInputsToDeltaType } from '@/utils';\n\nimport { styles } from './styles';\n\nconst getDeltaType = (value: number) => (value >= 0 ? DeltaTypes.Increase : DeltaTypes.Decrease);\n\nexport interface DeltaBarProps extends FlexboxProps {\n bgColors?: string;\n color?: string;\n isIncreasePositive?: boolean;\n showAnimation?: boolean;\n size?: number;\n tooltip?: ReactNode;\n value: number;\n}\n\nconst DeltaBar = forwardRef<HTMLDivElement, DeltaBarProps>((props, ref) => {\n const {\n value,\n bgColors,\n color,\n isIncreasePositive = true,\n showAnimation = false,\n className,\n tooltip,\n width = '100%',\n size = 8,\n style,\n ...rest\n } = props;\n const deltaType = mapInputsToDeltaType(getDeltaType(value), isIncreasePositive);\n\n const colors = {\n [DeltaTypes.Increase]: cssVar.colorSuccess,\n [DeltaTypes.ModerateIncrease]: cssVar.colorSuccess,\n [DeltaTypes.Decrease]: cssVar.colorError,\n [DeltaTypes.ModerateDecrease]: cssVar.colorError,\n [DeltaTypes.Unchanged]: cssVar.colorWarning,\n };\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n align={'center'}\n className={className}\n height={size}\n horizontal\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n <Flexbox\n height={'100%'}\n style={{\n background: bgColors || cssVar.colorFillTertiary,\n borderRadius: size / 2,\n inset: 0,\n opacity: bgColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={'100%'}\n />\n <Flexbox\n align={'center'}\n flex={1}\n height={'100%'}\n horizontal\n justify={'flex-end'}\n style={{ position: 'relative' }}\n >\n {value < 0 ? (\n <div\n className={cx(showAnimation && styles.showAnimation)}\n style={{\n background: colors[deltaType],\n borderBottomLeftRadius: size / 2,\n borderTopLeftRadius: size / 2,\n height: '100%',\n width: `${Math.abs(value)}%`,\n }}\n />\n ) : undefined}\n </Flexbox>\n <Flexbox\n className={styles.marker}\n flex={'none'}\n style={{\n background: color || cssVar.colorPrimary,\n height: size + 8,\n zIndex: 2,\n }}\n />\n <Flexbox\n align={'center'}\n flex={1}\n height={'100%'}\n horizontal\n justify={'flex-start'}\n style={{ position: 'relative' }}\n >\n {value >= 0 ? (\n <div\n className={cx(showAnimation && styles.showAnimation)}\n style={{\n background: colors[deltaType],\n borderBottomRightRadius: size / 2,\n borderTopRightRadius: size / 2,\n height: '100%',\n width: `${Math.abs(value)}%`,\n }}\n />\n ) : undefined}\n </Flexbox>\n </Flexbox>\n </Tooltip>\n );\n});\n\nDeltaBar.displayName = 'DeltaBar';\n\nexport default DeltaBar;\n"],"mappings":";;;;;;;;;;AAYA,MAAM,gBAAgB,UAAmB,SAAS,IAAI,WAAW,WAAW,WAAW;AAYvF,MAAM,WAAW,YAA2C,OAAO,QAAQ;CACzE,MAAM,EACJ,OACA,UACA,OACA,qBAAqB,MACrB,gBAAgB,OAChB,WACA,SACA,QAAQ,QACR,OAAO,GACP,OACA,GAAG,SACD;CACJ,MAAM,YAAY,qBAAqB,aAAa,KAAK,GAAG,kBAAkB;CAE9E,MAAM,SAAS;GACZ,WAAW,WAAW,OAAO;GAC7B,WAAW,mBAAmB,OAAO;GACrC,WAAW,WAAW,OAAO;GAC7B,WAAW,mBAAmB,OAAO;GACrC,WAAW,YAAY,OAAO;CACjC;CAEA,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,qBAAC,SAAD;GACE,OAAO;GACI;GACX,QAAQ;GACR,YAAA;GACK;GACL,OAAO;IACL,UAAU;IACV,GAAG;GACL;GACO;GACP,GAAI;GAXN,UAAA;IAaE,oBAAC,SAAD;KACE,QAAQ;KACR,OAAO;MACL,YAAY,YAAY,OAAO;MAC/B,cAAc,OAAO;MACrB,OAAO;MACP,SAAS,WAAW,KAAM;MAC1B,UAAU;MACV,QAAQ;KACV;KACA,OAAO;IACR,CAAA;IACD,oBAAC,SAAD;KACE,OAAO;KACP,MAAM;KACN,QAAQ;KACR,YAAA;KACA,SAAS;KACT,OAAO,EAAE,UAAU,WAAW;KAE7B,UAAA,QAAQ,IACP,oBAAC,OAAD;MACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;MACnD,OAAO;OACL,YAAY,OAAO;OACnB,wBAAwB,OAAO;OAC/B,qBAAqB,OAAO;OAC5B,QAAQ;OACR,OAAO,GAAG,KAAK,IAAI,KAAK,EAAE;MAC5B;KACD,CAAA,IACC,KAAA;IACG,CAAA;IACT,oBAAC,SAAD;KACE,WAAW,OAAO;KAClB,MAAM;KACN,OAAO;MACL,YAAY,SAAS,OAAO;MAC5B,QAAQ,OAAO;MACf,QAAQ;KACV;IACD,CAAA;IACD,oBAAC,SAAD;KACE,OAAO;KACP,MAAM;KACN,QAAQ;KACR,YAAA;KACA,SAAS;KACT,OAAO,EAAE,UAAU,WAAW;KAE7B,UAAA,SAAS,IACR,oBAAC,OAAD;MACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;MACnD,OAAO;OACL,YAAY,OAAO;OACnB,yBAAyB,OAAO;OAChC,sBAAsB,OAAO;OAC7B,QAAQ;OACR,OAAO,GAAG,KAAK,IAAI,KAAK,EAAE;MAC5B;KACD,CAAA,IACC,KAAA;IACG,CAAA;GACF;;CACF,CAAA;AAEb,CAAC;AAED,SAAS,cAAc"}
1
+ {"version":3,"file":"DeltaBar.mjs","names":[],"sources":["../../src/DataBars/DeltaBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps, Tooltip, cssVar, cx } from '@lobehub/ui';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { DeltaTypes } from '@/types/charts';\nimport { mapInputsToDeltaType } from '@/utils';\n\nimport { styles } from './styles';\n\nconst getDeltaType = (value: number) => (value >= 0 ? DeltaTypes.Increase : DeltaTypes.Decrease);\n\nexport interface DeltaBarProps extends FlexboxProps {\n bgColors?: string;\n color?: string;\n isIncreasePositive?: boolean;\n showAnimation?: boolean;\n size?: number;\n tooltip?: ReactNode;\n value: number;\n}\n\nconst DeltaBar = forwardRef<HTMLDivElement, DeltaBarProps>((props, ref) => {\n const {\n value,\n bgColors,\n color,\n isIncreasePositive = true,\n showAnimation = false,\n className,\n tooltip,\n width = '100%',\n size = 8,\n style,\n ...rest\n } = props;\n const deltaType = mapInputsToDeltaType(getDeltaType(value), isIncreasePositive);\n\n const colors = {\n [DeltaTypes.Increase]: cssVar.colorSuccess,\n [DeltaTypes.ModerateIncrease]: cssVar.colorSuccess,\n [DeltaTypes.Decrease]: cssVar.colorError,\n [DeltaTypes.ModerateDecrease]: cssVar.colorError,\n [DeltaTypes.Unchanged]: cssVar.colorWarning,\n };\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n align={'center'}\n className={className}\n height={size}\n horizontal\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n <Flexbox\n height={'100%'}\n style={{\n background: bgColors || cssVar.colorFillTertiary,\n borderRadius: size / 2,\n inset: 0,\n opacity: bgColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={'100%'}\n />\n <Flexbox\n align={'center'}\n flex={1}\n height={'100%'}\n horizontal\n justify={'flex-end'}\n style={{ position: 'relative' }}\n >\n {value < 0 ? (\n <div\n className={cx(showAnimation && styles.showAnimation)}\n style={{\n background: colors[deltaType],\n borderBottomLeftRadius: size / 2,\n borderTopLeftRadius: size / 2,\n height: '100%',\n width: `${Math.abs(value)}%`,\n }}\n />\n ) : undefined}\n </Flexbox>\n <Flexbox\n className={styles.marker}\n flex={'none'}\n style={{\n background: color || cssVar.colorPrimary,\n height: size + 8,\n zIndex: 2,\n }}\n />\n <Flexbox\n align={'center'}\n flex={1}\n height={'100%'}\n horizontal\n justify={'flex-start'}\n style={{ position: 'relative' }}\n >\n {value >= 0 ? (\n <div\n className={cx(showAnimation && styles.showAnimation)}\n style={{\n background: colors[deltaType],\n borderBottomRightRadius: size / 2,\n borderTopRightRadius: size / 2,\n height: '100%',\n width: `${Math.abs(value)}%`,\n }}\n />\n ) : undefined}\n </Flexbox>\n </Flexbox>\n </Tooltip>\n );\n});\n\nDeltaBar.displayName = 'DeltaBar';\n\nexport default DeltaBar;\n"],"mappings":";;;;;;;;AAUA,MAAM,gBAAgB,UAAmB,SAAS,IAAI,WAAW,WAAW,WAAW;AAYvF,MAAM,WAAW,YAA2C,OAAO,QAAQ;CACzE,MAAM,EACJ,OACA,UACA,OACA,qBAAqB,MACrB,gBAAgB,OAChB,WACA,SACA,QAAQ,QACR,OAAO,GACP,OACA,GAAG,SACD;CACJ,MAAM,YAAY,qBAAqB,aAAa,KAAK,GAAG,kBAAkB;CAE9E,MAAM,SAAS;GACZ,WAAW,WAAW,OAAO;GAC7B,WAAW,mBAAmB,OAAO;GACrC,WAAW,WAAW,OAAO;GAC7B,WAAW,mBAAmB,OAAO;GACrC,WAAW,YAAY,OAAO;CACjC;CAEA,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,qBAAC,SAAD;GACE,OAAO;GACI;GACX,QAAQ;GACR,YAAA;GACK;GACL,OAAO;IACL,UAAU;IACV,GAAG;GACL;GACO;GACP,GAAI;GAXN,UAAA;IAaE,oBAAC,SAAD;KACE,QAAQ;KACR,OAAO;MACL,YAAY,YAAY,OAAO;MAC/B,cAAc,OAAO;MACrB,OAAO;MACP,SAAS,WAAW,KAAM;MAC1B,UAAU;MACV,QAAQ;KACV;KACA,OAAO;IACR,CAAA;IACD,oBAAC,SAAD;KACE,OAAO;KACP,MAAM;KACN,QAAQ;KACR,YAAA;KACA,SAAS;KACT,OAAO,EAAE,UAAU,WAAW;KAE7B,UAAA,QAAQ,IACP,oBAAC,OAAD;MACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;MACnD,OAAO;OACL,YAAY,OAAO;OACnB,wBAAwB,OAAO;OAC/B,qBAAqB,OAAO;OAC5B,QAAQ;OACR,OAAO,GAAG,KAAK,IAAI,KAAK,EAAE;MAC5B;KACD,CAAA,IACC,KAAA;IACG,CAAA;IACT,oBAAC,SAAD;KACE,WAAW,OAAO;KAClB,MAAM;KACN,OAAO;MACL,YAAY,SAAS,OAAO;MAC5B,QAAQ,OAAO;MACf,QAAQ;KACV;IACD,CAAA;IACD,oBAAC,SAAD;KACE,OAAO;KACP,MAAM;KACN,QAAQ;KACR,YAAA;KACA,SAAS;KACT,OAAO,EAAE,UAAU,WAAW;KAE7B,UAAA,SAAS,IACR,oBAAC,OAAD;MACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;MACnD,OAAO;OACL,YAAY,OAAO;OACnB,yBAAyB,OAAO;OAChC,sBAAsB,OAAO;OAC7B,QAAQ;OACR,OAAO,GAAG,KAAK,IAAI,KAAK,EAAE;MAC5B;KACD,CAAA,IACC,KAAA;IACG,CAAA;GACF;;CACF,CAAA;AAEb,CAAC;AAED,SAAS,cAAc"}
@@ -1,8 +1,6 @@
1
1
  "use client";
2
2
  import { styles } from "./styles.mjs";
3
- import { Flexbox } from "@lobehub/ui";
4
- import { Tooltip } from "@lobehub/ui/base-ui";
5
- import { cssVar, cx } from "antd-style";
3
+ import { Flexbox, Tooltip, cssVar, cx } from "@lobehub/ui";
6
4
  import { forwardRef } from "react";
7
5
  import { jsx, jsxs } from "react/jsx-runtime";
8
6
  //#region src/DataBars/MarkerBar.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"MarkerBar.mjs","names":[],"sources":["../../src/DataBars/MarkerBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { Tooltip } from '@lobehub/ui/base-ui';\nimport { cssVar, cx } from 'antd-style';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { styles } from './styles';\n\nexport interface MarkerBarProps extends FlexboxProps {\n bgColors?: string;\n color?: string;\n markerTooltip?: ReactNode;\n maxValue?: number;\n minValue?: number;\n rangeColors?: string;\n rangeTooltip?: ReactNode;\n showAnimation?: boolean;\n size?: number;\n value: number;\n}\n\nconst MarkerBar = forwardRef<HTMLDivElement, MarkerBarProps>((props, ref) => {\n const {\n value,\n minValue,\n maxValue,\n markerTooltip,\n rangeTooltip,\n showAnimation = false,\n color,\n bgColors,\n rangeColors,\n className,\n width = '100%',\n style,\n size = 8,\n ...rest\n } = props;\n return (\n <Flexbox\n align={'center'}\n className={className}\n height={size}\n horizontal\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n <Flexbox\n height={'100%'}\n style={{\n background: bgColors || cssVar.colorFillTertiary,\n borderRadius: size / 2,\n inset: 0,\n opacity: bgColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={'100%'}\n />\n {minValue !== undefined && maxValue !== undefined ? (\n <Tooltip title={rangeTooltip}>\n <Flexbox\n className={cx(showAnimation && styles.showAnimation)}\n height={'100%'}\n style={{\n background: rangeColors || cssVar.colorFill,\n borderRadius: size / 2,\n inset: 0,\n left: `${minValue}%`,\n opacity: rangeColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={`${maxValue - minValue}%`}\n />\n </Tooltip>\n ) : null}\n <Tooltip title={markerTooltip}>\n <div\n className={cx(styles.markerWrapper, showAnimation && styles.showAnimation)}\n style={{\n left: `${value}%`,\n }}\n >\n <div\n className={styles.marker}\n style={{\n background: color || cssVar.colorPrimary,\n height: size + 8,\n }}\n />\n </div>\n </Tooltip>\n </Flexbox>\n );\n});\n\nMarkerBar.displayName = 'MarkerBar';\n\nexport default MarkerBar;\n"],"mappings":";;;;;;;;AAsBA,MAAM,YAAY,YAA4C,OAAO,QAAQ;CAC3E,MAAM,EACJ,OACA,UACA,UACA,eACA,cACA,gBAAgB,OAChB,OACA,UACA,aACA,WACA,QAAQ,QACR,OACA,OAAO,GACP,GAAG,SACD;CACJ,OACE,qBAAC,SAAD;EACE,OAAO;EACI;EACX,QAAQ;EACR,YAAA;EACK;EACL,OAAO;GACL,UAAU;GACV,GAAG;EACL;EACO;EACP,GAAI;EAXN,UAAA;GAaE,oBAAC,SAAD;IACE,QAAQ;IACR,OAAO;KACL,YAAY,YAAY,OAAO;KAC/B,cAAc,OAAO;KACrB,OAAO;KACP,SAAS,WAAW,KAAM;KAC1B,UAAU;KACV,QAAQ;IACV;IACA,OAAO;GACR,CAAA;GACA,aAAa,KAAA,KAAa,aAAa,KAAA,IACtC,oBAAC,SAAD;IAAS,OAAO;IACd,UAAA,oBAAC,SAAD;KACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;KACnD,QAAQ;KACR,OAAO;MACL,YAAY,eAAe,OAAO;MAClC,cAAc,OAAO;MACrB,OAAO;MACP,MAAM,GAAG,SAAS;MAClB,SAAS,cAAc,KAAM;MAC7B,UAAU;MACV,QAAQ;KACV;KACA,OAAO,GAAG,WAAW,SAAS;IAC/B,CAAA;GACM,CAAA,IACP;GACJ,oBAAC,SAAD;IAAS,OAAO;IACd,UAAA,oBAAC,OAAD;KACE,WAAW,GAAG,OAAO,eAAe,iBAAiB,OAAO,aAAa;KACzE,OAAO,EACL,MAAM,GAAG,MAAM,GACjB;KAEA,UAAA,oBAAC,OAAD;MACE,WAAW,OAAO;MAClB,OAAO;OACL,YAAY,SAAS,OAAO;OAC5B,QAAQ,OAAO;MACjB;KACD,CAAA;IACE,CAAA;GACE,CAAA;EACF;;AAEb,CAAC;AAED,UAAU,cAAc"}
1
+ {"version":3,"file":"MarkerBar.mjs","names":[],"sources":["../../src/DataBars/MarkerBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps, Tooltip, cssVar, cx } from '@lobehub/ui';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { styles } from './styles';\n\nexport interface MarkerBarProps extends FlexboxProps {\n bgColors?: string;\n color?: string;\n markerTooltip?: ReactNode;\n maxValue?: number;\n minValue?: number;\n rangeColors?: string;\n rangeTooltip?: ReactNode;\n showAnimation?: boolean;\n size?: number;\n value: number;\n}\n\nconst MarkerBar = forwardRef<HTMLDivElement, MarkerBarProps>((props, ref) => {\n const {\n value,\n minValue,\n maxValue,\n markerTooltip,\n rangeTooltip,\n showAnimation = false,\n color,\n bgColors,\n rangeColors,\n className,\n width = '100%',\n style,\n size = 8,\n ...rest\n } = props;\n return (\n <Flexbox\n align={'center'}\n className={className}\n height={size}\n horizontal\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n <Flexbox\n height={'100%'}\n style={{\n background: bgColors || cssVar.colorFillTertiary,\n borderRadius: size / 2,\n inset: 0,\n opacity: bgColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={'100%'}\n />\n {minValue !== undefined && maxValue !== undefined ? (\n <Tooltip title={rangeTooltip}>\n <Flexbox\n className={cx(showAnimation && styles.showAnimation)}\n height={'100%'}\n style={{\n background: rangeColors || cssVar.colorFill,\n borderRadius: size / 2,\n inset: 0,\n left: `${minValue}%`,\n opacity: rangeColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={`${maxValue - minValue}%`}\n />\n </Tooltip>\n ) : null}\n <Tooltip title={markerTooltip}>\n <div\n className={cx(styles.markerWrapper, showAnimation && styles.showAnimation)}\n style={{\n left: `${value}%`,\n }}\n >\n <div\n className={styles.marker}\n style={{\n background: color || cssVar.colorPrimary,\n height: size + 8,\n }}\n />\n </div>\n </Tooltip>\n </Flexbox>\n );\n});\n\nMarkerBar.displayName = 'MarkerBar';\n\nexport default MarkerBar;\n"],"mappings":";;;;;;AAoBA,MAAM,YAAY,YAA4C,OAAO,QAAQ;CAC3E,MAAM,EACJ,OACA,UACA,UACA,eACA,cACA,gBAAgB,OAChB,OACA,UACA,aACA,WACA,QAAQ,QACR,OACA,OAAO,GACP,GAAG,SACD;CACJ,OACE,qBAAC,SAAD;EACE,OAAO;EACI;EACX,QAAQ;EACR,YAAA;EACK;EACL,OAAO;GACL,UAAU;GACV,GAAG;EACL;EACO;EACP,GAAI;EAXN,UAAA;GAaE,oBAAC,SAAD;IACE,QAAQ;IACR,OAAO;KACL,YAAY,YAAY,OAAO;KAC/B,cAAc,OAAO;KACrB,OAAO;KACP,SAAS,WAAW,KAAM;KAC1B,UAAU;KACV,QAAQ;IACV;IACA,OAAO;GACR,CAAA;GACA,aAAa,KAAA,KAAa,aAAa,KAAA,IACtC,oBAAC,SAAD;IAAS,OAAO;IACd,UAAA,oBAAC,SAAD;KACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;KACnD,QAAQ;KACR,OAAO;MACL,YAAY,eAAe,OAAO;MAClC,cAAc,OAAO;MACrB,OAAO;MACP,MAAM,GAAG,SAAS;MAClB,SAAS,cAAc,KAAM;MAC7B,UAAU;MACV,QAAQ;KACV;KACA,OAAO,GAAG,WAAW,SAAS;IAC/B,CAAA;GACM,CAAA,IACP;GACJ,oBAAC,SAAD;IAAS,OAAO;IACd,UAAA,oBAAC,OAAD;KACE,WAAW,GAAG,OAAO,eAAe,iBAAiB,OAAO,aAAa;KACzE,OAAO,EACL,MAAM,GAAG,MAAM,GACjB;KAEA,UAAA,oBAAC,OAAD;MACE,WAAW,OAAO;MAClB,OAAO;OACL,YAAY,SAAS,OAAO;OAC5B,QAAQ,OAAO;MACjB;KACD,CAAA;IACE,CAAA;GACE,CAAA;EACF;;AAEb,CAAC;AAED,UAAU,cAAc"}
@@ -1,8 +1,6 @@
1
1
  "use client";
2
2
  import { styles } from "./styles.mjs";
3
- import { Flexbox } from "@lobehub/ui";
4
- import { Tooltip } from "@lobehub/ui/base-ui";
5
- import { cssVar, cx } from "antd-style";
3
+ import { Flexbox, Tooltip, cssVar, cx } from "@lobehub/ui";
6
4
  import { forwardRef } from "react";
7
5
  import { jsx, jsxs } from "react/jsx-runtime";
8
6
  //#region src/DataBars/ProgressBar.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.mjs","names":[],"sources":["../../src/DataBars/ProgressBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps } from '@lobehub/ui';\nimport { Tooltip } from '@lobehub/ui/base-ui';\nimport { cssVar, cx } from 'antd-style';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { styles } from './styles';\n\nexport interface ProgressBarProps extends FlexboxProps {\n bgColors?: string;\n color?: string;\n showAnimation?: boolean;\n size?: number;\n tooltip?: ReactNode;\n value: number;\n}\n\nconst ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>((props, ref) => {\n const {\n value,\n color,\n bgColors,\n tooltip,\n showAnimation = false,\n className,\n width = '100%',\n size = 8,\n style,\n ...rest\n } = props;\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n align={'center'}\n className={className}\n height={size}\n horizontal\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n <Flexbox\n height={'100%'}\n style={{\n background: bgColors || cssVar.colorFillTertiary,\n borderRadius: size / 2,\n inset: 0,\n opacity: bgColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={'100%'}\n />\n <Flexbox\n className={cx(showAnimation && styles.showAnimation)}\n height={'100%'}\n style={{\n background: color || cssVar.colorPrimary,\n borderRadius: size / 2,\n zIndex: 1,\n }}\n width={`${value}%`}\n />\n </Flexbox>\n </Tooltip>\n );\n});\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";;;;;;;;AAkBA,MAAM,cAAc,YAA8C,OAAO,QAAQ;CAC/E,MAAM,EACJ,OACA,OACA,UACA,SACA,gBAAgB,OAChB,WACA,QAAQ,QACR,OAAO,GACP,OACA,GAAG,SACD;CAEJ,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,qBAAC,SAAD;GACE,OAAO;GACI;GACX,QAAQ;GACR,YAAA;GACK;GACL,OAAO;IACL,UAAU;IACV,GAAG;GACL;GACO;GACP,GAAI;GAXN,UAAA,CAaE,oBAAC,SAAD;IACE,QAAQ;IACR,OAAO;KACL,YAAY,YAAY,OAAO;KAC/B,cAAc,OAAO;KACrB,OAAO;KACP,SAAS,WAAW,KAAM;KAC1B,UAAU;KACV,QAAQ;IACV;IACA,OAAO;GACR,CAAA,GACD,oBAAC,SAAD;IACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;IACnD,QAAQ;IACR,OAAO;KACL,YAAY,SAAS,OAAO;KAC5B,cAAc,OAAO;KACrB,QAAQ;IACV;IACA,OAAO,GAAG,MAAM;GACjB,CAAA,CACM;;CACF,CAAA;AAEb,CAAC;AAED,YAAY,cAAc"}
1
+ {"version":3,"file":"ProgressBar.mjs","names":[],"sources":["../../src/DataBars/ProgressBar.tsx"],"sourcesContent":["'use client';\n\nimport { Flexbox, FlexboxProps, Tooltip, cssVar, cx } from '@lobehub/ui';\nimport { ReactNode, forwardRef } from 'react';\n\nimport { styles } from './styles';\n\nexport interface ProgressBarProps extends FlexboxProps {\n bgColors?: string;\n color?: string;\n showAnimation?: boolean;\n size?: number;\n tooltip?: ReactNode;\n value: number;\n}\n\nconst ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>((props, ref) => {\n const {\n value,\n color,\n bgColors,\n tooltip,\n showAnimation = false,\n className,\n width = '100%',\n size = 8,\n style,\n ...rest\n } = props;\n\n return (\n <Tooltip title={tooltip}>\n <Flexbox\n align={'center'}\n className={className}\n height={size}\n horizontal\n ref={ref}\n style={{\n position: 'relative',\n ...style,\n }}\n width={width}\n {...rest}\n >\n <Flexbox\n height={'100%'}\n style={{\n background: bgColors || cssVar.colorFillTertiary,\n borderRadius: size / 2,\n inset: 0,\n opacity: bgColors ? 0.2 : 1,\n position: 'absolute',\n zIndex: 0,\n }}\n width={'100%'}\n />\n <Flexbox\n className={cx(showAnimation && styles.showAnimation)}\n height={'100%'}\n style={{\n background: color || cssVar.colorPrimary,\n borderRadius: size / 2,\n zIndex: 1,\n }}\n width={`${value}%`}\n />\n </Flexbox>\n </Tooltip>\n );\n});\n\nProgressBar.displayName = 'ProgressBar';\n\nexport default ProgressBar;\n"],"mappings":";;;;;;AAgBA,MAAM,cAAc,YAA8C,OAAO,QAAQ;CAC/E,MAAM,EACJ,OACA,OACA,UACA,SACA,gBAAgB,OAChB,WACA,QAAQ,QACR,OAAO,GACP,OACA,GAAG,SACD;CAEJ,OACE,oBAAC,SAAD;EAAS,OAAO;EACd,UAAA,qBAAC,SAAD;GACE,OAAO;GACI;GACX,QAAQ;GACR,YAAA;GACK;GACL,OAAO;IACL,UAAU;IACV,GAAG;GACL;GACO;GACP,GAAI;GAXN,UAAA,CAaE,oBAAC,SAAD;IACE,QAAQ;IACR,OAAO;KACL,YAAY,YAAY,OAAO;KAC/B,cAAc,OAAO;KACrB,OAAO;KACP,SAAS,WAAW,KAAM;KAC1B,UAAU;KACV,QAAQ;IACV;IACA,OAAO;GACR,CAAA,GACD,oBAAC,SAAD;IACE,WAAW,GAAG,iBAAiB,OAAO,aAAa;IACnD,QAAQ;IACR,OAAO;KACL,YAAY,SAAS,OAAO;KAC5B,cAAc,OAAO;KACrB,QAAQ;IACV;IACA,OAAO,GAAG,MAAM;GACjB,CAAA,CACM;;CACF,CAAA;AAEb,CAAC;AAED,YAAY,cAAc"}
@@ -1,4 +1,4 @@
1
- import { createStaticStyles } from "antd-style";
1
+ import { createStaticStyles } from "@lobehub/ui";
2
2
  //#region src/DataBars/styles.ts
3
3
  const styles = createStaticStyles(({ css, cssVar }) => ({
4
4
  emphasis: css`
@@ -1 +1 @@
1
- {"version":3,"file":"styles.mjs","names":[],"sources":["../../src/DataBars/styles.ts"],"sourcesContent":["import { createStaticStyles } from 'antd-style';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n fill: ${cssVar.colorTextDescription};\n `,\n marker: css`\n width: 4px;\n border-radius: 4px;\n box-shadow: 0 0 0 3px ${cssVar.colorBgContainer};\n `,\n markerWrapper: css`\n position: absolute;\n right: 50%;\n width: 1.25rem;\n `,\n showAnimation: css`\n transition: all 0.25s ${cssVar.motionEaseInOut};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,UAAU,GAAG;;;;;CAKb,OAAO,GAAG;;;YAGA,OAAO,qBAAqB;;CAEtC,QAAQ,GAAG;;;4BAGe,OAAO,iBAAiB;;CAElD,eAAe,GAAG;;;;;CAKlB,eAAe,GAAG;4BACQ,OAAO,gBAAgB;;AAEnD,EAAE"}
1
+ {"version":3,"file":"styles.mjs","names":[],"sources":["../../src/DataBars/styles.ts"],"sourcesContent":["import { createStaticStyles } from '@lobehub/ui';\n\nexport const styles = createStaticStyles(({ css, cssVar }) => ({\n emphasis: css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `,\n label: css`\n font-size: 12px;\n line-height: 16px;\n fill: ${cssVar.colorTextDescription};\n `,\n marker: css`\n width: 4px;\n border-radius: 4px;\n box-shadow: 0 0 0 3px ${cssVar.colorBgContainer};\n `,\n markerWrapper: css`\n position: absolute;\n right: 50%;\n width: 1.25rem;\n `,\n showAnimation: css`\n transition: all 0.25s ${cssVar.motionEaseInOut};\n `,\n}));\n"],"mappings":";;AAEA,MAAa,SAAS,oBAAoB,EAAE,KAAK,cAAc;CAC7D,UAAU,GAAG;;;;;CAKb,OAAO,GAAG;;;YAGA,OAAO,qBAAqB;;CAEtC,QAAQ,GAAG;;;4BAGe,OAAO,iBAAiB;;CAElD,eAAe,GAAG;;;;;CAKlB,eAAe,GAAG;4BACQ,OAAO,gBAAgB;;AAEnD,EAAE"}
@@ -6,9 +6,7 @@ import { DonutChartTooltip } from "./DonutChartTooltip.mjs";
6
6
  import { parseLabelInput } from "./inputParser.mjs";
7
7
  import { renderInactiveShape } from "./renderInactiveShape.mjs";
8
8
  import { styles } from "./styles.mjs";
9
- import { Flexbox } from "@lobehub/ui";
10
- import { Skeleton } from "@lobehub/ui/base-ui";
11
- import { css, cssVar, cx, useThemeMode } from "antd-style";
9
+ import { Flexbox, Skeleton, css, cssVar, cx, useThemeMode } from "@lobehub/ui";
12
10
  import { forwardRef, useEffect, useState } from "react";
13
11
  import { Pie, PieChart, ResponsiveContainer, Tooltip as Tooltip$1 } from "recharts";
14
12
  import { jsx, jsxs } from "react/jsx-runtime";