-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Undefined data set name: "scale_concat_1_child_main" #4680
Comments
I did some more digging, and notably, this is part of the delta between the compiled vega definitions: @@ -401,7 +424,7 @@
{
"name": "concat_0_x",
"type": "band",
- "domain": {"data": "data_0", "field": "mu", "sort": true},
+ "domain": {"data": "data_2", "field": "mu", "sort": true},
"range": {"step": {"signal": "concat_0_x_step"}},
"paddingInner": 0.1,
"paddingOuter": 0.05
@@ -409,15 +432,27 @@
{
"name": "concat_0_y",
"type": "linear",
- "domain": {"data": "data_0", "field": "p"},
+ "domain": {"data": "data_2", "fields": ["p_start", "p_end"]},
"range": [{"signal": "concat_0_child_height"}, 0],
"nice": true,
"zero": true
},
+ {
+ "name": "concat_0_color",
+ "type": "linear",
+ "domain": {"data": "data_2", "field": "cum_p"},
+ "range": "ramp",
+ "interpolate": "hcl",
+ "zero": false
+ },
{
"name": "concat_1_x",
"type": "band",
- "domain": {"data": "data_3", "field": "mu", "sort": true},
+ "domain": {
+ "data": "scale_concat_1_child_main",
+ "field": "mu",
+ "sort": true
+ },
"range": {"step": {"signal": "concat_1_x_step"}},
"paddingInner": 0.1,
"paddingOuter": 0.05
@@ -425,7 +460,7 @@
{
"name": "concat_1_y",
"type": "linear",
- "domain": {"data": "data_3", "field": "mean_p"},
+ "domain": {"data": "scale_concat_1_child_main", "field": "mean_p"},
"range": [{"signal": "concat_1_child_height"}, 0],
"nice": true,
"zero": true
@@ -433,7 +468,10 @@
{
"name": "concat_1_color",
"type": "linear",
- "domain": {"data": "data_3", "field": "mean_c1_avg_cum_p"},
+ "domain": {
+ "data": "scale_concat_1_child_main",
+ "field": "mean_c1_avg_cum_p"
+ },
"range": "ramp",
"interpolate": "hcl",
"zero": false (these changes are all in the |
I could see two reasons for this issue. 1) we are not renaming the data field in assemble to be the correct reference or 2) we are accidentally deleting a required data source because the reference counter is not increased. It's probably 1. |
This also broke when I used a |
still digging, but commenting out this allowed it to work for me: vega-lite/src/compile/data/optimize.ts Lines 90 to 95 in 026abda
|
appears to be this mutator: vega-lite/src/compile/data/optimize.ts Line 57 in 026abda
without understanding, not sure where the appropriate place would be to trigger that the node isRequired() |
We do keep a reference count for outputs. If the count is 0, we remove it. We increase the reference counter every single time someone calls vega-lite/src/compile/data/dataflow.ts Line 179 in 026abda
Thank you for looking into this. You already narrowed down where the issue is by a lot. |
I got the same error with altair 3.2.0, when tried to hconcat() mark_bar()s, which already had facets from columns='...' pseudo code (not working):
Error: "Javascript Error: Undefined data set name: "scale_concat_1_child_main"" |
Thanks for the additional example. Could you export the json with to_json()? |
I'm experiencing the same error. Here is my minimal example (no Is anybody working on this issue? And is there a workaround? (The workaround not using |
I have a slightly more minimal example based on the one from @Sh4pe. What I have found is that the problem disappears if the two offending specs being concatenated are not consecutive. In this example I interject a 3rd spec in the middle which does not use the row or column channel. update: even more trivially and a better workaround is to interject the simplest spec I can imagine...
HTH |
Thank you @trubens71 for the small example. It'll make it easier for me to debug what's going on. |
As a short term fix, I note that if you add a:
to each part of the Note in some examples the transforms seem to have to be _different _ in each part of the vconcat here is an example |
I ran into this today and have been troubleshooting for a bit. I noticed that it only happens for concatenating charts using the same data source. When passing charts with different data sources, there are no issues. This is also why the filter workaround works, it creates two separate data sources in the compiled Vega spec. The reason it does not work with the same data source is that VegaLite for some reason passes a non-existing dataset name to Vega instead of reusing the name of the dataset used in the first concatenated chart. Here is an example of the compiled Vega from @trubens71 's example above: {
"name": "concat_0_y",
"type": "linear",
"domain": {"data": "data_2", "field": "a"},
"range": [{"signal": "concat_0_child_height"}, 0],
"nice": true,
"zero": true
},
{
"name": "concat_1_x",
"type": "linear",
"domain": {"data": "scale_concat_1_child_main", "field": "x"},
"range": [0, {"signal": "concat_1_child_width"}],
"nice": true,
"zero": false,
"padding": 5
}, The second entry is referencing a dataset name that doesn't exist and changing this to I would PR, but I am not sure where in VL this incorrect name is created and couldn't figure it out from looking briefly at the source, so happy for anyone else to do it, I just want to be able to concatenate faceted charts =) Additional workarounds to those mentioned is to reorder the dataset before passing it to VegaLite (e.g. in Altair) so that it is not recognized as the same dataset, or using a boxplot (which I think doesn't have this issue because it creates separate aggregated datasets). I believe a PR for this would also close #5475 and solve half of #5261. |
Is there anybody working on this? |
Not right now, no. |
I ran into this same issue today. I wanted these interactive histograms below the map (forgive the colors please) rather than above as they are in the screenshot. If I do
Here's the Observable notebook. |
I am trying to
hconcat
a faceted graph over two fields with a summary graph (summing across one of the fields). If I havecolor
set in the first chart, then I get the error listed in the title (Undefined data set name: "scale_concat_1_child_main"
).Broken code in Vega Editor
Working code in Vega Editor
The text was updated successfully, but these errors were encountered: