Package processanimater

Similar documents
Package canvasxpress

Package d3plus. September 25, 2017

Package slickr. March 6, 2018

Package jstree. October 24, 2017

Package bupar. March 21, 2018

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package sigmanet. April 23, 2018

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package profvis. R topics documented:

Package htmlwidgets. February 25, 2016

Package htmlwidgets. July 10, 2017

Package collapsibletree

Package fastdummies. January 8, 2018

Package htmltidy. September 29, 2017

Package scatterd3. March 10, 2018

Package vdiffr. April 27, 2018

Package deckgl. November 19, 2018

Package shiny.semantic

Package robotstxt. November 12, 2017

Package shinyaframe. November 26, 2017

Package d3heatmap. February 1, 2018

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package messaging. May 27, 2018

Package knitrprogressbar

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package condformat. October 19, 2017

Package docxtools. July 6, 2018

Package facerec. May 14, 2018

Package datasets.load

Package ECctmc. May 1, 2018

Package validara. October 19, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package edear. March 22, 2018

Package loggit. April 9, 2018

Package githubinstall

Package TnT. November 22, 2017

Package repec. August 31, 2018

Package leaflet.minicharts

Package projector. February 27, 2018

Package SEMrushR. November 3, 2018

Package colourpicker

Package dkanr. July 12, 2018

Package carbonate. R topics documented: October 14, 2018

Package rsppfp. November 20, 2018

Package opencage. January 16, 2018

Package barcoder. October 26, 2018

Package semver. January 6, 2017

Package pdfsearch. July 10, 2018

Package modules. July 22, 2017

Package jpmesh. December 4, 2017

Package metricsgraphics

Package editdata. October 7, 2017

Package WordR. September 7, 2017

Package pmatch. October 19, 2018

Package eply. April 6, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package crossword.r. January 19, 2018

Package explor. R topics documented: October 10, Type Package Title Interactive Interfaces for Results Exploration Version 0.3.

Package qualmap. R topics documented: September 12, Type Package

Package wdman. January 23, 2017

Package datapasta. January 24, 2018

Package radix. September 17, 2018

Package bisect. April 16, 2018

Package censusr. R topics documented: June 14, Type Package Title Collect Data from the Census API Version 0.0.

Package spelling. December 18, 2017

Package calpassapi. August 25, 2018

Package spark. July 21, 2017

Package rgho. R topics documented: January 18, 2017

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package transformr. December 9, 2018

Package dbx. July 5, 2018

Package oec. R topics documented: May 11, Type Package

Package omu. August 2, 2018

Package shinyfeedback

Package semantic.dashboard

Package vinereg. August 10, 2018

Package tidyimpute. March 5, 2018

Package ezsummary. August 29, 2016

Package guardianapi. February 3, 2019

Package tabulizer. June 7, 2018

Package tidytransit. March 4, 2019

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package fitbitscraper

Package liftr. R topics documented: May 14, Type Package

Package postal. July 27, 2018

Package statsdk. September 30, 2017

Package mapsapi. March 12, 2018

Package mapedit. R topics documented: March 2, Title Interactive Editing of Spatial Data in R

Package glue. March 12, 2019

Package internetarchive

Package virustotal. May 1, 2017

Package available. November 17, 2017

Package clipr. June 23, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package tiler. June 9, 2018

Package wrswor. R topics documented: February 2, Type Package

Package tfruns. February 18, 2018

Package ezknitr. September 16, 2016

Package shinytest. May 7, 2018

Package RODBCext. July 31, 2017

Transcription:

Type Package Package processanimater Title Process Map Token Replay Animation Version 0.3.0 October 5, 2018 Token replay animation for process maps created with 'processmapr' by using SVG animations ('SMIL') and the 'htmlwidget' package. License MIT + file LICENSE Encoding UTF-8 LazyData true Imports bupar, processmapr (>= 0.3.1), rlang, magrittr, dplyr, htmlwidgets, DiagrammeR (>= 1.0.0), zoo, scales Suggests eventdatar, edear, testthat, knitr, rmarkdown, shiny, RColorBrewer RoxygenNote 6.1.0 URL https://github.com/fmannhardt/processanimater/ BugReports https://github.com/fmannhardt/processanimater/issues VignetteBuilder knitr NeedsCompilation no Author Felix Mannhardt [aut, cre], Gert Janssenswillen [ctb] Maintainer Felix Mannhardt <felix.mannhardt@sintef.no> Repository CRAN Date/Publication 2018-10-05 11:30:03 UTC R topics documented: add_token_color...................................... 2 add_token_size....................................... 3 animate_process....................................... 4 processanimateroutput................................... 7 renderprocessanimater................................... 8 1

2 add_token_color Index 9 add_token_color Adds a token color attribute Adds a color attribute to an event log that can be used in combination with the token_color parameter of animate_process add_token_color(eventlog, attribute, color_attribute, palette = "YlOrBr", na.color = "red", color_mapping = scales::col_numeric(palette, eventlog %>% pull(!! (attr)), na.color = na.color)) eventlog The source eventlog attribute The source attribute to calculate the color on color_attribute The target attribute to store the color information in palette na.color color_mapping The palette to use with the default color mapping The color for NA values A function that takes the attribute and returns a color, the default is using scales::col_numeric. Examples { # Load example event log library(eventdatar) # Add token color based on a numeric attribute add_token_color(patients, "time", "color") # Add token color based on a factor attribute add_token_color(patients, "employee", "color", color_mapping = scales::col_factor("set3", patients$employee)) }

add_token_size 3 add_token_size Adds a token size attribute Adds a size attribute to an event log that can be used in combination with the token_size parameter of animate_process add_token_size(eventlog, attribute, size_attribute, min.size = 2, max.size = 8, na.size = 2, size_mapping = size_numeric(eventlog %>% pull(!! (attr)), min.size, max.size, na.size)) eventlog attribute The source eventlog The source attribute to calculate the size on size_attribute The target attribute to store the size information in min.size max.size na.size size_mapping The minimum size The maximum size The size for NA values A function that takes the attribute and returns a size between min.size and max.size, the default is a linear transformation that only works for numeric attributes.. Examples { } # Load example event log library(eventdatar) # Generate random numeric attribute patients$test <- rnorm(nrow(patients), 5) # Add token size based on a numeric attribute add_token_size(patients, "test", "size")

4 animate_process animate_process Animate cases on a process map A function for creating a SVG animation of an event log on a process map created by processmapr. animate_process(eventlog, processmap = process_map(eventlog, render = F,...), animation_mode = c("absolute", "relative", "off"), animation_duration = 60, animation_jitter = 0, animation_timeline = TRUE, animation_legend = NULL, token_size = NULL, token_size_scale = c("identity", "linear", "sqrt", "log", "quantize", "ordinal", "time"), token_size_scale_domain = NULL, token_size_scale_range = NULL, token_color = NULL, token_color_scale = c("identity", "linear", "sqrt", "log", "quantize", "ordinal", "time"), token_color_scale_domain = NULL, token_color_scale_range = NULL, token_image = NULL, token_opacity = NULL, token_shape = c("circle", "rect", "image"), token_attributes = NULL, token_callback_onclick = c("function(svg_root, svg_element, case_id) {", "}"), activity_callback_onclick = c("function(svg_root, svg_element, activity_id) {", "}"), elementid = NULL, prerenderhook = NULL, width = NULL, height = NULL,...) eventlog processmap The event log object that should be animated The process map created with processmapr that the event log should be animated on, if not provided a standard process map will be generated by using processmapr::process_map. animation_mode Whether to animate the cases according to their actual time of occurence ("absolute") or to start all cases at once ("relative"). animation_duration The overall duration of the animation, all times are scaled according to this overall duration. animation_jitter The magnitude of a random coordinate translation, known as jitter in scatterplots, which is added to each token. Adding jitter can help to disambiguate tokens traveling on top of each other. animation_timeline Whether to render a timeline slider in supported browsers (Recent versions of Chrome and Firefox only).

animate_process 5 animation_legend Whether to show a legend for the size or the color scale. token_size The event attribute (character) or alternatively a data frame with three columns (case, time, size) matching the case identifier of the supplied event log. The token size is scaled accordingly during the animation (default size is 4). You may use add_token_size to add a suitable attribute to the event log. token_size_scale Which D3 scale function to use for generating the size scale. token_size_scale_domain The domain of the D3 scale function. Can be left NULL in which case it will be automatically determined. token_size_scale_range The range of the D3 scale function. Should be a vector of two or more numerical values. token_color The event attribute (character) or alternatively a data frame with three columns (case, time, color) matching the case identifier of the supplied event log. The token color is change accordingly during the animation (default color is orange). You may use add_token_color to add a suitable attribute to the event log. token_color_scale Which D3 scale function to use for generating the color scale. token_color_scale_domain The domain of the D3 scale function. Can be left NULL in which case it will be automatically determined. token_color_scale_range The range of the D3 scale function. Should be a vector of two or more numerical values. token_image token_opacity The event attribute (character) or alternatively a data frame with three columns (case, time, image) matching the case identifier of the supplied event log. The token image is change accordingly during the animation (by default a SVG shape is used). The event attribute (character) or alternatively a data frame with three columns (case, time, transparency) matching the case identifier of the supplied event log. The token fill-opacity is change accordingly during the animation (by default the token is drawn with 0.9 opacity). token_shape The (fixed) SVG shape to be used to draw tokens. Can be either circle (default), rect or image. In the latter case the image URL needs to be specified as parameter token_image. token_attributes A list of additional (fixed) SVG attributes to be added to each token. token_callback_onclick A javascript function that is called when a token is clicked. The function is parsed by JS and received three parameters: svg_root, svg_element, and case_id. activity_callback_onclick A javascript function that is called when an activity is clicked. The function is parsed by JS and received three parameters: svg_root, svg_element, and activity_id.

6 animate_process elementid passed through to createwidget. A custom elementid is useful to capture the selection events via input$elementid_tokens and input$elementid_activities when used in Shiny. prerenderhook width, height passed through to createwidget. Fixed size for widget (in css units). The default is NULL, which results in intelligent automatic sizing based on the widget s container.... Options passed on to process_map. Author(s) See Also Felix Mannhardt <felix.mannhardt@sintef.no> (SINTEF Digital) processmapr:process_map Examples # Create small example event log library(bupar) example_log <- bupar::eventlog( eventlog = data.frame( case = c(rep(1,6),rep(2,6),rep(3,8)), act = c(rep(c("a","a","b","b","c","c"),2), rep(c("a", "B", "D", "C"), each = 2)), act_id = rep(c(1:10),each=2), lifecycle = rep(c("start", "complete"),10), res = rep(sample(letters[1:3], 10, replace = TRUE), each = 2), time = as.posixct(c(0,5,10,15,20,25, 5,10,15,20,25,30, 10,20,30,40,50,60,70,80) * 600, origin = "2018/10/03")), case_id = "case", activity_id = "act", timestamp = "time", activity_instance_id = "act_id", lifecycle_id = "lifecycle", resource_id = "res") # Animate the process with default options (absolute time and 60s duration) animate_process(example_log) # Animate the process with default options (relative time and with jitter) animate_process(example_log, animation_mode = "relative", animation_jitter = 10) # Change default token sizes animate_process(example_log, token_size = 2) # Change default token color animate_process(example_log, token_color = "red")

processanimateroutput 7 # Change default token opacity animate_process(example_log, token_opacity = 0.5) # Change default token image (GIFs work too) animate_process(example_log, token_shape = "image", token_size = 10, token_image = "https://upload.wikimedia.org/wikipedia/en/5/5f/pacman.gif") # Change token color based on a factor attribute animate_process(example_log, animation_legend = "color", token_color = "res", token_color_scale = "ordinal", token_color_scale_range = RColorBrewer::brewer.pal(8, "Paired")) # This requires example data library(eventdatar) data(traffic_fines) # Change token color based on a numeric attribute, here the nonsensical 'time' of an event animate_process(edear::filter_trace_frequency(bupar::sample_n(traffic_fines,1000),percentage=0.95), animation_legend = "color", token_color = "amount", token_color_scale = "linear", token_color_scale_range = c("yellow","red"), animation_mode = "relative") processanimateroutput Create a process animation output element Renders a renderprocessanimater within an application page. processanimateroutput(outputid, width = "100%", height = "400px") outputid width, height Output variable to read the animation from Must be a valid CSS unit (like 100 which will be coerced to a string and have px appended.

8 renderprocessanimater renderprocessanimater Renders process animation output Renders a SVG process animation suitable to be used by processanimateroutput. renderprocessanimater(expr, env = parent.frame(), quoted = FALSE) expr env quoted The expression generating a process animation (animate_process). The environment in which to evaluate expr. Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Index add_token_color, 2, 5 add_token_size, 3, 5 animate_process, 2, 3, 4 createwidget, 6 JS, 5 process_map, 6 processanimateroutput, 7 renderprocessanimater, 8 9