GithubHelp home page GithubHelp logo

alteryxrhelper's People

Contributors

ramnathv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alteryxrhelper's Issues

Notes

Authoring R based Macros in Alteryx

UI

# Configuration
config <- list(
  inputMode = '%Question.inputMode%',
  solver = '%Question.solver%'
)

# Inputs 
inputs <- list(
  A = read.Alteryx("#1"),
  B = read.Alteryx("#2")
)

payload = list(config = config, inputs = inputs)

BackEnd

results <- outputs(payload)

Reporting

write.Alteryx(results$data, 1)
write.Alteryx(results$plot, 2)

No update of R code within R-tool after repeated use of "insertRcode" command

Hi Ramnath,

first of all, thanks for getting this great tool out! I was having a lot of issues with the R-Tool, especially with a bug for non-English locale settings kept crashing the built-in editor.

Right, I have closely followed the process described to use an external editor to develop R code. Using "inserRcode" the first time works fine, the code within the R-Tool of the macro gets updated. However, while having the macro workflow open in Alteryx and changing the code within the external vim editor, the following happens while committing the changes with "insertRCode":

  • Alteryx shows "*" to indicate the workflow has been changed
  • Opening the R-tool with the externally modified R code does not reflect those changes
  • Refreshing the view of the R-tool does not make any difference
  • Closing the Alteryx workflow (while selecting to not saving the changes!) and re-opening it finally shows the changes done in the editor

My current workaround is to only run "insertRcode" once; later, I simply copy and paste the code from the editor the the R-tool.

Any feedback would be appreciated

Regards

Oli

Add function to automatically create test workflows from R

#' Generate TextInput compatible XML for a Data Frame
df2TextInput <- function(x){
  config <- read_xml("<Configuration />")
  xml_add_child(config, "NumRows", value = as.character(NROW(x)))
  fields <- xml_add_child(config, "Fields")
  for (name in names(x)){
    xml_add_child(fields, "Field", name  = name)
  }
  data = xml_add_child(config, "Data")
  for (i in 1:NROW(x)){
    row = xml_add_child(data, "r")
    for(j in 1:NCOL(x))
      xml_add_child(row, "c", as.character(x[i,j]))
  }
  config
}

#' Generate Configuration XML from Configuration List.
config2xml <- function(props){
  config <- read_xml("<Configuration />")
  for (k in names(props)){
    xml_add_child(config, "Value", name = k, paste(props[[k]], collapse = " + "))
  }
  config
}

#' Make workflow given data, template and tool ids.
makeWorkflow <- function(template, data, config, inputs_id, config_id, outFile){
  getTool <- function(id){
    sprintf("//Node[@ToolID = '%s']/Properties/Configuration", id)
  }
  doc <- read_xml(template)
  n2 <- xml_find_first(doc, getTool(inputs_id))
  textinput <- df2TextInput2(data)
  invisible(xml_replace(n2, textinput))

  n3 <- xml_find_first(doc, getTool(config_id))
  xmlConfig <- list2xml(config)
  invisible(xml_replace(n3, xmlConfig))
  write_xml(doc, outFile)
}

Automatically detect JSON parameters

There are many situations that dictate the need for using a hidden textbox to persist a JSON stringified representation of a dataItem. In such situations, the makeInput function can be smart about it and automatically run it through jsonlite::fromJSON(..., auto_unbox = TRUE)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.