Skip to content

Commit 5b97c77

Browse files
committed
fix: follow the rabbit
1 parent e8dc353 commit 5b97c77

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/components/Package/TimelineChart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const convertedData = computed(() => {
8282
return addEvaluationFlags(entries, props.versionSubEvents).toReversed()
8383
})
8484
85-
const versions = computed(() => convertedData.value.map(d => d.name.split('@')[1] ?? ''))
85+
const versions = computed(() => convertedData.value.map(d => d.version))
8686
8787
const activeVersionIndex = computed(() => {
8888
if (!activeVersion.value) return -1

app/utils/charts.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,10 @@ export function createAltTextForTimelineChart({
755755

756756
const firstValue = config.metric === 'totalSize' ? first?.totalSize : first?.dependencyCount
757757
const lastValue = config.metric === 'totalSize' ? last?.totalSize : last?.dependencyCount
758-
const overall_progress_percentage = Math.round(((lastValue ?? 0) / (firstValue ?? 1) - 1) * 100)
758+
const baseline = firstValue ?? 0
759+
const current = lastValue ?? baseline
760+
const overall_progress_percentage =
761+
baseline > 0 ? Math.round(((current - baseline) / baseline) * 100) : 0
759762

760763
const version_events = withEvents
761764
.map(item =>

0 commit comments

Comments
 (0)