-
Within the starter Framework app with the launches dataset, I am trying to create a reactive plot based on user's filter selection. The following logic works to filter and display the table. const test_query = sql([`
SELECT * FROM launches
WHERE state IN ('--'${", ?".repeat(selectCountryTest.length)})
`], ...selectCountryTest); Inputs.table(test_query) However, the following code throws an error: vg.plot(
vg.barX(
vg.from(test_query),
{x: vg.count(), y: "family", fill: "#ccc", fillOpacity: 0.2}
),
vg.barX(
vg.from(test_query, {filterBy: $click}),
{x: vg.count(), y: "family", fill: "#ccc"}
),
vg.toggleY({as: $click}),
vg.highlight({by: $click}),
vg.xDomain(vg.Fixed),
vg.yDomain($domain),
vg.yLabel(null),
vg.colorDomain($domain),
vg.colorRange($colors),
vg.marginLeft(45),
vg.width(660)
) If I replace, test_query with "launches" in the above code block, then the plot renders, but doesn't react to a user's selection. The browser debugger reports the following error: "Uncaught (in promise) RuntimeError: index out of bounds" Is test_query not the right type for the Mosaic plot function? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
The arguments of |
Beta Was this translation helpful? Give feedback.
-
duplicate of uwdata/mosaic#559 |
Beta Was this translation helpful? Give feedback.
OK I see it now. That problem is discussed here and @mbostock shows a solution
#1598 (comment)
Adapting Mike's solution to the launches example:
However it's not going to be fully reactive. If 'United States' is selected with an i…