Skip to content

Commit 2024c87

Browse files
committed
bugfix in server, parsing constraints
1 parent 89f2e4f commit 2024c87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inst/shiny/interface/server.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,12 @@ function(input, output) {
377377
observeEvent(input$parseconstraint, {
378378

379379
constrainttext <- strsplit(input$constraintfield, "\n", fixed = TRUE)[[1]]
380+
graph <- igraphFromList()
381+
obsnames <- names(V(graph)[!names(V(graph)) %in% c("Ur", "Ul")])
380382

381383
error <- NULL
382384

383-
parsed.ctest <- tryCatch(parse_constraints(constrainttext), error = function(e) "fail")
385+
parsed.ctest <- tryCatch(parse_constraints(constrainttext, obsnames), error = function(e) "fail")
384386
if(!is.list(parsed.ctest)) {
385387

386388
error <- "Unable to parse constraints!"
@@ -390,7 +392,7 @@ function(input, output) {
390392
allnmes <- unique(c(parsed.ctest$leftout, parsed.ctest$rightout,
391393
gsub("=(0|1)", "", c(parsed.ctest$leftcond, parsed.ctest$rightcond))))
392394

393-
graph <- igraphFromList()
395+
394396
if(any(!parsed.ctest$operator %in% c("==", "<", ">", "<=", ">="))) {
395397
error <- "Operator not allowed!"
396398
}

0 commit comments

Comments
 (0)