GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix crash when ordering categories by value with null coordinates by SAY-5 · Pull Request #7855 · plotly/plotly.js

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #7840.

When categoryorder is set to a value-based order (e.g. sum descending, total ascending), sortAxisCategoriesByValue collects per-category values by indexing categoriesValue[catIndex]. A data point with a null/NaN category coordinate maps to BADNUM, so catIndex is undefined and categoriesValue[catIndex][1] throws TypeError: Cannot read properties of undefined (reading '1'), leaving the chart blank.

This skips points whose position is not a valid category, using the same catIndex + 1 guard already applied in the 2dMap branch above. Such points carry no category to order anyway. Added a regression test for a bar chart with a null x and sum descending.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
SAY-5 added 2 commits June 19, 2026 18:20
@SAY-5
Skip null category coordinates when ordering by value
4da37ae
Signed-off-by: Sai Asish Y <[email protected]>
@SAY-5
Add draftlog for plotly#7855
5fff4b7
Signed-off-by: Sai Asish Y <[email protected]>
@camdecoster camdecoster self-assigned this Jun 24, 2026
@camdecoster

camdecoster commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! I'll review this and follow up with you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

camdecoster
camdecoster reviewed Jun 30, 2026
View reviewed changes

@camdecoster camdecoster left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is a good fix. I left you one comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/plots/plots.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@camdecoster
Clarify conditional check
2e9257c
camdecoster
camdecoster approved these changes Jul 2, 2026
View reviewed changes
@camdecoster
camdecoster merged commit 848c158 into plotly:master Jul 2, 2026
83 of 85 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 6, 2026
[BUG]: sortAxisCategoriesByValue conditional doesn't handle NaN values #7892
Closed
fix: Handle NaN values in sortAxisCategoriesByValue conditional check #7893
Merged
chore: Update geo trace fitbounds default to 'locations' #7895
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@camdecoster camdecoster camdecoster approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@camdecoster camdecoster

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG]: X-Axis NULL values lead to typeError when using categoryorder sumdescending in barcharts

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@SAY-5 @camdecoster
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.