Docs: Modifying scale of "multiple interactions" example and adding legend adjustments #3350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to modify the original "multiple interaction" example from the Altair-Vega documentation website in regard to the scale created with the checkbox condition for big budget films within the movies dataset. I had experimented with the example on my own to see how the Altair-Vega syntax worked when I realized that the quantitative scale for the alt.Size argument regarding a film's big budget designation wasn't fully accurate considering how the variable is entered. From what I read, the initial transformation in the chart creation creates a nominal scale between two categories of films, which can be labelled as "above $100 mil (big budget)" and "below $100 mil (not big budget)." However, the default scale being set to ':Q' for this variable means that the scale incorrectly assumes that the values of "100" and "10" (for big budget and non big-budget films respectively) are within a quantitative scale which then suggests to the viewer that it is displaying a continuous scale of films (via dot size) relative to production budget between $20 mil to $100 mil when the "Big Budget Films" box is checked.
I'm not sure if this is intentional to showcase how ':Q' automatically creates legend intervals when given any potential range of data, but if it is not I think it would be best to modify the scale and legend of this to be nominal in nature to clarify the purpose of the Big Budget Film checkbox. This modified version assigns '1' to films above $100 mil in budget and '0' for films vice versa so that, with a 0 -> 1 scale, alt.Scale will give a smaller mark size for lower-budget films before scaling up for big-budget films. I also include an example of how legends can be manually adjusted by adding a title and a defined range for mark size increase (from 25 to 150) between films below and above $100 mil.
Edit: As a small note, I forgot to re-add the intro text and comment for it being an interactive chart for the multiple interactions webpage so I re-added it via a 2nd and 3rd commit to this request. Hopefully that should be enough to correct that, this is my first pull request here so apologies for any errors I might have made doing so.