Vvidget Code Reference Manual

Vvidget Code > Dictionary > Perspective Surface Chart

This section explains how to form a dictionary for a Perspective Surface Chart such as this:

Rectilinear Perspective Surface Chart
Example

A perspective surface chart is a sequence of transformed scalars positioned on a regular x-y grid and given z-values that are the value of those scalars. Then those values are used to interpolate a surface over the regular grid. Finally, a color can be applied to the surface to represent a different dimension. The specifics are determined by the template configuration which is a Vvidget Builder document. The Vvidget Builder manual explains those issues in more detail.

For more data exploration and layout the graph can be exported to Vvidget Builder where it can be rotated in realtime.

An example code fragment illustration follows:

/* Start of Illustration Code Fragment */

[constructor VC_append_key:"chart_type" string_value:@"perspective surface"];
[constructor VC_append_key:"chart_subtype" string_value:@"linear"];
[constructor VC_append_key:"chart_format_type" string_value:@"default"];
[constructor VC_append_key:"title" string_value:@"My Title"];
[constructor VC_append_key:"x_title" string_value:@"My X Title"];
[constructor VC_append_key:"y_title" string_value:@"My Y Title"];
[constructor VC_append_key:"z_title" string_value:@"My Z Title"];
[constructor VC_append_key:"grid_x_length" string_value:@"5"];
[constructor VC_append_key:"grid_x_minimum" string_value:@"1.0"];
[constructor VC_append_key:"grid_x_maximum" string_value:@"5.0"];
[constructor VC_append_key:"grid_y_length" string_value:@"5"];
[constructor VC_append_key:"grid_y_minimum" string_value:@"1.0"];
[constructor VC_append_key:"grid_y_maximum" string_value:@"3.0"];
[constructor VC_append_key:"color_map_1_type" string_value:@"1"];
[constructor VC_append_key:"color_map_2_type" string_value:@"1"];
[constructor VC_append_key:"color_map_1_length" string_value:@"32"];
[constructor VC_append_key:"color_map_2_length" string_value:@"32"];
[constructor VC_append_key:"color_map_rgb_11" string_value:@"FF0000FF"];
[constructor VC_append_key:"color_map_rgb_12" string_value:@"FFFFFFFF"];
[constructor VC_append_key:"color_map_rgb_21" string_value:@"FFFFFFFF"];
[constructor VC_append_key:"color_map_rgb_22" string_value:@"0000FFFF"];
[constructor VC_append_key:"data_values" string_value:@"1.0 2.0 3.0 4.0 5.0 1.1 2.1 3.1 4.1 5.1 1.2 2.2 3.8 4.2 5.2 1.3 2.3 3.3 4.3 5.3 1.4 2.4 3.4 4.4 5.0"];

/* End of Illustration Code Fragment */

The code fragment above can be inserted into the illustration code section of the Illustration project for an immediate running Cocoa application. For additional information consult the Illustration section.

The following table defines the dictionary key and value pairs:

Chart Specific Entries
KeyValue Description
chart_type¹The string perspective surface, indicating a Perspective Surface Chart.
chart_subtype¹The string linear.
chart_format_type¹The string default.
titleThe main title of the graph. If this key is not present then the template's title is used.
x_titleThe x title of the graph. If this key is not present then the template's x-title is used.
y_titleThe y title of the graph. If this key is not present then the template's y-title is used.
z_titleThe z title of the graph. If this key is not present then the template's z-title is used.
grid_x_lengthThe number of grid cells in the x-direction.
grid_x_minimumThe minimum x-value of the grid.
grid_x_maximumThe maximum x-value of the grid.
grid_y_lengthThe number of grid cells in the y-direction.
grid_y_minimumThe minimum y-value of the grid.
grid_y_maximumThe maximum y-value of the grid.
color_map_1_typeThe color mapping type (0, 1, 2, 3).
color_map_1_lengthNumber of colors in map 1.
color_map_rgb_11Beginning color of the color mapping.
color_map_rgb_12Ending color of the color mapping.
color_map_2_typeThe color mapping type (0, 1, 2, 3).
color_map_2_lengthNumber of colors in map 2.
color_map_rgb_21Beginning color of the color mapping.
color_map_rgb_22Ending color of the color mapping.
templatesA custom Templates directory.
data_valuesA white space delimited list of values representing the z-values of the grid matrix. See Data Oriented keys for additional information and keys.

¹ Do not include this key value pair in the Interface Builder Plugin Inspector input string. It is included for you automatically.

If you incorporate this functionality into your own application then please consult Cocoa Programming. If you incorporate this functionality into CLI scripts then please consult Script Programming.

You can also modify the following Templates:

Template Document Names
TemplateDescription
PVST_Perspective_Surface_ChartForms the static attributes for the chart.

Grid Definition

The value for the key data_values is a list of numbers (a string representation) each number delimited by a blank which is mapped onto a regular grid in the normal way in an x-contiguous fashion. That is, lets say there are "n" z-values:

z1 z2 z3 ... zn

On a grid with definitions and relationships:

nxThe number of z-values in the x-direction (the value of the key grid_x_length)
nyThe number of z-values in the y-direction (the value of the key grid_y_length)
nMust equal nx ny
xminThe value of the key grid_x_minimum
xmaxThe value of the key grid_x_maximum
yminThe value of the key grid_y_minimum
ymaxThe value of the key grid_y_maximum
Δx= (xmax - xmin)/(nx - 1)
Δy= (ymax - ymin)/(ny - 1)
iThe index of the i-th element in the list of z-values (starting at 1)
jThe index of the j-th z-value in the x-direction (starting at 1)
kThe index of the k-th z-value in the y-direction (starting at 1)
i = (k-1) ny + j

then for the z-value zj,k (which is zi = z(k-1) ny + j) the x and y values are defined as:

xj = xmin + Δx (j - 1)

yk = ymin + Δy (k - 1)

to form the triplet (3D point): {xj, yk, zj,k}

which is to say that "successive z-values are ordered in a x-contiguous way on a regular grid in the x and y direction" and the units in the x and y direction are specified by separate parameters (xmin, xmax, ymin, ymax).

Please help improve this documentation. If a section is hard to understand, there is a typo, you would like a new section added, or you detect any other improvement that can be made then please email support@vvi.com with your information.




© Copyright 1993-2011 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.