Tumor Shrinkage: Efficacy Dataset Waterfall
Waterfall graphs provide a clear, visual representation of data over time, making them ideal for tracking project progress or budget allocation. They are particularly useful for illustrating cumulative effects, showing how individual components contribute to a final total. Understanding waterfall charts enhances data interpretation, leading to better decision-making across various fields, from finance to software development. Their simplicity facilitates quick comprehension of complex datasets, enabling effective communication of key trends and insights.
<html>
<head>
<!-- Include the CanvasXpress library in your HTML file -->
<link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
<script src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>
</head>
<body>
<!-- Create a canvas element for the chart with the desired dimensions -->
<div>
<canvas id="canvasId" width="600" height="600"></canvas>
</div>
<!-- Create a script to initialize the chart -->
<script>
// Use a data frame (2D-array) for the graph
var data = [
[ "Id", "Shrinkage", "Tissue", "Status"],
[ "1001", 115, "Pancreas", "PD"],
[ "1002", 75, "Pancreas", "PD"],
[ "1003", 39, "Pancreas", "PD"],
[ "1004", 23, "Colrectal", "PD"],
[ "1005", 22, "Breast", "PD"],
[ "1006", 15, "Colrectal", "PD"],
[ "1007", 12, "Colrectal", "SD"],
[ "1008", 10, "Colrectal", "PD"],
[ "1009", 10, "Billiary tract", "PD"],
[ "1010", 10, "Colrectal", "PD"],
[ "1011", 5, "Esophagus", "PD"],
[ "1012", 4, "Billiary tract", "PD"],
[ "1013", 2, "Billiary tract", "SD"],
[ "1014", -8, "Billiary tract", "SD"],
[ "1015", -11, "Colrectal", "SD"],
[ "1016", -31, "Billiary tract", "PR" ]
];
// Create the configuration for the graph
var config = {
"colorBy" : "Tissue",
"colorScheme" : "NEJM",
"graphOrientation" : "vertical",
"graphType" : "Bar",
"legendInside" : true,
"legendKeyBackgroundBorderColor" : "rgba(255,255,255,0)",
"legendKeyBackgroundColor" : "rgba(255,255,255,0)",
"legendPosition" : "topRight",
"showSampleNames" : false,
"smpOverlayProperties" : {
"Status" : {
"position" : "bottom",
"scheme" : "White"
}
},
"smpOverlays" : ["Status"],
"title" : "Clinical Trial",
"xAxis2Show" : false,
"xAxisTitle" : "Best tumor shrinkage (%)",
"xAxis" : ["Shrinkage"]
}
// Event used to create graph (optional)
var events = false
// Call the CanvasXpress function to create the graph
var cX = new CanvasXpress("canvasId", data, config, events);
</script>
</body>
</html>
<html>
<head>
<!-- Include the CanvasXpress library in your HTML file -->
<link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
<script src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>
</head>
<body>
<!-- Create a canvas element for the chart with the desired dimensions -->
<div>
<canvas id="canvasId" width="600" height="600"></canvas>
</div>
<!-- Create a script to initialize the chart -->
<script>
// Create the data for the graph
var data = {
"x" : {
"Status" : ["PD","PD","PD","PD","PD","PD","SD","PD","PD","PD","PD","PD","SD","SD","SD","PR"],
"Tissue" : ["Pancreas","Pancreas","Pancreas","Colrectal","Breast","Colrectal","Colrectal","Colrectal","Billiary tract","Colrectal","Esophagus","Billiary tract","Billiary tract","Billiary tract","Colrectal","Billiary tract"]
},
"y" : {
"data" : [
[115,75,39,23,22,15,12,10,10,10,5,4,2,-8,-11,-31]
],
"smps" : ["1001","1002","1003","1004","1005","1006","1007","1008","1009","1010","1011","1012","1013","1014","1015","1016"],
"vars" : ["Shrinkage"]
}
}
// Create the configuration for the graph
var config = {
"colorBy" : "Tissue",
"colorScheme" : "NEJM",
"graphOrientation" : "vertical",
"graphType" : "Bar",
"legendInside" : true,
"legendKeyBackgroundBorderColor" : "rgba(255,255,255,0)",
"legendKeyBackgroundColor" : "rgba(255,255,255,0)",
"legendPosition" : "topRight",
"showSampleNames" : false,
"smpOverlayProperties" : {
"Status" : {
"position" : "bottom",
"scheme" : "White"
}
},
"smpOverlays" : ["Status"],
"title" : "Clinical Trial",
"xAxis2Show" : false,
"xAxisTitle" : "Best tumor shrinkage (%)",
"xAxis" : ["Shrinkage"]
}
// Event used to create graph (optional)
var events = false
// Call the CanvasXpress function to create the graph
var cX = new CanvasXpress("canvasId", data, config, events);
</script>
</body>
</html>
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/r/cX-waterfall2-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
x=read.table("https://www.canvasxpress.org/data/r/cX-waterfall2-smp.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
data=y,
smpAnnot=x,
colorBy="Tissue",
colorScheme="NEJM",
graphOrientation="vertical",
graphType="Bar",
legendInside=TRUE,
legendKeyBackgroundBorderColor="rgba(255,255,255,0)",
legendKeyBackgroundColor="rgba(255,255,255,0)",
legendPosition="topRight",
showSampleNames=FALSE,
smpOverlayProperties=list(Status=list(position="bottom", scheme="White")),
smpOverlays=list("Status"),
title="Clinical Trial",
xAxis=list("Shrinkage"),
xAxis2Show=FALSE,
xAxisTitle="Best tumor shrinkage (%)"
)




