Merge pull request #97 from astrofrog/fix-api-links-docstrings

Internal class references on doc pages should be links
better type and dimension checking for indices in structure_at
Merge pull request #98 from keflavich/structure_at_indexing

Minor change: check type of index before using it
Implemented multiple selections, linked scatterplot views.

Intermediate attempt to get multiple selections working. The dictionary checking doesn't work yet (i.e. this is completely dysfunctional) but moving in the right direction I hope

Intermediate commit.

Coloring the tree is starting to shape up (although I haven't tried multiple colors yet), but drawing contours on the map is still tricky because of the way they implemented the contour-updating code. But I think that my dict-based approach should still pan out. We'll have to think a little more carefully about this shit.

Properly remove items from dictionary rather than just setting them to None.

Rejiggering how to update contours. Intermediate commit, because some things work but other things don't.

Multiple color handling implemented with a default dict.

Seems to work generally.

Added in some important comments.

Changed signature of select, remove_contour so that `input_key` is an arg not kwarg.

Updated all users of those methods to comply with new signature.

Finally it works! (for mouse-based input buttons 1,2,3)

Selections work between clicking the map AND clicking the dendrogram!

This was a weird one-line fix from the previous version so whatevs, you know?

Future upgrades: making the dictionary keys not based on button clicks, but, like, a palette of some kind (a la IDL cloudviz). It would be fairly straightforward to replace all the places where we ask for event.button with self.current_palette_choice (or something like that). We'd have to build a little UI that lets you play with the palette choice dudes, probably by clicking. Would we also want to build color selection into that? i hope not.

Updated default color selections to yellow/orange/magenta. They play well on black.

Renamed update_contour to update_contours; removed some fluff comments.

Fixed the bug where ALL contours would get removed if you picked an invalid spot on the map.

Now only the contour you were trying to select will get removed; the still-valid ones will remain.

I resurrected the remove_contour() method for this. We still have a use for it.

Cleaned up the code in update_contours() -- removed some redundant assignment & checking.

better type and dimension checking for indices in structure_at

Removed the code for key presses in select_from_map and mpl_connect.

Removed the flag to check what type of Event in select_from_map.

Now it matches line_picker.

Removed print statements from line_picker and select_from_map.

better type and dimension checking for indices in structure_at

Addressed most of Chris's suggested revisions:

- colorbrewer colors
- dendrograms now black not blue
- selected trees now opaque not alpha=0.5
- input_key renamed to selection_id where appropriate
- note added that dict keys are button event IDs

Some other changes (zorder on new click, multiple Selected Structure displays) not yet included.

(mostly) Base code that Chris gave me for starting out.

Implemented my half of the deal, partly.

Make SelectionHub to decentralize structure selection in the viewer

Conflicts:
	astrodendro/viewer.py

I did a lot of code massaging by hand because my edits and Chris's had diverged or something.

DendroScatter works, mostly! Selecting dendrogram/map structs highlights the scatter plot appropriately.

Got the dendro_scatter to update properly even when you "deselect" certain colors by clicking on "blank" areas of the map.

Still buggy: when a contour (say, red) isn't the current one, and you click on a "blank" area of the map (using the blue click button) then the red contour gets redrawn unneccessarily.

Finally fixed the bugs with multiple selections & hubs.

Now we set zorder=structure.height everywhere things get plotted.

Implemented multiple "Selected Structure: " labels, in corresponding colors.

Moved remove_all_contours() calls inside update_contours.
Merge branch 'multiple_selections_linked_scatter_rebased' of github.com:tomr-stargazer/astrodendro into multiple_selections_linked_scatter_rebased