VCS API Documentation

VCS: Visualization and Control System

Authors

Creator: Dean Williams (LLNL, AIMS Team)

Lead Developer: Charles Doutriaux (LLNL, AIMS Team)

Contributors: https://github.com/CDAT/cdat/graphs/contributors

Support Email: cdat-support@llnl.gov

Project Site: http://cdat.llnl.gov/

Project Repo: https://github.com/CDAT/cdat/graphs/contributors

Description

VCS is a visualization library for scientific data. It has a simple model for defining a plot, that is decomposed into three parts:

  1. Data: If it’s iterable, we’ll plot it… or at least try! Currently we support numpy arrays, lists (nested and not), and CDMS2 variables (there’s some special support for metadata from CDMS2 that gives some niceties in your plot, but it’s not mandatory).

  2. Graphics Method: We have a variety of plot types that we support out-of-the box; you can easily customize every aspect of them to create the effect that you’re looking for. If you can’t, we also support defining your own graphics methods, which you can share with other users using standard python infrastructure (conda, pip).

  3. Template: Templates control the appearance of everything that isn’t your data. They position labels, control fonts, adjust borders, place legends, and more. They’re very flexible, and give the fine-grained control of your plot that is needed for the truly perfect plot. Once you’ve customized them, you can also save them out for later use, and distribute them to other users.

exception vcs.VCSDeprecationWarning[source]
vcs.init(mode=1, pause_time=0, call_from_gui=0, size=None, backend='vtk', geometry=None, bg=None, display_target=None)[source]

Initialize and construct a VCS Canvas object.

Example

>>> import vcs
>>> portrait = vcs.init(size=.5) # Portrait of 1 width per 2 height
>>> letter = vcs.init(size="letter") # also accepts "usletter"
>>> a4 = vcs.init(size="a4")
>>> import vtk
>>> my_win = vtk.vtkRenderWindow() # To embed VCS in other applications
>>> embedded = vcs.init(backend=my_win)
>>> dict_init = vcs.init(geometry={"width": 1200, "height": 600})
>>> tuple_init = vcs.init(geometry=(1200, 600))
>>> bg_canvas = vcs.init(bg=True)
Parameters
  • size (float or case-insensitive str) – Aspect ratio for canvas (width / height)

  • backend (str, vtk.vtkRenderWindow) – Which VCS backend to use

  • geometry (dict or tuple) – Size (in pixels) you want the canvas to be.

  • bg (bool) – Initialize a canvas to render in “background” mode (without displaying a window

Param

display_target: A jupyterlab notebook target object in which to render vcs pictures (only works in jupyterlab), if you pass True will create a new one for you sidecar gets attached to Canvas and can be reused for other Canvases to share it. Pass “inline”, “off”, or “no” to disable the target feature

Returns

An initialized canvas

Return type

vcs.Canvas.Canvas