glue-viz / glue

Linked Data Visualizations Across Multiple Files
http://glueviz.org
Other
728 stars 152 forks source link

Highlighting dendrogram branch pixels only works with idx #1605

Open keflavich opened 6 years ago

keflavich commented 6 years ago

When I have a dendrogram catalog linked via the structure ID to the dendrogram file (including image), the structures selected in the plot only highlight in the image if one of the plot axes is the linked structure ID and you select on the structure ID; I believe this occurs because the structure ID selection is required to be sequential. This is not useful.

Examples: Good: image

bad: image

keflavich commented 6 years ago

This is likely a repeat of https://github.com/glue-viz/glue/issues/702

keflavich commented 6 years ago

So, this is very similar to #702, but much simpler. This case should just work, afaict. In this case, there is nothing special about sequential selections of _idx (or at least, there absolutely should not be)

battersbot commented 6 years ago

Commenting to second and follow this issue, which I am also having.

astrofrog commented 6 years ago

Just to check, did you set up the links yourself, or did glue do it automatically?

battersbot commented 6 years ago

We set up the links ourselves. Linking "structure" in the dendrogram file and the "_idx" column in our ipac table. And it does seem to work perfectly, but only when selecting on _idx explicitly and sequentially.

astrofrog commented 6 years ago

The default kind of linking in glue is such that only selections done along linked components work, hence the behavior you are seeing. There is another kind of link in glue not yet exposed through the GUI (but will be soon) which is a 'key join' which can be set up using the following method:

http://docs.glueviz.org/en/stable/api/glue.core.data.Data.html#glue.core.data.Data.join_on_key

See the docstring above for how this works.

However, note that normally if you are reading in a file produced by astrodendro, glue sets up links itself automatically using join_on_key so in principle you shouldn't have to do this and it should just work out of the box:

https://github.com/glue-viz/glue/blob/master/glue/plugins/dendro_viewer/data_factory.py#L109

If it doesn't, it's a bug :) Note that setting up links manually with the link editor will break this behavior and replace it with a sub-optimal link, which is what you are seeing.

keflavich commented 6 years ago

I don't think that second point is true for catalogs produced by astrodendro, is it?

(we're only interested in the catalog, not the dendrogram - the dendrogram is just the link from the catalog to the data)

astrofrog commented 6 years ago

@keflavich - ah yes good point, it doesn't work for the catalogs. Can you see if you can use join_on_key from the IPython terminal inside glue to get the behavior you want? I'll add a way to do this via the GUI soon.