USACE SWD 10: Design Documenting for Improved Plot Legend and Plot Layer Control
- Phil Weinstein, David Neumann, Edit Zagona, CADSWES, 3-26-2017. Ready for Review

(1) Legend and Plot Layer Control - Overview

The USACE SWD task 10 is to develop a design document detailing solutions for improved user control of plot displays. Desired enhancements include but are not limited to: 

  1. More control over placement and size of legend.
  2. Drag and drop capability for legends.
  3. A right click context menu "Curve Layer" (for example) on the legend with options to "Move to Top", "Move Up", "Move Down", and "Move to Bottom". This would affect the layering of the plots and the ordering of the legend.
  4. More interactivity for curves such as hover to highlight, click to bring forward.

This document proposes in the following feature areas, and provides technical development analysis.

Legend Presentation

Plot Features

(1.1) Legend Location

Currently in RiverWare, the Legend in shown at the bottom of each plot unconditionally. As requested, we investigated other options for legend location:

Top, Left, Right or None: It is relatively easy to add in any of the three locations outside of the plot area, Top, Left, and Right. It is also relatively easy to not show a legend.

Within the Plot Area: Within other plotting tools, you can show the legend on the plot area itself. It is possible to enhance the RiverWare plotting package to add this as an option, but would lose some of the interactivity of the legend. Although a simple context menu would be possible, it would not be possible to turn off the curve or drag the legend to re-order.  There are also limited locations within the plot area where the legend could exist: the four edges and the four corners, with an adjustible offset. This is still a relatively large task.

Label Curves instead of a legend: Instead of showing a legend it would be useful to label a curve. This is possible but is technically very challenging due to the zoom and translation that is possible on a plot. There would need to be many configuration options to show it in the correct place.  This is a large task.

(1.2) Legend Size

Legends take up a relatively large proportion of the plot. We investigated making the legend smaller. First, it would be possible to make fonts on the legend smaller. Technically, they can already be changed, but not on a per-plot basis. This functionality would need to be added. This is a medium task.

Spacing between legend items could be reduced a bit, either as just a fixed convention, or as a configurable option. This is a small task.

In Excel, you can resize the legend bounding box or move the legend items closer together. Resizing the legend like this is not possible, as far as we can tell.

(1.3) Legend Ordering: Drag and Drop of Legend Items

Adding Drag and Drop of legend items to reorder is possible only if a custom legend is implemented (LINK).

It is also possible to add drag and drop within the legend configuration and multiple plot curve configuration, but doing so would interfere with multiple selections that is currently standard. We could add modes or some other way to add this functionality if necessary.

(1.4) Legend Items as Checkboxes

Currently, you can click on a legend item and it acts as a push button. When depressed, the curve is hidden and the legend item is greyed out. When not depressed (i.e. happy), the curve is shown and the legend item appears enabled. Many tools use checkboxes as a similar feature. Checkboxes require less vertical space, but more horizontal space, than the current legend buttons. Presenting legend items as checkboxes would the implementation of a custom legend, which is a large task. But with that in place, providing an option to present legend items as checkboxes would be relatively straightforward.

The persistence of either push-button or checkbox settings can be enhanced to be saved from the edit dialog.

(1.5) Border around Legend

The rectangular border around a plot's legend is not necessarily desirable. We could provide an configuration option to optionally show or hide that border.

(1.6) Show Curve/Marker in Legend

Currently Curves are unconditionally shown in the legend. Markers can either be shown or not, but the setting applies to all markers on a plot. It is desirable to create a setting to allow the user to say that they don't want to show a particular curve in the legend. This is a relatively straightforward task.

(1.7) Hover to Highlight Curve

Many plotting utilities allow the user to hover or click on a particular curve and then get options associated with just that curve. In addition, ornamentation like a halo or highlight could be added. This is a large task but is possible. Once implemented, it would be relatively easy to add many options like Open Slot or Move to Top Layer.

(1.8) Layer Control

Currently, the drawing layer, i.e. which curve is drawn on top, is tied to the legend order. We propose to break this out and allow user configuration. This would be presented and configured in the same location as the legend order. But, additional options would be added to right click on a legend and tell a curve to "Move Up", "Move to Top", "Move Down", "Move to Bottom." This is relatively small task.

(1.9) Markers without Lines

Markers must currently show a line along with a label. It may be useful to show the marker label (at the specified X and Y value) without showing a line. This is a small task.

--- (end) ---