Closed stuhlmueller closed 7 years ago
I'm slowly (1) transitioning to use just viz
and (2) changing the auto layout choices.
So using viz
instead of viz.auto
works on your example, though it shows a colored bar chart instead of the colored matrix (the new behavior is to show a matrix when a bar chart would be too hard to read -- when each component has more than 5 levels)
viz
doesn't work either for me (running the code on agentmodels, which uses http://cdn.webppl.org/webppl-viz-0.7.10.js
).
Ah, I believe you're hitting a bug that was fixed in b7279208cbb470fa57498bfd44df7b44875b6638 -- try using the latest version on the cdn, webppl-viz-818a17e.js
Thanks, that worked. Is there any way to still get the colored matrix? For visualizing tic-tac-toe moves, it was a perfect fit.
For the moment, no, but I think fixing #23 will make the colored matrix possible again.
You'll have to manually pass in the vega spec, something like this:
viz.vegaLite(distribution,
{
data: {values: data},
mark: "text",
encoding: {
row: {field: 'x', type: 'nominal'},
column: {field: 'y', type: 'nominal'},
color: {field: 'prob', type: 'quantitative'},
text: {field: 'prob', type: 'quantitative'}
},
config: {mark: {applyColorToBackground: true}, numberFormat: ".1e",
scale: {textBandWidth: 40}
}
})
In a previous version of
webppl-viz
, this code resulted in a table with colored cells:Now, I get: