1 | # ---------------------------------------------------------------------- |
---|
2 | # RAPPTURE OBJECT: histogram |
---|
3 | # |
---|
4 | # A histogram is like a curve but in bar chart form. Right now, it |
---|
5 | # is only used as an output, but it could become an input in the |
---|
6 | # future if we create an input editor for it. |
---|
7 | # |
---|
8 | # ====================================================================== |
---|
9 | # AUTHOR: Michael McLennan, Purdue University |
---|
10 | # Copyright (c) 2004-2011 Purdue Research Foundation |
---|
11 | # |
---|
12 | # See the file "license.terms" for information on usage and |
---|
13 | # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
14 | # ====================================================================== |
---|
15 | |
---|
16 | object histogram -extends base { |
---|
17 | palettes "Outputs" |
---|
18 | |
---|
19 | help http://rappture.org/wiki/rp_xml_ele_histogram |
---|
20 | |
---|
21 | attr xlabel -title "X-axis Label" -type string -path xaxis.label -tooltip "Label shown on the x-axis for the plot." |
---|
22 | |
---|
23 | attr xdesc -title "X-axis Description" -type string -path xaxis.description -tooltip "Description of the x-axis that appears in a tooltip window when you mouse over the x-axis. This should not merely repeat what the label says, but explain what it means." |
---|
24 | |
---|
25 | attr xunits -title "X-axis Units" -type units -path xaxis.units -tooltip "Units for the physical quantity that the x-axis represents." |
---|
26 | |
---|
27 | attr ylabel -title "Y-axis Label" -type string -path yaxis.label -tooltip "Label shown on the y-axis for the plot." |
---|
28 | |
---|
29 | attr ydesc -title "Y-axis Description" -type string -path yaxis.description -tooltip "Description of the y-axis that appears in a tooltip window when you mouse over the y-axis. This should not merely repeat what the label says, but explain what it means." |
---|
30 | |
---|
31 | attr yunits -title "Y-axis Units" -type units -path yaxis.units -tooltip "Units for the physical quantity that the y-axis represents." |
---|
32 | |
---|
33 | |
---|
34 | check xlabel { |
---|
35 | if {[string length [string trim $attr(xlabel)]] == 0} { |
---|
36 | return [list warning "Should set a label that describes the x-axis of this plot."] |
---|
37 | } |
---|
38 | } |
---|
39 | check xdesc { |
---|
40 | if {[string length [string trim $attr(xdesc)]] == 0} { |
---|
41 | return [list warning "Should include a description of what the x-axis represents, physical meaning, expected range, etc."] |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | check ylabel { |
---|
46 | if {[string length [string trim $attr(ylabel)]] == 0} { |
---|
47 | return [list warning "Should set a label that describes the y-axis of this plot."] |
---|
48 | } |
---|
49 | } |
---|
50 | check ydesc { |
---|
51 | if {[string length [string trim $attr(ydesc)]] == 0} { |
---|
52 | return [list warning "Should include a description of what the y-axis represents, physical meaning, expected range, etc."] |
---|
53 | } |
---|
54 | } |
---|
55 | } |
---|