Commit 1ecd1236 authored by Yong Liu's avatar Yong Liu

variable list order while difference

parent 7fa148cb
......@@ -2926,7 +2926,7 @@ sdcGUI <- function() {
updateDifference(glayout, newdf, olddf, svalue(h$obj))
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
glayout[1,2] <- gbutton("prev difference", handler=function(h,...){
glayout[1,2] <- gbutton("Prev difference", handler=function(h,...){
sdcObject = ActiveSdcObject()
data <- extractManipData(sdcObject)
if(!is.null(sdcObject@deletedVars)) {
......@@ -2938,7 +2938,7 @@ sdcGUI <- function() {
updateDifference(glayout, newdf, olddf, svalue(onlydiff), -1)
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
glayout[1,3] <- gbutton("next difference", handler=function(h,...){
glayout[1,3] <- gbutton("Next difference", handler=function(h,...){
sdcObject = ActiveSdcObject()
data <- extractManipData(sdcObject)
if(!is.null(sdcObject@deletedVars)) {
......@@ -2956,7 +2956,9 @@ sdcGUI <- function() {
glayout[3,1,expand=TRUE] <- gtable(data.frame(numeric(0)))
glayout[3,2,expand=TRUE] <- gtable(data.frame(numeric(0)))
tmp <- gframe("Variables")
variableList <- gcheckboxgroup(names(sdcObject@origData), container=tmp, use.table= TRUE, expand=TRUE, handler=function(h,...){
variableListNames <- c(names(sdcObject@manipKeyVars), names(sdcObject@manipNumVars),
names(sdcObject@origData)[!names(sdcObject@origData) %in% c(names(sdcObject@manipKeyVars), names(sdcObject@manipNumVars))])
variableList <- gcheckboxgroup(variableListNames, container=tmp, use.table= TRUE, expand=TRUE, handler=function(h,...){
sdcObject = ActiveSdcObject()
data <- extractManipData(sdcObject)
if(!is.null(sdcObject@deletedVars)) {
......@@ -2968,7 +2970,7 @@ sdcGUI <- function() {
updateDifference(glayout, newdf, olddf, svalue(onlydiff))
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
svalue(variableList) <- names(sdcObject@origData) %in% selectedNames
svalue(variableList) <- names(sdcObject@origData) [names(sdcObject@origData) %in% selectedNames]
data <- extractManipData(sdcObject)
if(!is.null(sdcObject@deletedVars)) {
data <- data[!names(data) %in% sdcObject@deletedVars]
......@@ -3013,14 +3015,14 @@ sdcGUI <- function() {
updateDifference(glayout, newdf, olddf, svalue(h$obj))
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
glayout[1,2] <- gbutton("prev difference", handler=function(h,...){
glayout[1,2] <- gbutton("Prev difference", handler=function(h,...){
selected <- svalue(variableList)
newdf <- data[names(data) %in% selected]
olddf <- sdcObject@origData[names(sdcObject@origData) %in% selected]
updateDifference(glayout, newdf, olddf, svalue(onlydiff), -1)
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
glayout[1,3] <- gbutton("next difference", handler=function(h,...){
glayout[1,3] <- gbutton("Next difference", handler=function(h,...){
selected <- svalue(variableList)
newdf <- data[names(data) %in% selected]
olddf <- sdcObject@origData[names(sdcObject@origData) %in% selected]
......@@ -3033,7 +3035,9 @@ sdcGUI <- function() {
glayout[3,1,expand=TRUE] <- gtable(data.frame(numeric(0)))
glayout[3,2,expand=TRUE] <- gtable(data.frame(numeric(0)))
tmp <- gframe("Variables")
variableList <- gcheckboxgroup(names(sdcObject@origData), container=tmp, use.table= TRUE, expand=TRUE, handler=function(h,...){
variableListNames <- c(names(sdcObject@manipKeyVars), names(sdcObject@manipNumVars),
names(sdcObject@origData)[!names(sdcObject@origData) %in% c(names(sdcObject@manipKeyVars), names(sdcObject@manipNumVars))])
variableList <- gcheckboxgroup(variableListNames, container=tmp, use.table= TRUE, expand=TRUE, handler=function(h,...){
selected <- svalue(variableList)
newdf <- data[names(data) %in% selected]
olddf <- sdcObject@origData[names(sdcObject@origData) %in% selected]
......@@ -3041,7 +3045,7 @@ sdcGUI <- function() {
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
selectedNames <- c(names(sdcObject@manipKeyVars),names(sdcObject@manipNumVars), names(sdcObject@manipPramVars), names(sdcObject@manipStrataVar))
svalue(variableList) <- names(sdcObject@origData) %in% selectedNames
svalue(variableList) <- names(sdcObject@origData)[names(sdcObject@origData) %in% selectedNames]
newdf <- data[names(data) %in% selectedNames]
olddf <- sdcObject@origData[names(sdcObject@origData) %in% selectedNames]
updateDifference(glayout, newdf, olddf, svalue(onlydiff))
......@@ -4922,7 +4926,7 @@ compareDataExport <- function(comparedScript, len, ...){
gmessage("Script step not valid.", title="Input not valid", icon="info", parent=scriptEditWindow)
}
}
scriptEditWindow = gwindow(paste("View script", getd("activescript.file"), SEP=" "), parent=window, width=700, height=400)
scriptEditWindow = gwindow(paste("Script", getd("activescript.file"), SEP=" "), parent=window, width=700, height=400)
scriptWidget = ggroup(horizontal=FALSE)
xscript = gdf(cmdhist, expand=TRUE)
# TODO: find replacement, cause in linux it wouldnt display anything.
......@@ -5146,9 +5150,8 @@ compareDataExport <- function(comparedScript, len, ...){
properitesLabel <- gedit(text="", container=propertiesGroup)
enabled(properitesLabel) <- FALSE
glabel(text="Data type", container=propertiesGroup)
DataTypeAsGroup <- ggroup(container=propertiesGroup, horizontal=TRUE)
DataTypeAs <- glabel("", container=DataTypeAsGroup)
addSpring(DataTypeAsGroup)
DataTypeAs <- gedit("", container=propertiesGroup)
enabled(DataTypeAs) <- FALSE
deleteVariable <- gcheckbox(text="Delete", container=propertiesGroup, handler=function(h,...) {
obj = svalue(df, index=TRUE)
......@@ -6104,7 +6107,7 @@ compareDataExport <- function(comparedScript, len, ...){
## main layout
mainGroupX = ggroup(container=sdcLayout, horizontal=TRUE, expand=TRUE)
gp <- gpanedgroup(container = mainGroupX, expand=TRUE)
leftFrame <- gframe("View Script", container = gp, horizontal=FALSE, expand=TRUE)
leftFrame <- gframe("Script", container = gp, horizontal=FALSE, expand=TRUE)
leftLabelGroup = ggroup(container=leftFrame, horizontal=TRUE)
leftFrameGroupLabel= glabel("Untitled Script", container=leftLabelGroup, expand=TRUE, handler=function(h,...){
saveScript()
......@@ -6114,7 +6117,7 @@ compareDataExport <- function(comparedScript, len, ...){
}
svalue(h$obj) <- name
})
leftFrameGroupButton= gbutton("pop", container=leftLabelGroup, expand=TRUE, handler=function(h,...) {viewScript()})
leftFrameGroupButton= gbutton("Pop out", container=leftLabelGroup, expand=TRUE, handler=function(h,...) {viewScript()})
leftgdf <- gdf(Script()$cmd, expand=TRUE, container=leftFrame)
putd("leftgdf", leftgdf)
leftgdflist <- list()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment