Skip to content

Commit

Permalink
Visuals iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
agersant committed Oct 19, 2024
1 parent 15b13b5 commit d167bd7
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/components/playback/Stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ watchImmediate(playlistSongs, () => {
{
// Sort genres by most songs
let genres = Array.from(songsByGenre, ([genre, count]) => ({ x: genre, y: Math.log(count) / Math.log(1.1) }));
let genres = Array.from(songsByGenre, ([genre, count]) => ({ x: genre, y: Math.pow(count, 0.4) }));
genres.sort((a, b) => a.y - b.y).reverse();
// Only keep top 8 and sort alphabetically
genres = genres.slice(0, 8);
genres.sort((a, b) => a.x < b.x ? 1 : -1);
genres.sort((a, b) => a.x < b.x ? -1 : 1);
genreData.value = genres;
}
Expand Down Expand Up @@ -183,7 +183,7 @@ const yearChartOptions = {
dataLabels: { enabled: false },
grid: { show: false, },
fill: {
type: 'gradient',
type: "gradient",
gradient: {
type: "vertical",
colorStops: [
Expand Down Expand Up @@ -211,10 +211,19 @@ const yearChartOptions = {
type: "datetime",
},
yaxis: {
axisBorder: { show: false },
axisTicks: { show: false },
min: 0,
labels: { show: false },
axisBorder: { show: true },
axisTicks: {
show: true,
color: toHex(surface400.value),
},
tickAmount: 4,
labels: {
style: {
colors: toHex(surface500.value),
fontSize: "12px",
fontFamily: "InterVariable",
},
},
},
};
Expand Down

0 comments on commit d167bd7

Please sign in to comment.