-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compute pagination after applying scales (#593)
This PR changes the pagination mechanism. Before, layers were converted to processed layers, and those were then split apart based on their input data. The problem with that approach was that it made each page independent of the others. This can be seen in this MWE: ```julia df = (x = 1:4, y = 1:4, page = [1, 1, 2, 2], color = ["A", "B", "C", "D"]) spec = data(df) * mapping(:x, :y, color = :color, layout = :page => nonnumeric) * visual(Scatter, markersize = 30) draw(spec) ``` <img width="533" alt="image" src="https://github.com/user-attachments/assets/9e633871-e245-4259-a693-33f31f28dd38" /> When we split this into two pages, we get this on master: <img width="531" alt="image" src="https://github.com/user-attachments/assets/98734dc4-350b-4fba-86c7-d50095f9174f" /> <img width="534" alt="image" src="https://github.com/user-attachments/assets/0e5eabfc-1ee4-4496-b9fe-55dc8dbf4a46" /> Both A & C and B & D share the same color in the legend because each page has separately computed categorical scales. (This problem does not appear if all pages have the same categories, but that's not something to generally rely on.) With this PR, the pages reflect the original colors from the full plot, and the legend also lists all categories on both pages. <img width="528" alt="image" src="https://github.com/user-attachments/assets/8bfa44e2-ec70-4be1-bc0a-c51b16bde1b8" /> <img width="542" alt="image" src="https://github.com/user-attachments/assets/8d3ce90d-113d-4aab-a144-7a077ae70c84" /> In case there are lots of categories that crowd the legend, it might be possible in the future to remove the legend entries for categories that don't appear on a given page, while still keeping the overall colorscheme intact.
- Loading branch information
1 parent
4a289d6
commit 98a216b
Showing
25 changed files
with
326 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.