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
Add support for selections to st.altair_chart
& st.vega_lite_chart
#8302
Conversation
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Outdated
Show resolved
Hide resolved
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Show resolved
Hide resolved
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.
It's a big PR and we have chatted offline about the fact that it would make sense to migrate the class component to a functional one and in general clean it up and refactor it more. Though, that can be a follow-up.
st.altair_chart
& st.vega_lite_chart
st.altair_chart
& st.vega_lite_chart
@@ -236,7 +236,7 @@ def _test_shift_click_point_selection_scatter_chart_displays_selection( | |||
app.wait_for_timeout(100) | |||
|
|||
expected_prefix = "Scatter chart with selection_point:" | |||
expected_selection = "\\{'select': \\{'param_1': \\[\\{'Origin': 'USA', 'Horsepower': 88, 'Miles_per_Gallon': 20\\.2\\}, \\{'Origin': 'USA', 'Horsepower': 110, 'Miles_per_Gallon': 18\\.6\\}, \\{'Origin': 'USA', 'Horsepower': 150, 'Miles_per_Gallon': 14\\}, \\{'Origin': 'Japan', 'Horsepower': 52, 'Miles_per_Gallon': 32\\.8\\}\\]\\}\\}" | |||
expected_selection = "\\{'select': \\{'param_1': \\[\\{'Origin': 'USA', 'Horsepower': (88|90), 'Miles_per_Gallon': 20\\.2\\}, \\{'Origin': 'USA', 'Horsepower': 110, 'Miles_per_Gallon': 18\\.6\\}, \\{'Origin': 'USA', 'Horsepower': 150, 'Miles_per_Gallon': 1(4|5)\\}, \\{'Origin': 'Japan', 'Horsepower': 52, 'Miles_per_Gallon': 32\\.8\\}\\]\\}\\}" |
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.
@raethlein We could also just check if there is any number in the value. I think for the test it doesn't really matter what kind of number is in there ... we just want to make sure that selecting an area works and returns an area selection.
Changes to the vega rendering might also easily apply small rendering changes so that the same selection leads to slightly different areas.
Describe your changes
Adds selection support to
st.altair_chart
andst.vega_lite_chart
that can be used via:GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.