Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bar dimension selection ring #419

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

rich-b
Copy link

@rich-b rich-b commented Sep 27, 2024

Adds a selection ring for bar charts when highlighting by dimension

Description

When highlighting by dimension, instead of changing the stoke width and color for the bar that was selected, a new selection ring will appear that circles the entire dimension selected.

Related Issue

#374

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

image

image

image

image

image
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

strokeWidth: { value: 2 },
stroke: { value: getColorValue('static-blue', colorScheme) },
cornerRadius: { value: 6 },
padding: { value: 5 },
Copy link
Member

Choose a reason for hiding this comment

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

Does this do anything? Looking at the mark docs for rect I don't see anything about padding.
https://vega.github.io/vega/docs/marks/rect/

Comment on lines 265 to 272
y: { value: -5 },
y2: { signal: 'height + 5' },
xc: { signal: `scale('xBand', datum.${name}_selectedGroupId) + bandwidth('xBand')/2` },
width: { signal: `bandwidth('xBand')/(1 - ${paddingRatio} / 2)` },
}
: {
x: { value: -5 },
x2: { signal: 'width + 5' },
Copy link
Member

Choose a reason for hiding this comment

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

The 5 px added above/below the bar causes jitter when you open the popover. This is because you are adding marks that extend belong the chart area and that causes the whole chart to recalculate its size. I'm confirming with Alan but I think we want to drop this so that we don't get jitter.

Screen.Recording.2024-10-01.at.11.30.13.AM.mov

@rich-b
Copy link
Author

rich-b commented Oct 2, 2024

Thanks @marshallpete, I made some changes. There is still a slight jitter with the extra 5px removed. I've seen this in other areas as well however.

Copy link

github-actions bot commented Oct 2, 2024

Copy link

sonarqubecloud bot commented Oct 2, 2024

@marshallpete marshallpete merged commit 6033b23 into adobe:main Oct 4, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants