Skip to content

Commit

Permalink
Merge branch 'develop' into smol_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ehinman committed Aug 19, 2023
2 parents 3f5405c + 92e1601 commit d55d992
Show file tree
Hide file tree
Showing 9 changed files with 363 additions and 182 deletions.
27 changes: 15 additions & 12 deletions R/Figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -559,33 +559,36 @@ TADA_Scatterplot <- function(.data, id_cols = c("TADA.ComparableDataIdentifier")
plot.data <- subset(.data, .data$Group == i)
groupid <- paste0(unique(plot.data[, id_cols]), collapse = "_")

# units lable for y axis
# units label for y axis
unit <- unique(plot.data$TADA.ResultMeasure.MeasureUnitCode)
y_label <- "Activity Start Date and Time"

# include depth in hover info
depth <- plot.data$ResultDepthHeightMeasure.MeasureValue
plot.data$TADA.DateTime <- as.POSIXct(paste(plot.data$ActivityStartDate, plot.data$ActivityStartTime.Time), format = "%Y-%m-%d %H:%M:%S")


# construct plotly scatterplot
one_scatterplot <- plotly::plot_ly(
data = plot.data,
type = "scatter",
mode = "markers",
x = plot.data$TADA.DateTime,
x = plot.data$ActivityStartDateTime, # currently uses start date and time, may want to change to just ActivityStartDate after aggregation functions are written
y = plot.data$TADA.ResultMeasureValue,
# color = plot.data$TADA.ResultMeasureValue,
marker = list(color = "#00bde3"),
stroke = I("#005ea2"),
name = "<b>All Data<b>",
hoverinfo = "text",
hovertext = paste(
"Result:", plot.data$TADA.ResultMeasureValue, "<br>",
"DateTime:", plot.data$TADA.DateTime, "<br>",
"ResultDepth:", depth
)
"Result:", paste0(plot.data$TADA.ResultMeasureValue, " ", plot.data$TADA.ResultMeasure.MeasureUnitCode), "<br>",
"Date Time:", plot.data$ActivityStartDateTime, "<br>",
"Result Depth:", paste0(plot.data$TADA.ResultDepthHeightMeasure.MeasureValue, " ",
plot.data$TADA.ResultDepthHeightMeasure.MeasureUnitCode), "<br>",
"Activity Relative Depth Name:", plot.data$ActivityRelativeDepthName, "<br>",
"Activity Depth:", paste0(plot.data$TADA.ActivityDepthHeightMeasure.MeasureValue, " ",
plot.data$TADA.ActivityDepthHeightMeasure.MeasureUnitCode), "<br>",
"Activity Top Depth:", paste0(plot.data$TADA.ActivityTopDepthHeightMeasure.MeasureValue, " ",
plot.data$TADA.ActivityTopDepthHeightMeasure.MeasureUnitCode), "<br>",
"Activity Bottom Depth:", paste0(plot.data$TADA.ActivityBottomDepthHeightMeasure.MeasureValue, " ",
plot.data$TADA.ActivityBottomDepthHeightMeasure.MeasureUnitCode), "<br>")
)

# figure margin
mrg <- list(
l = 50, r = 20,
Expand Down
Loading

0 comments on commit d55d992

Please sign in to comment.