Skip to content

feat: add menu and route support for axis props#13183

Merged
kgryte merged 3 commits into
stdlib-js:refactor/plotfrom
gururaj1512:view-axis-props
Jun 28, 2026
Merged

feat: add menu and route support for axis props#13183
kgryte merged 3 commits into
stdlib-js:refactor/plotfrom
gururaj1512:view-axis-props

Conversation

@gururaj1512

Copy link
Copy Markdown
Member

Resolves None

Description

What is the purpose of this pull request?

This pull request:

  • feat: add menu and route support for axis props
Screen.Recording.2026-06-29.at.1.07.47.AM.mp4

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • None

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This contribution was developed with the assistance of AI (Gemini). AI was used for codebase research, error analysis, and code generation. Specifically:

  • I consulted the AI to analyze and understand a bug where custom axis descriptions were ignored because Vega's internal ariaGuide reads descriptions directly from the child visual item rather than the parent mark definition. The AI helped identify this root cause and generate a workaround to map descriptions via encode.axis.enter.

@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 28, 2026
}
}

// FIXME: Currently, Vega's `ariaGuide` reads `description` from `item.description` (the child visual item), not from `mark.description` (the group definition). Since `buildAxisEncode` does not map `description`, the value is never populated on the item and the custom description is silently ignored. As a workaround, inject the description via a custom `encode.axis.enter` mapping so that Vega copies it onto the visual item during initialization.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I discovered that custom axis descriptions were being silently ignored because Vega’s internal accessibility helper (ariaGuide) reads the description from the child visual item (item.description) rather than the group mark definition (mark.description). Since Vega’s default axis encoder does not map the top-level description down to this child item, the custom value is never populated. To resolve this, this change dynamically injects the description via encode.axis.enter.description as a workaround, ensuring the value is correctly copied to the child visual item during initialization and properly rendered as the SVG group's aria-label in the DOM.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also you may notice when description property is set to some value. aria-label attribute is being set to two componets (intended component and it's inner component)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if this is a bug on Vega's side. And if so, it may be worth opening an issue on the Vega repo.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yup, I'll take another look at this issue and open an issue on the Vega repo.

@kgryte kgryte added Feature Issue or pull request for adding a new feature. and removed Needs Review A pull request which needs code review. labels Jun 28, 2026
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall, looks good. Added a couple of TODOs which can be addressed once we do a clean-up pass throughout the whole Vega implementation.

@kgryte

kgryte commented Jun 28, 2026

Copy link
Copy Markdown
Member

As the CI failure is expected, I'll go ahead and merge.

@kgryte kgryte merged commit 97482bb into stdlib-js:refactor/plot Jun 28, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Issue or pull request for adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants