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

fix: address an issue where stacked bar plot doesn't work #132

Merged
merged 4 commits into from
Feb 11, 2025

Conversation

dakshpokar
Copy link
Collaborator

@dakshpokar dakshpokar commented Feb 10, 2025

Description

This PR fixes the issue with stacked bar plot in pymaidr. Also it solves the problem where user had to create the object of stacked bar plot and then pass it to the function maidr.stacked(). Now with this change user will not need to pass the plot object to maidr.stacked(plot) instead they can directly call maidr.show(plot) like we do it for the other plots.

closes #82

Type of Change

  • Bug fix
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@dakshpokar dakshpokar changed the title fix: address an issue where stack plot doesn't work fix: address an issue where stacked bar plot doesn't work Feb 10, 2025
@dakshpokar
Copy link
Collaborator Author

Greetings Professor @jooyoungseo & @SaaiVenkat,
This pull request resolves the issue with the stacked bar plot by implementing a minor patch to the bar function. Consequently, the previous requirement to create a separate object for the stacked bar plot and subsequently invoke interactivity via the maidr.stacked method has been eliminated. We can now directly call maidr.show(plot) in the same manner as with other plot types.

Please note that this pull request does not address the highlighting issue. The highlight feature in PyMaidr was introduced in this pull request. To fully resolve the highlighting functionality for stacked bar plots, we will need to develop a more generic solution. Currently, the desired elements are extracted by adding the attribute maidr="true" in the SVG; however, a more universal approach is necessary to extend this functionality across similar plots.
I will be creating a separate issue for this as we need to support highlight issue for not just segmented plots like stacked bar plot but also for box plot.

Thanks,
Daksh Pokar

maidr/patch/common.py Outdated Show resolved Hide resolved
maidr/patch/common.py Outdated Show resolved Hide resolved
@SaaiVenkat SaaiVenkat merged commit 003be7c into xability:main Feb 11, 2025
6 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.

fix(stackedplot): address an issue where stack plot doesn't work
2 participants