DynamicGravitySystems / DGP

Dynamic Gravity Processor
http://dgp.readthedocs.io/en/develop/
Apache License 2.0
7 stars 4 forks source link

ENH: Allow selection of data series/lines to plot. #36

Closed bradyzp closed 6 years ago

bradyzp commented 6 years ago

Issue: Currently we plot only a default set of data series in our three plot areas: Gravity, Long/Cross, and Eotvos correction.

To improve functionality we need to provide users with a means to select other channels to plot versus each other in a selected sub-plot. Previously this had been accomplished using a list of channels with check-boxes, allowing the user to select the check box to plot it on the chart.

I feel this solution is rather inelegant however, as we have multiple plots, there needs to be an easy way to select which plot the data will be plotted in.

Idea 1 Use the check-box method described above, with a drop down box to allow the user to select which chart to plot on. It is unfeasible at this time to allow plot selection by clicking on the plot, as we use this to trigger a flight-line selection (though we may add a toggle-able mode to turn this functionality on/off).

Idea 2

cbertinato commented 6 years ago

I think that something along the lines of idea 2 would be most feasible. Even if drag-and-drop turns out to be tricky to implement, we could probably start with a list of channels and perhaps use a double-click or context menu to add and/or delete plots.

bradyzp commented 6 years ago

Agreed, I'll start working on modularizing the plotting code to make it easier to add/remove lines on demand in order to implement this feature.

Drag-and-drop will hopefully be feasible, I'm working on a prototype to see if it will be able to work with the matplotlib canvas directly, or if we need to think of some other method for graphically selecting plot-lines. Can possibly use mpl's 'button_release_event' in the axes which will then query Qt to see what was being dragged.

bradyzp commented 6 years ago

Next commit will have almost working implementation - using a tree view to allow drag-n-drop of channels to different plots. Need to update the TreeView stylesheet, both for the plot selection and project view - as it was never really finished, just a rough implementation.

Issue: Gravity and GPS have a field with the same name (long) i.e. long acceleration and long(itude) which leads to some confusion on the plot. Possible resolution is to prefix the labels with the data source e.g. '\<gps>long' or '\<grav>long'

cbertinato commented 6 years ago

I would not be opposed to using the full word for longitude in this case (and latitude as well for consistency).

bradyzp commented 6 years ago

Closing this issue as functionally complete for initial release. Further improvements/features will be added to later branches/issues.

bradyzp commented 6 years ago

Re-opening to continue development on model/view class to better support drag-n-drop, and to limit plots to 2 channels so that we can implement a dual Y scale.