Chart.js vs D3.js: source lines of code compared

This page compares the source lines of code (SLOC) of chartjs/Chart.js and d3/d3 using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-08-26, chartjs/Chart.js contains 42,350 total lines (31,657 code) across 113 files, while d3/d3 contains 2,512 total lines (871 code) across 8 files as of 2026-08-26. chartjs/Chart.js is about 36x the size of d3/d3 by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricchartjs/Chart.jsd3/d3
Files1138
Total lines42,3502,512
Code lines31,657871
Comment lines5,4151,178
Blank lines5,278463
Languages counted74

Top languages in chartjs/Chart.js: YAML (48.2% of code), JavaScript (35.9% of code), TypeScript (14.9% of code). Top languages in d3/d3: Shell (78.8% of code), JavaScript (10.7% of code), JSON (10.6% of code). JavaScript, JSON, Shell appear in both top language lists; YAML, TypeScript appear only in chartjs/Chart.js's top languages; Markdown appears only in d3/d3's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. chartjs/Chart.js was counted at ref master (commit cb02e1d207bd) on 2026-08-26; d3/d3 was counted at ref main (commit ca958d45217b) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

Evidence and next steps:

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, chartjs/Chart.js or d3/d3?

chartjs/Chart.js has more code: 31,657 code lines versus 871 for d3/d3, about 36x as much, based on cached OctoCounts reports as of 2026-08-26.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for chartjs/Chart.js, d3/d3, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. chartjs/Chart.js was counted at ref master (commit cb02e1d207bd) on 2026-08-26; d3/d3 was counted at ref main (commit ca958d45217b) on 2026-08-26. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.