Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 23 additions & 37 deletions app/components/Package/TrendsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,59 +201,45 @@ function formatXyDataset(
dataset: EvolutionData,
seriesName: string,
): { dataset: VueUiXyDatasetItem[] | null; dates: number[] } {
const baseColor = accent.value
const lightColor = isDarkMode.value && baseColor ? lightenOklch(baseColor, 0.618) : undefined

// Subtle path gradient applied in dark mode only
const temperatureColors =
isDarkMode.value && typeof baseColor === 'string' && typeof lightColor === 'string'
? [lightColor, baseColor]
: undefined

const datasetItem: VueUiXyDatasetItem = {
name: seriesName,
type: 'line',
series: dataset.map(d => d.value),
color: accent.value,
temperatureColors,
useArea: true,
}
Comment thread
graphieros marked this conversation as resolved.
Outdated

if (selectedGranularity === 'weekly' && isWeeklyDataset(dataset)) {
return {
dataset: [
{
name: seriesName,
type: 'line',
series: dataset.map(d => d.value),
color: accent.value,
useArea: true,
},
],
dataset: [datasetItem],
dates: dataset.map(d => d.timestampEnd),
}
}
if (selectedGranularity === 'daily' && isDailyDataset(dataset)) {
return {
dataset: [
{
name: seriesName,
type: 'line',
series: dataset.map(d => d.value),
color: accent.value,
useArea: true,
},
],
dataset: [datasetItem],
dates: dataset.map(d => d.timestamp),
}
}
if (selectedGranularity === 'monthly' && isMonthlyDataset(dataset)) {
return {
dataset: [
{
name: seriesName,
type: 'line',
series: dataset.map(d => d.value),
color: accent.value,
useArea: true,
},
],
dataset: [datasetItem],
dates: dataset.map(d => d.timestamp),
}
}
if (selectedGranularity === 'yearly' && isYearlyDataset(dataset)) {
return {
dataset: [
{
name: seriesName,
type: 'line',
series: dataset.map(d => d.value),
color: accent.value,
useArea: true,
},
],
dataset: [datasetItem],
dates: dataset.map(d => d.timestamp),
}
}
Expand Down Expand Up @@ -1529,7 +1515,7 @@ const chartConfig = computed(() => {
backdropFilter: false,
backgroundColor: 'transparent',
customFormat: ({ datapoint }: { datapoint: Record<string, any> | any[] }) => {
if (!datapoint) return ''
if (!datapoint || pending.value) return ''

const items = Array.isArray(datapoint) ? datapoint : [datapoint[0]]
const hasMultipleItems = items.length > 1
Expand Down
13 changes: 7 additions & 6 deletions app/components/Package/VersionDistribution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const chartConfig = computed(() => {
backgroundColor: 'transparent',
customFormat: (params: TooltipParams) => {
const { datapoint, absoluteIndex, bars } = params
if (!datapoint) return ''
if (!datapoint || pending.value) return ''

// Use absoluteIndex to get the correct version from chartDataset
const index = Number(absoluteIndex)
Expand Down Expand Up @@ -496,11 +496,12 @@ const endDate = computed(() => {
/>
</template>

<!-- Subtle gradient applied for area charts -->
<template #area-gradient="{ series: chartModalSeries, id: gradientId }">
<linearGradient :id="gradientId" x1="0" x2="0" y1="0" y2="1">
<stop offset="0%" :stop-color="chartModalSeries.color" stop-opacity="0.2" />
<stop offset="100%" :stop-color="colors.bg" stop-opacity="0" />
<!-- Custom bar gradient based on the series color -->
<template #bar-gradient="{ series, positiveId }">
<linearGradient :id="positiveId" x1="0" x2="0" y1="0" y2="1">
<!-- vue-data-ui exposes hex-normalized colors -->
<stop offset="0%" :stop-color="lightenHex(series.color, 0.618)" />
<stop offset="100%" :stop-color="series.color" stop-opacity="0.618" />
</linearGradient>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
</template>

Expand Down
2 changes: 1 addition & 1 deletion app/components/Package/WeeklyDownloadStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const config = computed(() => {
easing: 'ease-in-out',
trail: {
show: true,
length: 20,
length: 30,
opacity: 0.75,
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"vite-plugin-pwa": "1.2.0",
"vite-plus": "0.0.0-833c515fa25cef20905a7f9affb156dfa6f151ab",
"vue": "3.5.28",
"vue-data-ui": "3.15.0"
"vue-data-ui": "3.15.5"
},
"devDependencies": {
"@e18e/eslint-plugin": "0.1.4",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading