From 23cacc4fed9e655c1de5392b2abd6652aa33a356 Mon Sep 17 00:00:00 2001 From: "Lucas M. Schnorr" Date: Fri, 28 May 2021 11:48:12 -0300 Subject: [PATCH] update draw_gantt.R script to work with pajengr todo - need to test with a recent version of S4U trace --- docs/source/tuto_s4u/draw_gantt.R | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/source/tuto_s4u/draw_gantt.R b/docs/source/tuto_s4u/draw_gantt.R index 3e9afb7157..ecc2cc4526 100644 --- a/docs/source/tuto_s4u/draw_gantt.R +++ b/docs/source/tuto_s4u/draw_gantt.R @@ -1,14 +1,17 @@ #!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) -library(ggplot2) +library(tidyverse) library(pajengr) # Load and relabel the data df = pajeng_read(args[1]) -names(df$state) = c("Type", "Actor", "Container", "Start", "End", "Duration", "Level", "State") - -# Actually draw the graph -p = ggplot(df$state) + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor,color=State), size=5) +df$state %>% + # rename some columns to use simgrid terminology + rename(Actor = Container, + State = Value) %>% + # do the plot + ggplot() + + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor, color=State), size=5) -> p # Cosmetics to compact the resulting graph p.height <- length(unique(df$state$Actor)) * 0.05 + 2 -- 2.20.1