@@ -545,6 +545,7 @@ const chartData = computed<{ dataset: VueUiXyDatasetItem[] | null; dates: number
545545 if (isListedFramework (pkg )) {
546546 item .color = getFrameworkColor (pkg )
547547 }
548+ // Other packages default to built-in palette
548549 return item
549550 })
550551
@@ -570,18 +571,24 @@ const datetimeFormatterOptions = computed(() => {
570571 }[selectedGranularity .value ]
571572})
572573
574+ const sanitise = (value : string ) =>
575+ value
576+ .replace (/ ^ @/ , ' ' )
577+ .replace (/ [\\ /:"*?<>|] / g , ' -' )
578+ .replace (/ \/ / g , ' -' )
579+
573580function buildExportFilename(extension : string ): string {
574581 const g = selectedGranularity .value
575582 const range = ` ${startDate .value }_${endDate .value } `
576583
577584 if (! isMultiPackageMode .value ) {
578585 const name = effectivePackageNames .value [0 ] ?? props .packageName ?? ' package'
579- return ` ${name }-${g }_${range }.${extension } `
586+ return ` ${sanitise ( name ) }-${g }_${range }.${extension } `
580587 }
581588
582589 const names = effectivePackageNames .value
583590 const label = names .length === 1 ? names [0 ] : names .join (' _' )
584- return ` ${label }-${g }_${range }.${extension } `
591+ return ` ${sanitise ( label ?? ' ' ) }-${g }_${range }.${extension } `
585592}
586593
587594const config = computed (() => {
@@ -635,7 +642,7 @@ const config = computed(() => {
635642 yLabel: $t (' package.downloads.y_axis_label' , {
636643 granularity: $t (` package.downloads.granularity_${selectedGranularity .value } ` ),
637644 }),
638- xLabel: props . packageNames ? ' ' : xAxisLabel .value , // for multiple series, names are displayed in the chart's legend
645+ xLabel: isMultiPackageMode . value ? ' ' : xAxisLabel .value , // for multiple series, names are displayed in the chart's legend
639646 yLabelOffsetX: 12 ,
640647 fontSize: isMobile .value ? 32 : 24 ,
641648 },
0 commit comments