Changeset 64


Ignore:
Timestamp:
Sep 25, 2005 12:40:17 PM (19 years ago)
Author:
mmc
Message:

Lots of fixes for app-pntoy and other tools:

  • Fixed plotting to recognize "-color name" in the style section, and to use auto colors for overlayed plots.
  • Fixed x-y plotting to keep axes instead of resetting when flipping back and forth between plots.
  • Fixed 1D fields to support new lin/log limits queries, so it plots properly.
  • Added support for <string> output values.
  • Fixed molecular viewer so that 3D rotation is unconstrained and more intuitive.
  • Fixed Rappture::exec to handle newlines properly. Sometimes output would get all mixed together without newlines. Works better now.
Location:
trunk/gui
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/driver

    r56 r64  
    143143# OUTPUT AREA
    144144# ----------------------------------------------------------------------
    145 $win.pager insert end -name analyzer -title "Run"
     145$win.pager insert end -name analyzer -title "Simulate"
    146146set f [$win.pager page analyzer]
    147147$win.pager page analyzer -command [list $f.analyze simulate -ifneeded]
  • trunk/gui/scripts/analyzer.tcl

    r50 r64  
    398398                _autoLabel $xmlobj output.$item "Output Log" counters
    399399            }
     400            string* {
     401                _autoLabel $xmlobj output.$item "String" counters
     402            }
    400403            curve* - field* {
    401404                _autoLabel $xmlobj output.$item "Plot" counters
     
    636639    set page [$itk_component(resultselector) translate $page]
    637640    if {$page != ""} {
     641        blt::busy hold [winfo toplevel $itk_component(hull)]; update idletasks
    638642        $itk_component(resultpages) current $page
    639643
     
    641645        $f.rviewer plot clear
    642646        eval $f.rviewer plot add $_plotlist
     647        blt::busy release [winfo toplevel $itk_component(hull)]
    643648    }
    644649}
  • trunk/gui/scripts/color.tcl

    r13 r64  
    3535    }
    3636
     37    return [Rappture::color::HSVtoRGB $h $s $v]
     38}
     39
     40# ---------------------------------------------------------------------
     41# USAGE: brightness_min <color> <min>
     42#
     43# Used to make sure a color is not too dim.  If the value is less
     44# than the <min>, then it is capped at that value.  That way, the
     45# return color shows up against black.
     46# ----------------------------------------------------------------------
     47proc Rappture::color::brightness_min {color min} {
     48    foreach {h s v} [Rappture::color::RGBtoHSV $color] { break }
     49    if {$v < $min} {
     50        set v $min
     51    }
     52    return [Rappture::color::HSVtoRGB $h $s $v]
     53}
     54
     55# ---------------------------------------------------------------------
     56# USAGE: brightness_max <color> <max>
     57#
     58# Used to make sure a color is not too dim.  If the value is less
     59# than the <min>, then it is capped at that value.  That way, the
     60# return color shows up against black.
     61# ----------------------------------------------------------------------
     62proc Rappture::color::brightness_max {color max} {
     63    foreach {h s v} [Rappture::color::RGBtoHSV $color] { break }
     64    if {$v > $max} {
     65        set v $max
     66    }
    3767    return [Rappture::color::HSVtoRGB $h $s $v]
    3868}
  • trunk/gui/scripts/contourresult.tcl

    r50 r64  
    292292itcl::body Rappture::ContourResult::add {dataobj {settings ""}} {
    293293    array set params {
    294         -color black
     294        -color auto
    295295        -width 1
    296296        -linestyle solid
     
    303303        }
    304304        set params($opt) $val
     305    }
     306    if {$params(-color) == "auto" || $params(-color) == "autoreset"} {
     307        # can't handle -autocolors yet
     308        set params(-color) black
    305309    }
    306310
  • trunk/gui/scripts/exec.tcl

    r43 r64  
    2929    set execout ""
    3030    eval blt::bgexec control \
     31        -keepnewline yes \
    3132        -onoutput {{::Rappture::_exec_out stdout}} \
    3233        -onerror {{::Rappture::_exec_out stderr}} \
  • trunk/gui/scripts/field.tcl

    r17 r64  
    180180# axis.
    181181# ----------------------------------------------------------------------
    182 itcl::body Rappture::Field::limits {axis} {
    183     foreach val {xmin xmax ymin ymax zmin zmax vmin vmax} {
    184         set results($val) ""
    185     }
     182itcl::body Rappture::Field::limits {which} {
     183    set min ""
     184    set max ""
     185
     186    blt::vector create tmp zero
    186187    foreach comp [array names _comp2dims] {
    187188        switch -- $_comp2dims($comp) {
    188189            1D {
    189                 foreach {xv yv} $_comp2xy($comp) break
    190 
    191                 $xv variable x
    192                 set lims(xmin) $x(min)
    193                 set lims(xmax) $x(max)
    194 
    195                 set lims(ymin) 0
    196                 set lims(ymax) 0
    197                 set lims(zmin) 0
    198                 set lims(zmax) 0
    199 
    200                 $yv variable v
    201                 set lims(vmin) $v(min)
    202                 set lims(vmax) $v(max)
     190                switch -- $which {
     191                    x - xlin { set pos 0; set log 0; set axis xaxis }
     192                    xlog { set pos 0; set log 1; set axis xaxis }
     193                    y - ylin - v - vlin { set pos 1; set log 0; set axis yaxis }
     194                    ylog - vlog { set pos 1; set log 1; set axis yaxis }
     195                    default {
     196                        error "bad option \"$which\": should be x, xlin, xlog, y, ylin, ylog, v, vlin, vlog"
     197                    }
     198                }
     199
     200                set vname [lindex $_comp2xy($comp) $pos]
     201                $vname variable vec
     202
     203                if {$log} {
     204                    # on a log scale, use abs value and ignore 0's
     205                    $vname dup tmp
     206                    $vname dup zero
     207                    zero expr {tmp == 0}            ;# find the 0's
     208                    tmp expr {abs(tmp)}             ;# get the abs value
     209                    tmp expr {tmp + zero*max(tmp)}  ;# replace 0's with abs max
     210                    set vmin [blt::vector expr min(tmp)]
     211                    set vmax [blt::vector expr max(tmp)]
     212                } else {
     213                    set vmin $vec(min)
     214                    set vmax $vec(max)
     215                }
     216
     217                if {"" == $min} {
     218                    set min $vmin
     219                } elseif {$vmin < $min} {
     220                    set min $vmin
     221                }
     222                if {"" == $max} {
     223                    set max $vmax
     224                } elseif {$vmax > $max} {
     225                    set max $vmax
     226                }
    203227            }
    204228            2D - 3D {
    205229                foreach {xv yv} $_comp2vtk($comp) break
    206 
    207                 foreach {lims(xmin) lims(xmax)} [$xv limits x] break
    208                 foreach {lims(ymin) lims(ymax)} [$xv limits y] break
    209                 foreach {lims(zmin) lims(zmax)} [$xv limits z] break
    210                 foreach {lims(vmin) lims(vmax)} [$yv GetRange] break
    211             }
    212         }
    213         foreach val {xmin ymin zmin vmin} {
    214             if {"" == $results($val) || $lims($val) < $results($val)} {
    215                 set results($val) $lims($val)
    216             }
    217         }
    218         foreach val {xmax ymax zmax vmax} {
    219             if {"" == $results($val) || $lims($val) > $results($val)} {
    220                 set results($val) $lims($val)
    221             }
    222         }
    223     }
    224     return [list $results(${axis}min) $results(${axis}max)]
     230                switch -- $which {
     231                    x - xlin - xlog {
     232                        foreach {vmin vmax} [$xv limits x] break
     233                        set axis xaxis
     234                    }
     235                    y - ylin - ylog {
     236                        foreach {vmin vmax} [$xv limits y] break
     237                        set axis yaxis
     238                    }
     239                    z - zlin - zlog {
     240                        foreach {vmin vmax} [$xv limits z] break
     241                        set axis zaxis
     242                    }
     243                    v - vlin - vlog {
     244                        foreach {vmin vmax} [$yv GetRange] break
     245                        set axis vaxis
     246                    }
     247                    default {
     248                        error "bad option \"$which\": should be x, xlin, xlog, y, ylin, ylog, v, vlin, vlog"
     249                    }
     250                }
     251            }
     252        }
     253        if {"" == $min} {
     254            set min $vmin
     255        } elseif {$vmin < $min} {
     256            set min $vmin
     257        }
     258        if {"" == $max} {
     259            set max $vmax
     260        } elseif {$vmax > $max} {
     261            set max $vmax
     262        }
     263    }
     264    blt::vector destroy tmp zero
     265
     266    set val [$_field get $axis.min]
     267    if {"" != $val && "" != $min} {
     268        if {$val > $min} {
     269            # tool specified this min -- don't go any lower
     270            set min $val
     271        }
     272    }
     273
     274    set val [$_field get $axis.max]
     275    if {"" != $val && "" != $max} {
     276        if {$val < $max} {
     277            # tool specified this max -- don't go any higher
     278            set max $val
     279        }
     280    }
     281
     282    return [list $min $max]
    225283}
    226284
  • trunk/gui/scripts/meshresult.tcl

    r50 r64  
    132132itcl::body Rappture::MeshResult::add {dataobj {settings ""}} {
    133133    array set params {
    134         -color black
     134        -color auto
    135135        -brightness 0
    136136        -width 1
     
    143143        }
    144144        set params($opt) $val
     145    }
     146    if {$params(-color) == "auto" || $params(-color) == "autoreset"} {
     147        # can't handle -autocolors yet
     148        set params(-color) black
    145149    }
    146150
  • trunk/gui/scripts/moleculeViewer.tcl

    r54 r64  
    6666    protected method _zoom {option}
    6767    protected method _move {option x y}
    68     protected method _3dView {theta phi}
     68    protected method _3dView {theta phi psi}
    6969    protected method _color2rgb {color}
    7070
     
    120120    set _view(theta) 0
    121121    set _view(phi) 0
     122    set _view(psi) 0
    122123
    123124    itk_component add controls {
     
    344345        reset {
    345346            $this-ren ResetCamera
    346             _3dView 45 45
     347            _3dView 45 45 0
    347348        }
    348349    }
     
    367368            set _click(theta) $_view(theta)
    368369            set _click(phi) $_view(phi)
     370            set _click(psi) $_view(psi)
    369371        }
    370372        drag {
     
    377379                    return
    378380                }
    379                 set dx [expr {double($x-$_click(x))/$w}]
    380                 set dy [expr {double($y-$_click(y))/$h}]
     381
     382                if {[catch {
     383                    # this fails sometimes for no apparent reason
     384                    set dx [expr {double($x-$_click(x))/$w}]
     385                    set dy [expr {double($y-$_click(y))/$h}]
     386                }]} {
     387                    return
     388                }
    381389
    382390                #
    383391                # Rotate the camera in 3D
    384392                #
     393                if {$_view(psi) > 90 || $_view(psi) < -90} {
     394                    # when psi is flipped around, theta moves backwards
     395                    set dy [expr {-$dy}]
     396                }
    385397                set theta [expr {$_view(theta) - $dy*180}]
    386                 if {$theta < 2} { set theta 2 }
    387                 if {$theta > 178} { set theta 178 }
    388                 set phi [expr {$_view(phi) - $dx*360}]
    389 
    390                 _3dView $theta $phi
     398                while {$theta < 0} { set theta [expr {$theta+180}] }
     399                while {$theta > 180} { set theta [expr {$theta-180}] }
     400                #if {$theta < 2} { set theta 2 }
     401                #if {$theta > 178} { set theta 178 }
     402
     403                if {$theta > 45 && $theta < 135} {
     404                    set phi [expr {$_view(phi) - $dx*360}]
     405                    while {$phi < 0} { set phi [expr {$phi+360}] }
     406                    while {$phi > 360} { set phi [expr {$phi-360}] }
     407                    set psi $_view(psi)
     408                } else {
     409                    set phi $_view(phi)
     410                    set psi [expr {$_view(psi) - $dx*360}]
     411                    while {$psi < -180} { set psi [expr {$psi+360}] }
     412                    while {$psi > 180} { set psi [expr {$psi-360}] }
     413                }
     414
     415                _3dView $theta $phi $psi
    391416                emblems fixPosition
    392417                $_dispatcher event -idle !render
     
    408433
    409434# ----------------------------------------------------------------------
    410 # USAGE: _3dView <theta> <phi>
     435# USAGE: _3dView <theta> <phi> <psi>
    411436#
    412437# Used internally to change the position of the camera for 3D data
     
    415440# Both angles are in degrees.
    416441# ----------------------------------------------------------------------
    417 itcl::body Rappture::MoleculeViewer::_3dView {theta phi} {
     442itcl::body Rappture::MoleculeViewer::_3dView {theta phi psi} {
    418443    set deg2rad 0.0174532927778
    419     set xn [expr {sin($theta*$deg2rad)*cos($phi*$deg2rad)}]
    420     set yn [expr {sin($theta*$deg2rad)*sin($phi*$deg2rad)}]
    421     set zn [expr {cos($theta*$deg2rad)}]
     444    set xp [expr {sin($theta*$deg2rad)*cos($phi*$deg2rad)}]
     445    set yp [expr {sin($theta*$deg2rad)*sin($phi*$deg2rad)}]
     446    set zp [expr {cos($theta*$deg2rad)}]
    422447
    423448    set xm [expr {0.5*($_limits(xmax)+$_limits(xmin))}]
     
    430455
    431456    $cam SetFocalPoint $xm $ym $zm
    432     $cam SetPosition [expr {$xm-$xn}] [expr {$ym-$yn}] [expr {$zm+$zn}]
     457    $cam SetPosition [expr {$xm-$xp}] [expr {$ym-$yp}] [expr {$zm+$zp}]
    433458    $cam ComputeViewPlaneNormal
    434459    $cam SetViewUp 0 0 1  ;# z-dir is up
    435460    $cam OrthogonalizeViewUp
     461    $cam Azimuth $psi
    436462    $this-ren ResetCamera
    437463    $cam SetViewAngle $zoom
     
    442468    set _view(theta) $theta
    443469    set _view(phi) $phi
     470    set _view(psi) $psi
    444471}
    445472
  • trunk/gui/scripts/radiodial.tcl

    r11 r64  
    1717option add *Radiodial.dialFillColor white widgetDefault
    1818option add *Radiodial.lineColor gray widgetDefault
    19 option add *Radiodial.activeLineColor red widgetDefault
     19option add *Radiodial.activeLineColor black widgetDefault
    2020option add *Radiodial.valueWidth 10 widgetDefault
    2121option add *Radiodial.font \
     
    192192                $op rlist [lindex $_values $i]
    193193            }
     194            position {
     195                foreach {min max} [_limits] break
     196                set v [lindex $_values $i]
     197                set frac [expr {double($v-$min)/($max-$min)}]
     198                $op rlist $frac
     199            }
    194200            all {
    195201                set v [lindex $_values $i]
    196                 $op rlist [list $_val2label($v) $v]
     202                foreach {min max} [_limits] break
     203                set frac [expr {double($v-$min)/($max-$min)}]
     204                $op rlist [list $_val2label($v) $v $frac]
    197205            }
    198206            default {
    199                 error "bad value \"$v\": should be label, value, all"
     207                error "bad value \"$v\": should be label, value, position, all"
    200208            }
    201209        }
  • trunk/gui/scripts/resultset.tcl

    r13 r64  
    1414option add *ResultSet.width 4i widgetDefault
    1515option add *ResultSet.height 4i widgetDefault
    16 option add *ResultSet.colors {blue magenta} widgetDefault
    1716option add *ResultSet.toggleBackground gray widgetDefault
    1817option add *ResultSet.toggleForeground white widgetDefault
     
    2524    inherit itk::Widget
    2625
    27     itk_option define -colors colors Colors ""
    2826    itk_option define -togglebackground toggleBackground Background ""
    2927    itk_option define -toggleforeground toggleForeground Foreground ""
     
    5452    private variable _plotall ""     ;# column with "All" active
    5553    private variable _col2widget     ;# maps column name => control widget
    56     private variable _spectrum ""    ;# color spectrum for "All" active
    5754    private variable _counter 0      ;# counter for unique control names
    5855}
     
    109106
    110107    eval itk_initialize $args
    111 
    112     # color spectrum for plotting "All" results
    113     set c1 [lindex $itk_option(-colors) 0]
    114     set c0 [lindex $itk_option(-colors) 1]
    115     if {"" == $c0} { set c0 #d9d9d9 }
    116     set _spectrum [Rappture::Spectrum ::#auto [list 0 $c0 1 $c1]]
    117108}
    118109
     
    122113itcl::body Rappture::ResultSet::destructor {} {
    123114    itcl::delete object $_results
    124     itcl::delete object $_spectrum
    125115}
    126116
     
    420410
    421411            set w $f.cntl$_counter
    422             Rappture::Radiodial $w \
    423                 -activelinecolor [lindex $itk_option(-colors) 0]
     412            Rappture::Radiodial $w
    424413            grid $w -row $_counter -column 1 -sticky ew
    425414            bind $w <<Value>> \
     
    513502        1 {
    514503            # only one data set? then plot it
    515             set color [lindex $itk_option(-colors) 0]
    516             _doSettings [list 0 [list -color $color -width 2]]
     504            _doSettings [list 0 [list -width 2]]
    517505            return
    518506        }
     
    558546            # single result -- always use active color
    559547            set i [lindex $ilist 0]
    560             set color [lindex $itk_option(-colors) 0]
    561             set plist [list $i [list -color $color -width 2]]
     548            set plist [list $i [list -width 2]]
    562549        } else {
    563550            #
     
    567554            set plist ""
    568555            foreach i $ilist {
    569                 set v [lindex [$_results get -format $_plotall $i] 0]
    570                 set color [$_col2widget($_plotall) color $v]
    571 
    572556                if {$i == $icurr} {
    573                     lappend plist $i [list -color $color -width 3 -raise 1]
     557                    lappend plist $i [list -width 3 -raise 1]
    574558                } else {
    575                     lappend plist $i [list -color $color -width 1]
     559                    lappend plist $i [list -brightness 0.7 -width 1]
    576560                }
    577561            }
     
    625609            -foreground $itk_option(-foreground)
    626610
    627         set color [lindex $itk_option(-colors) 0]
    628         $_col2widget($path) configure -activelinecolor $color
    629 
    630611        set _plotall ""
    631612    } else {
    632         if {"" != $_plotall} {
    633             set color [lindex $itk_option(-colors) 0]
    634             $_col2widget($_plotall) configure -activelinecolor $color
    635         }
    636 
    637613        # pop out all other "All" buttons
    638614        set f [$itk_component(scroller) contents frame]
     
    652628        # switch the "All" context to this path
    653629        set _plotall $path
    654         $_col2widget($path) configure -activelinecolor $_spectrum
    655630    }
    656631    $_dispatcher event -idle !settings
    657632}
    658 
    659 # ----------------------------------------------------------------------
    660 # CONFIGURATION OPTION: -colors
    661 # ----------------------------------------------------------------------
    662 itcl::configbody Rappture::ResultSet::colors {
    663     if {"" != $_spectrum} {
    664         set c1 [lindex $itk_option(-colors) 0]
    665         set c0 [lindex $itk_option(-colors) 1]
    666         if {"" == $c0} { set c0 #d9d9d9 }
    667 
    668         $_spectrum delete 0 end
    669         $_spectrum insert end 0 $c0 1 $c1
    670     }
    671 }
  • trunk/gui/scripts/resultviewer.tcl

    r50 r64  
    152152        add {
    153153            foreach {index opts} $args {
     154                set reset "-color autoreset"
    154155                set slot [lindex $_dataslots $index]
    155156                foreach dobj $slot {
    156                     # start with default settings from data object
    157                     if {[catch {$dobj hints style} settings]} {
    158                         set settings ""
     157                    set settings ""
     158                    # start with color reset, only for first object in series
     159                    if {"" != $reset} {
     160                        set settings $reset
     161                        set reset ""
     162                    }
     163                    # add default settings from data object
     164                    if {[catch {$dobj hints style} style] == 0} {
     165                        eval lappend settings $style
    159166                    }
    160167                    # add override settings passed in here
     
    247254        ::Rappture::LibraryObj {
    248255            switch -- [$dataobj element -as type] {
    249                 log {
     256                string - log {
    250257                    set mode "log"
    251258                    if {![info exists _mode2widget($mode)]} {
     
    355362            return [Rappture::Table ::#auto $xmlobj $path]
    356363        }
    357         log {
     364        string - log {
    358365            return [$xmlobj element -as object $path]
    359366        }
  • trunk/gui/scripts/textresult.tcl

    r50 r64  
    195195                }
    196196            }
     197        } elseif {[$dataobj element -as type] == "string"} {
     198            # add string values
     199            $itk_component(text) insert end [$dataobj get current]
    197200        } else {
    198201            # any other string output -- add it directly
  • trunk/gui/scripts/tool.tcl

    r23 r64  
    109109        set status [catch {eval blt::bgexec \
    110110            ::Rappture::Tool::job(control) \
     111            -keepnewline yes \
    111112            -onoutput [list [itcl::code $this _output]] \
    112113            -output ::Rappture::Tool::job(output) \
  • trunk/gui/scripts/valueresult.tcl

    r57 r64  
    7878        set params($opt) $val
    7979    }
     80    if {$params(-color) == "auto" || $params(-color) == "autoreset"} {
     81        # can't handle -autocolors yet
     82        set params(-color) black
     83    }
    8084
    8185    $itk_component(label) configure -text ""
  • trunk/gui/scripts/xyresult.tcl

    r57 r64  
    2222    -*-helvetica-medium-r-normal-*-*-120-* widgetDefault
    2323
     24option add *XyResult.autoColors {
     25    #0000ff #ff0000 #00cc00
     26    #cc00cc #ff9900 #cccc00
     27    #000080 #800000 #006600
     28    #660066 #996600 #666600
     29} widgetDefault
     30
    2431option add *XyResult*Balloon*Entry.background white widgetDefault
    2532
     
    4754    itk_option define -activecolor activeColor ActiveColor ""
    4855    itk_option define -dimcolor dimColor DimColor ""
     56    itk_option define -autocolors autoColors AutoColors ""
    4957
    5058    constructor {args} { # defined below }
     
    5866
    5967    protected method _rebuild {}
    60     protected method _fixLimits {}
     68    protected method _resetLimits {}
    6169    protected method _zoom {option args}
    6270    protected method _hilite {state x y}
     
    7482    private variable _label2axis   ;# maps axis label => axis ID
    7583    private variable _limits       ;# axis limits:  x-min, x-max, etc.
     84    private variable _autoColorI 0 ;# index for next "-color auto"
    7685
    7786    private variable _hilite       ;# info for element currently highlighted
     
    221230itcl::body Rappture::XyResult::add {curve {settings ""}} {
    222231    array set params {
    223         -color black
     232        -color auto
    224233        -brightness 0
    225234        -width 1
     
    232241        }
    233242        set params($opt) $val
     243    }
     244
     245    # if the color is "auto", then select a color from -autocolors
     246    if {$params(-color) == "auto" || $params(-color) == "autoreset"} {
     247        if {$params(-color) == "autoreset"} {
     248            set _autoColorI 0
     249        }
     250        set color [lindex $itk_option(-autocolors) $_autoColorI]
     251        if {"" == $color} { set color black }
     252        set params(-color) $color
     253
     254        # set up for next auto color
     255        if {[incr _autoColorI] >= [llength $itk_option(-autocolors)]} {
     256            set _autoColorI 0
     257        }
    234258    }
    235259
     
    245269        set params(-color) [Rappture::color::brightness \
    246270            $params(-color) $params(-brightness)]
     271
     272        set bg [$itk_component(plot) cget -plotbackground]
     273        foreach {h s v} [Rappture::color::RGBtoHSV $bg] break
     274        if {$v > 0.5} {
     275            set params(-color) [Rappture::color::brightness_max \
     276                $params(-color) 0.8]
     277        } else {
     278            set params(-color) [Rappture::color::brightness_min \
     279                $params(-color) 0.2]
     280        }
    247281    }
    248282
     
    314348        $_dispatcher event -idle !rebuild
    315349    }
     350
     351    # nothing left? then start over with auto colors
     352    if {[llength $_clist] == 0} {
     353        set _autoColorI 0
     354    }
    316355}
    317356
     
    326365# ----------------------------------------------------------------------
    327366itcl::body Rappture::XyResult::scale {args} {
     367    set allx [$itk_component(plot) x2axis use]
     368    lappend allx x  ;# fix main x-axis too
     369    foreach axis $allx {
     370        _axis scale $axis linear
     371    }
     372
     373    set ally [$itk_component(plot) y2axis use]
     374    lappend ally y  ;# fix main y-axis too
     375    foreach axis $ally {
     376        _axis scale $axis linear
     377    }
     378
    328379    catch {unset _limits}
    329380    foreach xydata $args {
     
    351402                }
    352403            }
    353         }
    354     }
    355     _fixLimits
     404
     405            if {[$xydata hints ${axis}scale] == "log"} {
     406                _axis scale $map($axis) log
     407            }
     408        }
     409    }
     410    _resetLimits
    356411}
    357412
     
    400455    }
    401456    catch {unset _label2axis}
    402 
    403     $g axis configure x -min "" -max "" -hide no
    404     _axis scale x linear
    405 
    406     $g axis configure y -min "" -max "" -hide no
    407     _axis scale y linear
    408457
    409458    #
     
    511560                -color $color -dashes $dashes \
    512561                -mapx $mapx -mapy $mapy
    513 
    514             if {[$xydata hints xscale] == "log"} {
    515                 _axis scale x log
    516             }
    517             if {[$xydata hints yscale] == "log"} {
    518                 _axis scale y log
    519             }
    520         }
    521     }
    522 
    523     _fixLimits
    524 }
    525 
    526 # ----------------------------------------------------------------------
    527 # USAGE: _fixLimits
     562        }
     563    }
     564}
     565
     566# ----------------------------------------------------------------------
     567# USAGE: _resetLimits
    528568#
    529569# Used internally to apply automatic limits to the axes for the
    530570# current plot.
    531571# ----------------------------------------------------------------------
    532 itcl::body Rappture::XyResult::_fixLimits {} {
     572itcl::body Rappture::XyResult::_resetLimits {} {
    533573    set g $itk_component(plot)
    534574
     
    605645    switch -- $option {
    606646        reset {
    607             _fixLimits
     647            _resetLimits
    608648        }
    609649    }
     
    669709        $g element activate $elem
    670710        set _hilite(elem) $elem
     711
     712        set dlist [$g element show]
     713        set i [lsearch -exact $dlist $elem]
     714        if {$i >= 0} {
     715            set dlist [lreplace $dlist $i $i]
     716            lappend dlist $elem
     717            $g element show $dlist
     718        }
    671719
    672720        foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     
    10701118    }
    10711119}
     1120
     1121# ----------------------------------------------------------------------
     1122# CONFIGURATION OPTION: -autocolors
     1123# ----------------------------------------------------------------------
     1124itcl::configbody Rappture::XyResult::autocolors {
     1125    foreach c $itk_option(-autocolors) {
     1126        if {[catch {winfo rgb $itk_component(hull) $c}]} {
     1127            error "bad color \"$c\""
     1128        }
     1129    }
     1130    if {$_autoColorI >= [llength $itk_option(-autocolors)]} {
     1131        set _autoColorI 0
     1132    }
     1133}
Note: See TracChangeset for help on using the changeset viewer.