Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the spacing #792

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all 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
34 changes: 17 additions & 17 deletions src/lib/ui/time/supabase/charts/heatmap-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ export function heatmap(categories: Set<string>, yAxisData: string[], series: He
if (series?.data) {
if (series.name === "lab activity for all users" || series.name === "topic activity for all users") {
gridConfig = {
left: "30%",
right: "30%",
bottom: "15%",
left: "15%",
right: "10%",
bottom: "10%",
top: "10%",
width: "40%", // Fixed width
width: "80%", // Fixed width
height: "80%", // Fixed height
containLabel: false // Prevent resizing based on labels
};
} else {
gridConfig = {
left: "20%",
right: "10%",
left: "15%",
right: "15%",
bottom: "15%",
top: "15%",
width: "60%", // Fixed width
width: "80%", // Fixed width
height: "80px", // Fixed height
containLabel: false // Prevent resizing based on labels
containLabel: true // Prevent resizing based on labels
};
}
visualmapValue = series.data.length !== 0 ? Math.max(...series.data.map((item) => item[2])) : 0;
Expand Down Expand Up @@ -61,8 +61,8 @@ export function heatmap(categories: Set<string>, yAxisData: string[], series: He
show: true
},
axisLabel: {
interval: 2,
fontSize: 15,
interval: 3,
fontSize: 12,
margin: 10 // Adjust margin to control spacing
},
axisTick: {
Expand All @@ -74,17 +74,17 @@ export function heatmap(categories: Set<string>, yAxisData: string[], series: He
position: "bottom"
},
yAxis: {
type: "category",
data: yAxisData[0] !== undefined ? yAxisData : [],
splitArea: {
show: true
},
type: "category",
data: yAxisData[0] !== undefined ? yAxisData : [],
splitArea: {
show: true
},
axisLabel: {
interval: 0,
fontSize: 15,
padding: [10, 0, 10, 0] // Increase space between rows
}
},
},
visualMap: {
min: 0,
max: visualmapValue,
Expand Down Expand Up @@ -140,7 +140,7 @@ export function renderCombinedChart(heatmapActivities: any[], bgPatternImg: HTML
},
axisLabel: {
interval: 0,
fontSize: 15
fontSize: 12
},
visualMap: {
min: 0,
Expand Down