Public
Edited
Dec 23, 2022
Insert cell
Insert cell
Insert cell
testJobs = FileAttachment("githubTestJobs.json").json()
Insert cell
Insert cell
Inputs.table(testJobs)
Insert cell
Insert cell
// create a new Plot:
Plot.plot({
// add some marks to the Plot:
marks: [
// create a "cell" type mark:
Plot.cell(
testJobs, // use the "testJobs" data
{
x: "run_number", // set the X position of each cell based on its "run_number" value
y: "name" // set the Y position of each cell based on its "name" value
}
)
],
width: width, // set the Plot's width to the cell width (using Observable's builtin "width" value)
marginLeft: 160, // make room for the "name" labels on the Y axis at left
marginBottom: 50, // make room for the "run_number" labels on the X axis at bottom
x: { tickRotate: 45 } // rotate the X-axis labels for readability
})
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.cell(testJobs, {
x: "run_number",
y: "name",
// TODO add a new channel here to visualize test conclusion as the cell's fill (color)
fill: "conclusion"
})
],
width: width,
marginLeft: 160,
marginBottom: 50,
x: { tickRotate: 45 }
})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.cell(testJobs, {
x: "run_number",
y: "name",
fill: "conclusion"
})
],
color: {
// TODO set color scale properties here
domain : ['success', 'failure', 'cancelled'],
range: ['green', 'red', 'grey']
},
width: width,
marginLeft: 160,
marginBottom: 50,
x: { tickRotate: 45 }
})
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.cell(testJobs, {
x: "run_number",
y: "name",
fill: "conclusion",
// TODO add new channel(s) here
fillOpacity: "minutes",
stroke: "conclusion"
})
],
color: {
domain: ["success", "failure", "cancelled"],
range: ["green", "red", "grey"]
},
width: width,
marginLeft: 160,
marginBottom: 50,
x: { tickRotate: 45 }
})
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.cell(testJobs, {
x: "run_number",
y: "name",
fill: "conclusion",
fillOpacity: "minutes",
stroke: "conclusion",
title: (d) => `${d.conclusion} after ${d.minutes.toFixed(2)} min`,
// TODO add a title channel with a custom function
})
],
color: {
domain: ["success", "failure", "cancelled"],
range: ["green", "red", "grey"]
},
width: width,
marginLeft: 160,
marginBottom: 50,
x: { tickRotate: 45 }
})
Insert cell
Insert cell
Insert cell
finishedTests = Plot.plot({
marks: [
Plot.cell(testJobs, {
x: "run_number",
y: "name",
fill: "conclusion",
fillOpacity: "minutes",
stroke: "conclusion",
title: (d) => `${d.conclusion} after ${d.minutes.toFixed(2)} min`
})
],
color: {
domain: ["success", "failure", "cancelled"],
range: ["green", "red", "grey"]
},
width: width,
marginLeft: 160,
marginBottom: 50,
x: { tickRotate: 45 }
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more