File: List

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (27 lines) | stat: -rw-r--r-- 959 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Import the data file, in which the field has 2 attributes attached to it.

data = Import("datawithattribute.dx");
// Show the connections of the field and autocolor them
connections = ShowConnections(data);
colored = AutoColor(connections);
// Create a camera
camera = AutoCamera(colored,"off-front");

// extract the attributes.  "date" was the user-defined name for the date
// attribute in the data file, and "source" was the user-defined name for
// the source of the data. The returned values in attrdate and attrsource
// are strings. 
//
// The attributes can be used to caption the image.
attrdate = Attribute(data,"date");
attrsource = Attribute(data,"source");

attrsource = Format("data source: %s", attrsource);

attributelist = List(attrdate, attrsource);
caption = Caption(attributelist);

// Collect the caption with the image and Display.
colored = AutoAxes(colored,camera);
collected = Collect(caption,colored);
Display(collected,camera);