Add image-dot-chart-from-list#1863
Merged
Merged
Conversation
- Fix a few mistakes in charts.arr where the old rawarray-based methods were not working - Clean up redundant "type-checking" iterations in charts.arr, since the annotations are doing that in JS - Simplify image-num-dot-chart-from-list to simply compose image-dot-chart-from-list and the image-labels method - Same for labeled-num-dot-chart-from-list - Add image-dot-chart-from-list, and rewrote categoricalDotChart to handle image marks accordingly. Various examples: render-chart(from-list.dot-chart(species)).display() render-chart(from-list.dot-chart(species).labels(names)).display() render-chart(from-list.dot-chart(species).image-labels(images)).display() render-chart(from-list.dot-chart(species).labels(names).image-labels(images)).display() render-chart(from-list.dot-chart(fixeds.map(to-string)).labels(names).image-labels(images)).display() render-chart(from-list.image-dot-chart(images, species)).display() render-chart(from-list.image-dot-chart(images, species).labels(names)).display() render-chart(from-list.num-dot-chart(ages)).display() render-chart(from-list.num-dot-chart(ages).labels(names)).display() render-chart(from-list.num-dot-chart(ages).labels(names).image-labels(images)).display() render-chart(from-list.labeled-num-dot-chart(names, ages)).display() render-chart(from-list.labeled-num-dot-chart(names, ages).image-labels(images)).display() render-chart(from-list.image-num-dot-chart(images, ages)).display() render-chart(from-list.image-num-dot-chart(images, ages).labels(names)).display() render-chart(from-list.image-num-dot-chart(images, ages).point-size(40).use-image-sizes(false).labels(names)).display()
Joe says: I think this is a regression? The composition makes it so this test has a surprising result IMO. How much is the user supposed to think about sort orderings? Claude says: Adds a regression test that catches mis-pairing between images and categories in image-dot-chart-from-list. The same logical (image, category) bag rendered twice in different input orders should produce identical images, since dot-chart-from-list sorts categories internally and a categorical chart should depend only on the bag, not on input order. Each image is built with text(...) carrying its own category name, so a save-image of a failing run shows exactly which image landed under which column label. Currently fails on this branch: a scrambled-input render rotates each image one slot off its category. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Member
…ring
Joe says:
I think this is just a Vega config-format issue (thinko/typo in which kind of
update/signal goes in). I think these images should be different.
Claude says:
The two sizing settings must produce visibly different charts, since
use-image-sizes(true) means "use the image's natural dimensions" and
use-image-sizes(false) means "size them via the chart's dotSize
signal." If both render byte-identically, the false branch is a no-op.
Currently fails on this branch: the ImageMarks width/height encoding
uses {update: "..."} as a value reference, which is not valid Vega
encoding syntax (the standard form is {signal: "..."}), so Vega
silently ignores both width and height and falls back to natural
sizing in either mode. The dotsize/dotSize typo on the height line
is real but masked by this larger problem.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jpolitz
reviewed
May 1, 2026
| }), | ||
| })); | ||
| const counts = [...rawCounts.entries().map((kv) => ({ category: kv[0], count: kv[1] }))]; | ||
| debugger |
Member
|
The two tests I committed + the stray debugger are the full feedback I have, otherwise looks good! |
added 2 commits
May 1, 2026 13:10
moves the sorting into the Vega processing, rather than Pyret, so that the lists stay in order throughout Pyret's computation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Various examples: