Skip to content

Commit

Permalink
Allow adding Plotly toolbar buttons (streamlit#9190)
Browse files Browse the repository at this point in the history
## Describe your changes

This PR fixes an issue where the configuration of `modeBarButtonsToAdd`
for the plotly toolbar was not respected.

## GitHub Issue Link (if applicable)

- Closes streamlit#9134

## Testing Plan

- Added e2e test.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
  • Loading branch information
lukasmasuch authored Aug 1, 2024
1 parent 36cdba6 commit 0ed880a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion e2e_playwright/st_plotly_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
use_container_width=True,
theme="streamlit",
# Also test custom toolbar modification:
config={"modeBarButtonsToRemove": ["zoom"]},
config={"modeBarButtonsToRemove": ["zoom"], "modeBarButtonsToAdd": ["drawline"]},
)

# Candlestick Chart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ export function PlotlyChart({
}
},
},
...(config.modeBarButtonsToAdd ?? []),
]
}

Expand Down

0 comments on commit 0ed880a

Please sign in to comment.