RiverWare Output Canvas: Tea Cup and Flow Animations: Functional Design
Phil Weinstein, David Neumann, CADSWES, 8-06-2014 -- Ready for Review -- See Project Index
This document presents a design for a new RiverWare "Output Canvas" output device which can be used to illustrate water storage levels and water flows over a period of time. The initial implementation supports the following graphical elements, including two animated components:
Subsequent development of the Output Canvas output device may provide additional graphical features, such as incorporation of RiverWare Plot Page and Pie Chart output devices. Output Canvases may eventually be deployable on the web. Those features are beyond the scope of this project.
The Output Canvas is a new RiverWare graphical output device. Existing graphical output devices include the Plot Page and Pie Chart. Similar to the Pie Chart device, the Output Canvas provides a timestep slider with animation controls to allow the user to move timestep-animatable items to different timesteps within a model data time range -- and to automatically step that timestep forward at a settable rate to present an animation or slide show.
![]() |
The Output Canvas output device is "workspace-like" in that it contains graphic objects which are selectable and draggable on top of an optional background image. In addition to the Tea Cup and Flow Line items described in detail in subsequent sections, the Output Canvas supports these graphical components and properties, similar to the existing support for these in the RiverWare Simulation Workspace View:
The Output Canvas has a configured size, in pixels. Zooming in or out is not supported. Scrollbars will be shown as needed (i.e. when the Output Canvas window is smaller than the configured size).
The locations of all graphical elements within the Output Canvas will generally be locked, but when unlocked, they can be dragged to a different location. This is supported with a "Lock item positions" checkbox.
Image Items can be created from basic image files (JPEG, PNG, GIF) and are saved (serialized) within the Output Canvas output device, generally contained within a RiverWare model file.
Image items support an adjustable opacity (0% to 100%). There is not explicit support for a particular "background image" (as there is with the Simulation View); all image items are drawn "under" the other three types of items described in this document. Partially transparent image items (less than 100% opacity) are effectively blended with the Output Canvas' configured background color.
Text Items can contain multiple lines of text with a single selectable color and font. Instead of picking a potentially unique font specification for each Text Item instance, the user defines three (3) Text Item Fonts within the Output Canvas from which one can be selected for any Text Item.
Text Items support several magic text strings which can be dropped in to the user supplied text in the Text Item Editor with push buttons or an action menu. These strings include:
*In a sense, this provision makes the Text Item an "animated" component which needs to be updated each time a new "reference timestep date/time" is set.
The user can also add a slot reference to a text item. The slot's value (at the Output Canvas' reference timestep) and display units can be included within the Text Item using these magic text strings:
Output Canvas configuration settings for the canvas' Tea Cups and Flow Lines are enumerated under the sections for those items (see below). Enumerated here are general configuration settings for both Image Items and Text Items:
In addition to those instance configuration settings, Output Canvas instances support the following persistent state information:
The Output Canvas can be exported as an image file (at a single reference timestep) or as an animated-image file. Supported still-image formats include PNG and JPEG. Image output dialog support is modeled on existing image export functions, for example, this dialog for exporting the workspace image:
![]() |
The configured dimensions of the Output Canvas can be used, or can be overridden.
Note: Animated-image file export will be supported with the MPEG, AVI, MNG or MOV file format, or something similar. None of the utility libraries we are currently using (including Qt) support any sort of movie-file generation, so we will need to investigate the available software tools. We may be able to make use of the FFmpeg, Libav, MEncoder, or GStreamer tools, but this will require some integration work.
Output Canvas still images can be included in RiverWare model reports. The model report contains a reference to a particular Output Canvas (output device) instance saved in the model file. The reference timestep date/time, image width, and image height of the Output Canvas can either be used, or overridden in the model report configuration. The following detail shows a Pie Chart model report item's configuration within a model report.
![]() |
The Output Canvas supports:
Note: See also the context menus on Tea Cup and Flow Lines, described below. Generally, those operations apply to the full selected set of items.
Two examples of water resource tea cup graphics are provided here to help devise a design for RiverWare Tea Cup items.
(2.1) California Dept. of Water ResourcesA visual tool on the California Department of Water Resources website provides a good example of the sort of Reservoir Tea Cup graphical element we would like to create. |
![]() |
|
![]() |
||
Source: http://cdec.water.ca.gov/cdecapp/resapp/getResGraphsMain.action |
This visually depicts these quantities:
The Tea Cup Item also includes these text / numeric items:
The full map image depicts "callouts" -- lines connecting the tea cup image to a particular point within the map. (We will not be implementing this feature).
Most reservoirs seem to share a common vertical (volume) scale. But some smaller-capacity reservoirs have a larger scale (e.g. see Pyramid Lake at the bottom of the graphic).
![]() |
Source: http://www.usbr.gov/pn/hydromet/burtea.html |
![]() |
The indicated flow ("cfs") text items are apparently independently placed (i.e. not implemented as part of the tea cup item).
Observation: this trapezoidal presentation is potentially ambiguous. Ostensibly storage volumes rather than pool elevations are depicted by the filled-in area. But it's not clear whether the height or the area of the filled-in area represents that volume. And certainly the height of that area doesn't accurately represent the pool elevation.
![]() CDWR Example |
|
![]() |
RiverWare Tea Cups are modeled primarily on the CDWR example presented above. They present:
Tea Cups are added to a Output Canvas on demand by the user. When adding a Tea Cup item, or any time thereafter, the user configures the item according to a tea cup configuration established for the Output Canvas. The following sections describe these configuration properties.
All Tea Cups within a particular Output Canvas have a common configuration. This configuration includes:
Each Tea Cup item supports the following configurable properties. Note that all slot or slot column references must have the unit type specified at the Output Canvas level (see above):
In addition to those instance configuration settings, tea cup instances support the following persistent state information:
"Flow Line" Output Canvas items convey the magnitude of a series' value at the canvas' reference timestep using line width, color and pattern. (Neither of the two reference examples above illustrate flow lines).
Generally, slots associated with Flow Lines have the flow unit type. But any single unit type can be used. This is configurable at the Output Canvas level. (All Flow Lines within a particular Output Canvas must have the same unit type).
A Flow Line has a reference to a single series slot (of the configured unit type) chosen by the user. The current magnitude of the element's series (at the reference timestep) will be depicted in two ways:
The current Flow Line value is shown as numeric text along the drawn line using a font defined at the Output Canvas for this purpose.
Either end of a Flow Line can be "snapped to" a Tea Cup Item or to the end of a different Flow Line or can be independently placed anywhere within the Output Canvas.
We will need to devise mouse interaction techniques for disambiguating the action associated with clicking and dragging a Tea Cup Item or a proximate Flow Line. Flow Lines will need two or three draggable "hot spots" for positioning -- one at either end, and possibly a third in the middle for geometric translation (moving) which could also "un-snap" the Flow Line from other items.
Flow Line items are added to a Output Canvas on demand by the user. When adding a Line Item, or any time thereafter, the user configures the item according to a line item configuration established for the Output Canvas. The following sections describe these configuration properties.
General Flow Line configuration for all Flow Lines in a Output Canvas includes:
Flow Line instance configuration settings include:
In addition to the instance configuration settings, Flow Line instances support the following persistent state information:
These dialogs support the editing of configuration information described in the various sections above.
--- (end) ---