@@ -1622,6 +1622,10 @@ watch(selectedMetric, value => {
16221622 if (! isMounted .value ) return
16231623 loadMetric (value )
16241624})
1625+
1626+ // Sparkline charts (a11y alternative display for multi series)
1627+ const isSparklineLayout = shallowRef (false )
1628+
16251629 </script >
16261630
16271631<template >
@@ -1630,6 +1634,51 @@ watch(selectedMetric, value => {
16301634 id =" trends-chart"
16311635 :aria-busy =" activeMetricState.pending ? 'true' : 'false'"
16321636 >
1637+ <div
1638+ v-if =" isMultiPackageMode"
1639+ class =" inline-flex items-center gap-1 rounded-md border border-border-subtle bg-bg-subtle p-0.5 mt-4 mb-8"
1640+ role =" tablist"
1641+ :aria-label =" 'Chart layout toggle'"
1642+ >
1643+ <button
1644+ id =" classic-line-chart-layout"
1645+ type =" button"
1646+ role =" tab"
1647+ :aria-selected =" isSparklineLayout ? 'false' : 'true'"
1648+ aria-controls =" TODO"
1649+ :tabindex =" isSparklineLayout ? 0 : -1"
1650+ class =" flex items-center justify-center gap-x-2 rounded px-3 py-2 font-mono text-sm border border-solid transition-colors duration-150 focus-visible:outline-accent/70"
1651+ :class ="
1652+ isSparklineLayout
1653+ ? 'border-transparent text-fg-subtle hover:text-fg'
1654+ : 'bg-bg border-border shadow-sm text-fg'
1655+ "
1656+ @click =" isSparklineLayout = false"
1657+ >
1658+ <span class =" i-lucide:chart-line size-[1em]" aria-hidden =" true" />
1659+ <span >{{ $t('package.trends.chart_view_combined') }}</span >
1660+ </button >
1661+
1662+ <button
1663+ id =" comparison-tab-charts"
1664+ type =" button"
1665+ role =" tab"
1666+ :aria-selected =" isSparklineLayout ? 'true' : 'false'"
1667+ aria-controls =" comparison-panel-charts"
1668+ :tabindex =" isSparklineLayout ? -1 : 0"
1669+ class =" flex items-center justify-center gap-x-2 rounded px-3 py-2 font-mono text-sm border border-solid transition-colors duration-150 focus-visible:outline-accent/70"
1670+ :class ="
1671+ isSparklineLayout
1672+ ? 'bg-bg border-border shadow-sm text-fg'
1673+ : 'border-transparent text-fg-subtle hover:text-fg'
1674+ "
1675+ @click =" isSparklineLayout = true"
1676+ >
1677+ <span class =" i-lucide:square-split-horizontal size-[1em]" aria-hidden =" true" />
1678+ <span >{{ $t('package.trends.chart_view_split') }}</span >
1679+ </button >
1680+ </div >
1681+
16331682 <div class =" w-full mb-4 flex flex-col gap-3" >
16341683 <div class =" grid grid-cols-2 sm:flex sm:flex-row gap-3 sm:gap-2 sm:items-end" >
16351684 <SelectField
@@ -1875,7 +1924,15 @@ watch(selectedMetric, value => {
18751924 "
18761925 >
18771926 <ClientOnly v-if =" chartData.dataset" >
1878- <div :data-pending =" pending" :data-minimap-visible =" maxDatapoints > 6" >
1927+ <div v-if =" isSparklineLayout" >
1928+ <ChartSplitSparkline
1929+ :dataset =" normalisedDataset"
1930+ :dates =" chartData.dates"
1931+ :datetimeFormatterOptions
1932+ />
1933+ </div >
1934+
1935+ <div :data-pending =" pending" :data-minimap-visible =" maxDatapoints > 6" v-else >
18791936 <VueUiXy
18801937 :dataset =" normalisedDataset"
18811938 :config =" chartConfig"
0 commit comments