[Robast-commits] r865 - branches/robast-1.0/pkg/RobExtremesBuffer
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Nov 16 09:23:34 CET 2015
Author: eugenm123
Date: 2015-11-16 09:23:34 +0100 (Mon, 16 Nov 2015)
New Revision: 865
Modified:
branches/robast-1.0/pkg/RobExtremesBuffer/server.R
branches/robast-1.0/pkg/RobExtremesBuffer/ui.R
branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R
Log:
Vorher war falsche version mit Bug.
Modified: branches/robast-1.0/pkg/RobExtremesBuffer/server.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremesBuffer/server.R 2015-11-09 12:52:05 UTC (rev 864)
+++ branches/robast-1.0/pkg/RobExtremesBuffer/server.R 2015-11-16 08:23:34 UTC (rev 865)
@@ -236,37 +236,21 @@
if(!is.null(res)){
zoom$xlim <- res$xlim
zoom$ylim <- res$ylim
-
- updateNumericInput(session, "zoomYlimMin", value=res$ylim[1])
- updateNumericInput(session, "zoomYlimMax", value=res$ylim[2])
}
}, label="Zoom in")
# zoom out
observe({ # depends on input${zoomOut}, modifies zoom
if (input$zoomOut){
- res <- zoomOut()
+ res <- zoom.out()
if(!is.null(res)){
zoom$xlim <- res$xlim
zoom$ylim <- res$ylim
-
- updateNumericInput(session, "zoomYlimMin", value=res$ylim[1])
- updateNumericInput(session, "zoomYlimMax", value=res$ylim[2])
# The event for replotting should be fired now
}
}
}, label="Zoom Out")
- # zoom by numeric input fields
- observe({
-# if(input$zoomYlimMin){
-# zoom$ylim[1] <- isolate(input$zoomYlimMin)
-# }
-# if(input$zoomYlimMax){
-# zoom$ylim[2] <- isolate(input$zoomYlimMax)
-# }
- }, label="zoom by numeric input fields")
-
######################################################################################
## Reset function
observe({ # depends on zoom, input${whichLM, familyName, gridName}
Modified: branches/robast-1.0/pkg/RobExtremesBuffer/ui.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremesBuffer/ui.R 2015-11-09 12:52:05 UTC (rev 864)
+++ branches/robast-1.0/pkg/RobExtremesBuffer/ui.R 2015-11-16 08:23:34 UTC (rev 865)
@@ -24,7 +24,7 @@
sliderInput("whichLM", label="L-Multiplikator auswählen", min=1, max=10, value=1),
checkboxInput("takeUsed", label="Gespeicherten Spline verwenden."),
- numericInput("df", "DF", value=10, step=1),
+ numericInput("df", "DF", 10),
selectInput("ranges", label="Glättung-Ausschluss-Intervalle", choices=NULL, size=10, selectize=FALSE),
fluidRow(
@@ -48,9 +48,7 @@
),
fluidRow(
column(1, actionButton("zoomOut", label="Zoom Out", icon=icon("zoom-out", lib="glyphicon"))),
- column(2, offset=1, checkboxInput("withLegend", label="Legende anzeigen", value=TRUE)),
- column(3, numericInput("zoomYlimMin", "Zoom ylim min", value=0.1)),
- column(3, numericInput("zoomYlimMax", "Zoom ylim max", value=1.1))
+ column(2, offset=1, checkboxInput("withLegend", label="Legende anzeigen", value=TRUE))
)
) # column
) # fluidRow
Modified: branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R
===================================================================
--- branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R 2015-11-09 12:52:05 UTC (rev 864)
+++ branches/robast-1.0/pkg/RobExtremesBuffer/utilities.R 2015-11-16 08:23:34 UTC (rev 865)
@@ -433,30 +433,28 @@
return(NULL)
# store to history if the last differs from current
- if (!can.push(zoomHistory, zoomList))
- return(NULL)
+ if (can.push(zoomHistory, zoomList)){
+ last.idx <- length(zoomHistory)
+ zoomHistory[[last.idx + 1]] <<- zoomList
+
+ # set new values
+ res <- list (xlim=c(brush$xmin, brush$xmax), ylim=c(brush$ymin, brush$ymax))
+ return(res)
+ }
- idxOfLastEntry <- length(zoomHistory)
- zoomHistory[[idxOfLastEntry + 1]] <<- zoomList
-
- # set new values
- res <- list(xlim=c(brush$xmin, brush$xmax), ylim=c(brush$ymin, brush$ymax))
- return(res)
+ return(NULL)
}
-
-zoomOut <- function() {
- idxOfLastEntry <- length(zoomHistory)
- isHistoryEmpty <- idxOfLastEntry == 0
-
- if(isHistoryNotEmpty)
- return(NULL)
-
- last <- zoomHistory[[idxOfLastEntry]]
- zoomHistory <<- zoomHistory[1:(idxOfLastEntry-1)]
-
- lims <- list(xlim=c(last$xlim[1], last$xlim[2]), ylim=c(last$ylim[1], last$ylim[2]))
- return(lims)
+zoom.out <- function(){
+ idx.last <- length(zoomHistory)
+ if(idx.last > 0){
+ last <- zoomHistory[[idx.last]]
+ zoomHistory <<- zoomHistory[1:(idx.last-1)]
+
+ res <-list(xlim=c(last$xlim[1], last$xlim[2]), ylim=c(last$ylim[1], last$ylim[2]))
+ return(res)
+ }
+ return(NULL)
}
More information about the Robast-commits
mailing list