source: trunk/instant/objects/histogram.rp @ 1728

Last change on this file since 1728 was 1728, checked in by mmc, 14 years ago

Initial version of the "instant rappture" gui builder. To run this,
just say "irappture" or "irappture -tool path/to/tool.xml". It will
bring up an editor that lets you specify inputs/outputs and preview
the tool.

Made two fixes along the way to the scroller, so that it handles
automatic scrollbars better, and to the grab stack, so that it avoids
pushing the same window on the grab stack twice. Both of these fixes
solved problems in iRappture, and they'll probably fix strange behaviors
in the main rappture as well.

File size: 2.0 KB
Line 
1object histogram -extends base {
2    palettes "Outputs"
3    help http://rappture.org/wiki/rp_xml_ele_histogram
4    attr xlabel -title "X-axis Label" -type string -path xaxis.label
5    attr xdesc  -title "X-axis Description" -type string -path xaxis.description
6    attr xunits -title "X-axis Units" -type units -path xaxis.units
7    attr ylabel -title "Y-axis Label" -type string -path yaxis.label
8    attr ydesc  -title "Y-axis Description" -type string -path yaxis.description
9    attr yunits -title "Y-axis Units" -type units -path yaxis.units
10
11    check label {
12        if {[string length [string trim $attr(label)]] == 0} {
13            return [list warning "Should set a label that describes this value."]
14        }
15    }
16    check description {
17        set desc [string trim $attr(description)]
18        if {[string length $desc] == 0} {
19            return [list warning "Should include a description of what this value represents, typical settings, etc."]
20        } elseif {[string equal $desc $attr(label)]} {
21            return [list warning "Description should be different from the label and give additional information about the value."]
22        }
23    }
24
25    check xlabel {
26        if {[string length [string trim $attr(xlabel)]] == 0} {
27            return [list warning "Should set a label that describes the x-axis of this plot."]
28        }
29    }
30    check xdesc {
31        if {[string length [string trim $attr(xdesc)]] == 0} {
32            return [list warning "Should include a description of what the x-axis represents, physical meaning, expected range, etc."]
33        }
34    }
35
36    check ylabel {
37        if {[string length [string trim $attr(ylabel)]] == 0} {
38            return [list warning "Should set a label that describes the y-axis of this plot."]
39        }
40    }
41    check ydesc {
42        if {[string length [string trim $attr(ydesc)]] == 0} {
43            return [list warning "Should include a description of what the y-axis represents, physical meaning, expected range, etc."]
44        }
45    }
46}
Note: See TracBrowser for help on using the repository browser.