Fix types in QuestionGroupChart component

This commit is contained in:
Adrian Rumpold
2025-07-10 09:23:01 +02:00
parent f3f490d960
commit fa8a0e4763
3 changed files with 10 additions and 4 deletions

6
.gitignore vendored
View File

@@ -12,6 +12,12 @@ dist
dist-ssr
*.local
# TypeScript cache
*.tsbuildinfo
# Optional eslint cache
.eslintcache
# Editor directories and files
.vscode/*
!.vscode/extensions.json

View File

@@ -35,7 +35,7 @@ function App() {
// Create scales
const xScale = d3
.scaleBand()
.scaleBand<number>()
.domain(sortedResponses)
.range([0, sortedResponses.length * config.groupSpacing]);
return (

View File

@@ -10,9 +10,9 @@ import "./Chart.css";
interface QuestionGroupChartProps {
question: string;
metadata?: CategoryMetadata;
groupData: { response: string }[];
responses: string[];
xScale: d3.ScaleBand<string>;
groupData: { response: number }[];
responses: number[];
xScale: d3.ScaleBand<number>;
}
function makeDot(