From 2a75d620242fbd85320b0d48b5ee457d9faeeebc Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 20 Apr 2017 12:57:28 -0400 Subject: enhance graphs --- ds9/library/bin.tcl | 3 +-- ds9/library/block.tcl | 5 ++--- ds9/library/crop.tcl | 3 +-- ds9/library/cube.tcl | 2 +- ds9/library/frame.tcl | 6 ++---- ds9/library/graph.tcl | 47 +++++++++++++++-------------------------------- ds9/library/mview.tcl | 4 ++-- ds9/library/panner.tcl | 4 ++-- ds9/library/panzoom.tcl | 10 +++++----- ds9/library/scale.tcl | 2 +- ds9/library/smooth.tcl | 2 +- ds9/library/util.tcl | 3 +-- 12 files changed, 34 insertions(+), 57 deletions(-) diff --git a/ds9/library/bin.tcl b/ds9/library/bin.tcl index 11cb5f3..130a62f 100644 --- a/ds9/library/bin.tcl +++ b/ds9/library/bin.tcl @@ -186,8 +186,7 @@ proc UpdateBin {} { UpdateContourScale UpdateContourDialog UpdateWCSDialog - UpdateGraphXAxis $current(frame) - UpdateGraphYAxis $current(frame) + UpdateGraphAxis $current(frame) UpdateMain } diff --git a/ds9/library/block.tcl b/ds9/library/block.tcl index f474f2d..aba5e5b 100644 --- a/ds9/library/block.tcl +++ b/ds9/library/block.tcl @@ -68,8 +68,7 @@ proc UpdateBlock {} { UpdateContourScale UpdateContourDialog UpdateWCSDialog - UpdateGraphXAxis $current(frame) - UpdateGraphYAxis $current(frame) + UpdateGraphAxis $current(frame) UpdateMain UpdateHeaderDialog @@ -163,7 +162,7 @@ proc BlockApplyDialog {} { RGBEvalLockCurrent rgb(lock,block) [list $current(frame) block to $block(factor)] LockFrameCurrent - UpdateGraphXAxis $current(frame) + UpdateGraphAxis $current(frame) UpdateBlockDialog RefreshInfoBox $current(frame) } diff --git a/ds9/library/crop.tcl b/ds9/library/crop.tcl index a4982d3..075b5c4 100644 --- a/ds9/library/crop.tcl +++ b/ds9/library/crop.tcl @@ -74,8 +74,7 @@ proc UpdateCrop {which} { UpdateContourDialog UpdateScaleDialog GridUpdateZoom - UpdateGraphXAxis $which - UpdateGraphYAxis $which + UpdateGraphAxis $which UpdateInfoBoxBase UpdateMain } diff --git a/ds9/library/cube.tcl b/ds9/library/cube.tcl index 68ecf25..0207212 100644 --- a/ds9/library/cube.tcl +++ b/ds9/library/cube.tcl @@ -303,7 +303,7 @@ proc UpdateCube {} { UpdateScaleDialog UpdateContourScale UpdateContourDialog - UpdateGraphYAxis $current(frame) + UpdateGraphAxis $current(frame) UpdateInfoBoxBase UpdateMain } diff --git a/ds9/library/frame.tcl b/ds9/library/frame.tcl index 8c13c87..f88a3ff 100644 --- a/ds9/library/frame.tcl +++ b/ds9/library/frame.tcl @@ -579,8 +579,7 @@ proc EnterFrame {which x y} { UpdateInfoBox $which $x $y canvas UpdatePixelTableDialog $which $x $y canvas UpdateGraph $which $x $y canvas - UpdateGraphXAxis $which - UpdateGraphYAxis $which + UpdateGraphAxis $which UpdateMagnifier $which $x $y if {$view(magnifier)} { @@ -1810,8 +1809,7 @@ proc ResetFrame {which} { UpdateZoomMenu UpdateScaleMenu UpdateScaleDialog - UpdateGraphXAxis $which - UpdateGraphYAxis $which + UpdateGraphAxis $which SAMPSendCoordPointAtSkyCmd $which } diff --git a/ds9/library/graph.tcl b/ds9/library/graph.tcl index ab6a987..9b37697 100644 --- a/ds9/library/graph.tcl +++ b/ds9/library/graph.tcl @@ -151,21 +151,26 @@ proc UpdateGraphGrid {} { $ds9(graph,vert) yaxis configure -grid $graph(vert,grid) -tickdefault 4 } -proc UpdateGraphXAxis {which} { +proc UpdateGraphAxis {which} { global ds9 global view + global graph global debug if {$debug(tcl,update)} { - puts stderr "UpdateGraphXAxis" + puts stderr "UpdateGraphAxis" } if {$view(graph,horz)} { UpdateGraphXAxisHV $which $ds9(graph,horz) graphHorzX + UpdateGraphYAxisHV $which $ds9(graph,horz) graphHorzY \ + $graph(horz,log) $graph(horz,thick) $graph(horz,method) } if {$view(graph,vert)} { UpdateGraphXAxisHV $which $ds9(graph,vert) graphVertX + UpdateGraphYAxisHV $which $ds9(graph,vert) graphVertY \ + $graph(vert,log) $graph(vert,thick) $graph(vert,method) } } @@ -185,28 +190,6 @@ proc UpdateGraphXAxisHV {which what vectorX} { } } -proc UpdateGraphYAxis {which} { - global graph - - global ds9 - global view - - global debug - if {$debug(tcl,update)} { - puts stderr "UpdateGraphYAxis" - } - - if {$view(graph,horz)} { - UpdateGraphYAxisHV $which $ds9(graph,horz) graphHorzY \ - $graph(horz,log) $graph(horz,thick) $graph(horz,method) - } - - if {$view(graph,vert)} { - UpdateGraphYAxisHV $which $ds9(graph,vert) graphVertY \ - $graph(vert,log) $graph(vert,thick) $graph(vert,method) - } -} - proc UpdateGraphYAxisHV {which what vectorY log thick method} { global igraph global graphHorzY graphVertY @@ -467,19 +450,19 @@ proc GraphDialog {} { ttk::label $f.htaxis -text [msgcat::mc {Axis}] ttk::radiobutton $f.hlaxis -text [msgcat::mc {Linear}] \ -variable graph(horz,log) -value false \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] ttk::radiobutton $f.hgaxis -text [msgcat::mc {Log}] \ -variable graph(horz,log) -value true \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] ttk::label $f.htthick -text [msgcat::mc {Thickness}] ttk::entry $f.hthick -textvariable graph(horz,thick) -width 7 ttk::label $f.htmethod -text [msgcat::mc {Method}] ttk::radiobutton $f.hamethod -text [msgcat::mc {Average}] \ -variable graph(horz,method) -value average \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] ttk::radiobutton $f.hsmethod -text [msgcat::mc {Sum}] \ -variable graph(horz,method) -value sum \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] grid $f.hgrid -padx 2 -pady 2 -sticky w grid $f.htaxis $f.hlaxis $f.hgaxis -padx 2 -pady 2 -sticky w @@ -495,19 +478,19 @@ proc GraphDialog {} { ttk::label $f.vtaxis -text [msgcat::mc {Axis}] ttk::radiobutton $f.vlaxis -text [msgcat::mc {Linear}] \ -variable graph(vert,log) -value false \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] ttk::radiobutton $f.vgaxis -text [msgcat::mc {Log}] \ -variable graph(vert,log) -value true \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] ttk::label $f.vtthick -text [msgcat::mc {Thickness}] ttk::entry $f.vthick -textvariable graph(vert,thick) -width 7 ttk::label $f.vtmethod -text [msgcat::mc {Method}] ttk::radiobutton $f.vamethod -text [msgcat::mc {Average}] \ -variable graph(vert,method) -value average \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] ttk::radiobutton $f.vsmethod -text [msgcat::mc {Sum}] \ -variable graph(vert,method) -value sum \ - -command [list UpdateGraphYAxis $current(frame)] + -command [list UpdateGraphAxis $current(frame)] grid $f.vgrid -padx 2 -pady 2 -sticky w grid $f.vtaxis $f.vlaxis $f.vgaxis -padx 2 -pady 2 -sticky w diff --git a/ds9/library/mview.tcl b/ds9/library/mview.tcl index 64d2def..c63a4b0 100644 --- a/ds9/library/mview.tcl +++ b/ds9/library/mview.tcl @@ -149,7 +149,7 @@ proc PrefsDialogGraph {} { set f [ttk::labelframe $w.graph.horz -text [msgcat::mc {Horizontal}]] ttk::checkbutton $f.hgrid -text [msgcat::mc {Show Grid}] \ - -variable pgraph(horz,grid) -command UpdateGraphGrid + -variable pgraph(horz,grid) ttk::label $f.htaxis -text [msgcat::mc {Axis}] ttk::radiobutton $f.hlaxis -text [msgcat::mc {Linear}] \ -variable pgraph(horz,log) -value false @@ -172,7 +172,7 @@ proc PrefsDialogGraph {} { set f [ttk::labelframe $w.graph.vert -text [msgcat::mc {Vertical}]] ttk::checkbutton $f.vgrid -text [msgcat::mc {Show Grid}] \ - -variable pgraph(vert,grid) -command UpdateGraphGrid + -variable pgraph(vert,grid) ttk::label $f.vtaxis -text [msgcat::mc {Axis}] ttk::radiobutton $f.vlaxis -text [msgcat::mc {Linear}] \ -variable pgraph(vert,log) -value false diff --git a/ds9/library/panner.tcl b/ds9/library/panner.tcl index 5ff5e7a..9a6335f 100644 --- a/ds9/library/panner.tcl +++ b/ds9/library/panner.tcl @@ -229,7 +229,7 @@ proc Release1Panner {x y} { UpdateGraph $current(frame) $x $y panner LockFrameCurrent - UpdateGraphXAxis $current(frame) + UpdateGraphAxis $current(frame) UpdatePanZoomDialog SAMPSendCoordPointAtSkyCmd $current(frame) } @@ -249,7 +249,7 @@ proc Release2Panner {x y} { UpdateGraph $current(frame) $x $y panner LockFrameCurrent - UpdateGraphXAxis $current(frame) + UpdateGraphAxis $current(frame) UpdatePanZoomDialog SAMPSendCoordPointAtSkyCmd $current(frame) } diff --git a/ds9/library/panzoom.tcl b/ds9/library/panzoom.tcl index 7c843d7..a576dd7 100644 --- a/ds9/library/panzoom.tcl +++ b/ds9/library/panzoom.tcl @@ -185,7 +185,7 @@ proc PreservePan {} { proc UpdatePan {which} { LockFrame $which - UpdateGraphXAxis $which + UpdateGraphAxis $which UpdatePanZoomDialog SAMPSendCoordPointAtSkyCmd $which } @@ -259,7 +259,7 @@ proc ZoomShift {which} { proc UpdateZoom {which} { LockFrame $which - UpdateGraphXAxis $which + UpdateGraphAxis $which UpdatePanZoomDialog GridUpdateZoom RefreshInfoBox $which @@ -328,7 +328,7 @@ proc RotateRelease {which x y} { proc UpdateRotate {which} { LockFrame $which - UpdateGraphXAxis $which + UpdateGraphAxis $which UpdatePanZoomDialog RefreshInfoBox $which } @@ -480,7 +480,7 @@ proc PanZoomApplyDialog {} { $current(frame) rotate to $current(rotate) LockFrameCurrent - UpdateGraphXAxis $current(frame) + UpdateGraphAxis $current(frame) UpdatePanZoomDialog GridUpdateZoom RefreshInfoBox $current(frame) @@ -563,7 +563,7 @@ proc AlignWCSFrame {} { $current(frame) wcs align $current(align) LockFrameCurrent - UpdateGraphXAxis $current(frame) + UpdateGraphAxis $current(frame) UpdatePanZoomDialog } } diff --git a/ds9/library/scale.tcl b/ds9/library/scale.tcl index 929c68b..3a9114a 100644 --- a/ds9/library/scale.tcl +++ b/ds9/library/scale.tcl @@ -171,7 +171,7 @@ proc UpdateScale {} { UpdateScaleMenu UpdateScaleDialog UpdateContourScale - UpdateGraphYAxis $current(frame) + UpdateGraphAxis $current(frame) UpdateInfoBoxBase UpdateMain } diff --git a/ds9/library/smooth.tcl b/ds9/library/smooth.tcl index f116510..c709e08 100644 --- a/ds9/library/smooth.tcl +++ b/ds9/library/smooth.tcl @@ -40,7 +40,7 @@ proc SmoothUpdate {} { UpdateContourScale UpdateContourDialog UpdateScaleDialog - UpdateGraphXAxis $current(frame) + UpdateGraphAxis $current(frame) UpdateMain } diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl index aab9ea7..a112fc9 100644 --- a/ds9/library/util.tcl +++ b/ds9/library/util.tcl @@ -136,8 +136,7 @@ proc UpdateDS9 {} { UpdateContourDialog UpdateGridDialog - UpdateGraphXAxis $current(frame) - UpdateGraphYAxis $current(frame) + UpdateGraphAxis $current(frame) RefreshInfoBox $current(frame) UpdateColormapLevel -- cgit v0.12