-
Hi - In a complex plot we're building up we'd like to reuse the same spec as a layer in multiple views concatenated together in an outer plot. The docs suggests this might be possible, and works fine for concatenation but I get an error "Error: LayerView accepts only unit or layer specs as children!" I'm trying something like:
Does importing a spec into a layer, rather than in a concat, break some assumptions in GenomeSpy? The alternative approach is just to copy the same layer config into each spec, resulting in a bit of redundancy, but not the end of the world. Thanks for any pointers or suggestions on how to work around this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Ah, layer views can have only units (i.e., marks) or other layers as its children. It makes no sense to have, for example, concatenation as one of the layers. I think the main problem in having imported layers is difficulty in validating the view hierarchy. Currently a view specification is converted into a view hierarchy in the constructors of the View classes (e.g.., View, LayerView, UnitView, ...). When there's Maybe the current behavior could be relaxed a bit. I'm anyway not satisfied with the current implementation because there are some typing issues (I'm using typescript through JSDoc tags), and parametrised imports should be implemented at some point: #56 |
Beta Was this translation helpful? Give feedback.
-
Btw, this should work now. I'm using the following: "spec": {
"title": "Genomic data",
"resolve": {
"scale": { "color": "independent", "fill": "independent" }
},
"layer": [
{ "import": { "url": "cnv-segments.json" } },
{ "import": { "url": "short-variants.json" } }
]
} And it's now possible to do (some) parameterization: https://genomespy.app/docs/grammar/import/#repeating-with-named-templates |
Beta Was this translation helpful? Give feedback.
Btw, this should work now.
I'm using the following:
And it's now possible to do (some) parameterization: https://genomespy.app/docs/grammar/import/#repeating-with-named-templates