Skip to content

feat: add quadrant chart to compare page - #2388

Merged
graphieros merged 43 commits into
mainfrom
compare-quadrant-chart
Apr 7, 2026
Merged

feat: add quadrant chart to compare page#2388
graphieros merged 43 commits into
mainfrom
compare-quadrant-chart

Conversation

@graphieros

@graphierosgraphieros commented Apr 5, 2026

Copy link
Copy Markdown
Member

Resolves#2387

This adds a quadrant chart to the compare page, to visualise comparisons along 2 axes:

  • X: adoption
  • Y: package efficiency

The chart is displayed below the bar charts, and includes:

  • png, svg exports
  • alt text copy feature
Dark modeLight mode
dark modelight mode
  • A tooltip explains how the data is processed:
image
  • Hovering datapoints reveals facets ordered through both axes of the quadrant:
image

Data processing:

  • log scaled to handle large disparities: downloads, likes, install size, dependencies, package size
  • adoption score: mostly driven by downloads, with small contributions from freshness and npmx likes
  • efficiency score: based on install size, dependencies, vulnerabilities, TS support, deprecation

Some signals are inverted (so lower is better): size, deps, vulnerabilities
Deprecation is a hard override and forces min efficiency

The weights I have chosen can be subject to discussion, because of their arbitrary nature:

constWEIGHTS={adoption: {downloads: 0.75,// dominant signal because they best reflect real-world adoption (in the data we have through facets currently)freshness: 0.15,// small correction so stale packages are slightly likes: 0.1,// might be pumped up in the future when ./npmx likes are more mainstream},efficiency: {installSize: 0.3,// weighted highest because it best reflects consumer footprint// dependency weights are already measured in install size in some way, but still useful knobs to find the sweet spotdependencies: 0.05,// direct deps capture architectural and supply-chain complexitytotalDependencies: 0.2,// same for total depspackageSize: 0.1,vulnerabilities: 0.2,// penalize security burdentypes: 0.2,// TS support// Note: the 'deprecated' metric is not weighed because it just forces a -1 evaluation},}/* Fixed logarithmic ceilings to normalize metrics onto a stable [-1, 1] scale.* This avoids dataset-relative min/max normalization, which would shift scores depending* on which packages are being compared. Ceilings act as reference points for what is* considered 'high' for each metric, ensuring consistent positioning across different* datasets while preserving meaningful differences via log scaling. */constLOG_CEILINGS={downloads: 100_000_000,likes: 1000,// might be pumped up in the future when ./npmx likes are more mainstreaminstallSize: 25_000_000,dependencies: 100,totalDependencies: 1_000,packageSize: 15_000_000,}constVULNERABILITY_PENALTY_MULTIPLIER=2

Other

  • Bump vue-data-ui to 3.17.11 with updates for the quadrant chart component, and other fixes to prevent errors in tests related to Teleport when legends are disabled.

@graphierosgraphieros linked an issue Apr 5, 2026 that may be closed by this pull request
@vercel

vercelBot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentApr 6, 2026 8:52pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewApr 6, 2026 8:52pm
npmx-lunariaIgnoredIgnoredApr 6, 2026 8:52pm

Request Review

@github-actions

github-actionsBot commented Apr 5, 2026

Copy link
Copy Markdown

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

FileNote
i18n/locales/en.jsonSource changed, localizations will be marked as outdated.
i18n/locales/fr-FR.jsonLocalization changed, will be marked as complete. 🔄️
Warnings reference
IconDescription
🔄️The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@graphieros
graphieros marked this pull request as draft April 5, 2026 08:48
@coderabbitai

coderabbitaiBot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a quadrant comparison chart to the Compare page: a new Vue <script setup> component FacetQuadrantChart.vue that maps incoming package data to a normalized quadrant dataset via createQuadrantDataset, computes adoption/efficiency scores (including freshness, vulnerability penalty, types/deprecation handling), assigns quadrants, and renders with VueUiQuadrant. Implements themed styling, responsive tooltips, PNG/SVG export handlers, alt-text generation/copy, print watermark sizing options, i18n entries/schema updates (EN/FR), a vue-data-ui dependency bump, and accompanying unit and a11y tests.

Possibly related PRs

Suggested labels

front, a11y

Suggested reviewers

  • danielroe
  • alexdln
  • ghostdevv
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Out of Scope Changes check⚠️ WarningThe PR contains one minor out-of-scope change: FacetBarChart.vue colour adjustment from fgSubtle to fg, unrelated to quadrant chart feature.Consider separating the FacetBarChart.vue styling change into a separate PR or clarify its relationship to the quadrant chart feature.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedThe PR implements the quadrant chart feature resolving issue #2387, with all core requirements met including chart display, exports, alt-text, and scoring methodology.
Description check✅ PassedThe pull request description clearly relates to the changeset, describing the quadrant chart feature, data processing methodology, scoring weights, and supporting changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch compare-quadrant-chart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecovBot commented Apr 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.92891% with 74 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
app/components/Compare/FacetQuadrantChart.vue66.33%28 Missing and 6 partials ⚠️
app/utils/charts.ts0.00%22 Missing and 5 partials ⚠️
app/composables/useChartWatermark.ts0.00%8 Missing and 1 partial ⚠️
app/utils/compare-quadrant-chart.ts94.52%2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/utils/compare-quadrant-chart.ts
Comment threadapp/utils/compare-quadrant-chart.ts

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be4b4196-422e-437b-89ff-c11f23cf7b05

📥 Commits

Reviewing files that changed from the base of the PR and between 5324b96 and 11fd407.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • app/components/Compare/FacetQuadrantChart.vue
  • app/composables/useChartWatermark.ts
  • app/pages/compare.vue
  • app/utils/charts.ts
  • app/utils/compare-quadrant-chart.ts
  • i18n/locales/en.json
  • i18n/locales/fr-FR.json
  • i18n/schema.json
  • package.json
  • test/nuxt/a11y.spec.ts
  • test/unit/app/utils/compare-quadrant-chart.spec.ts

Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/components/Compare/FacetQuadrantChart.vue Outdated
Comment threadapp/composables/useChartWatermark.ts
Comment threadapp/utils/charts.ts
Comment threadi18n/locales/en.json Outdated
Comment threadi18n/locales/fr-FR.json Outdated
@graphieros
graphieros marked this pull request as draft April 5, 2026 10:05
@graphieros
graphieros added this pull request to the merge queueApr 7, 2026
Merged via the queue into main with commit 15b53bfApr 7, 2026
23 checks passed
@graphieros
graphieros deleted the compare-quadrant-chart branch April 7, 2026 06:59
@github-actionsgithub-actionsBot mentioned this pull request Apr 7, 2026
@serhalpserhalp modified the milestones: v0.8.0, v0.9.0Apr 7, 2026
@github-project-automationgithub-project-automationBot moved this from Backlog to Done in ReleasesApr 7, 2026
@serhalpserhalp modified the milestones: v0.9.0, v0.8.0Apr 7, 2026
@serhalpserhalp removed the needs review This PR is waiting for a review from a maintainer label Apr 7, 2026
ayo-run pushed a commit to ayo-run/npmx.dev that referenced this pull request Aug 5, 2026
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

add quadrant chart on the compare page

4 participants

@graphieros@ghostdevv@alexdln@serhalp