task_and_goals = {
const width = 1100;
const height = 700;
const colors = {
background: "#FBFAF7",
future: "#F7F2E9",
surface: "#EDE7DA",
border: "#C8C2B8",
text: "#1A1714",
muted: "#6E6560",
navy: "#1E3A5F",
gold: "#B8821A",
goldFill: "#F3E7C9",
accent: "#A63D2F",
accentFill: "#F1DDD8"
};
const svg = d3.create("svg")
.attr("role", "img")
.attr("aria-label", "A repeated task episode. The task, current capability and a tool's affordances and capability demands determine which strategies are feasible. Task conditions and incentives, together with task and learning goals, shape the expected benefits and costs of those strategies and inform the chosen strategy. The person and tool enact a division of operations, producing current performance and learning-relevant activity and feedback. Any resulting capability becomes a resource in the next task episode and informs the next strategy decision.")
.attr("viewBox", `0 0 ${width} ${height}`)
.attr("width", "100%")
.style("max-width", "980px")
.style("height", "auto")
.style("display", "block")
.style("margin", "0 auto")
.style("font-family", '"Space Grotesk", sans-serif');
const defs = svg.append("defs");
defs.append("marker")
.attr("id", "sequence-arrow")
.attr("viewBox", "0 0 10 10")
.attr("refX", 9)
.attr("refY", 5)
.attr("markerUnits", "userSpaceOnUse")
.attr("markerWidth", 8)
.attr("markerHeight", 8)
.attr("orient", "auto-start-reverse")
.append("path")
.attr("d", "M 1 1.5 L 9 5 L 1 8.5 z")
.attr("fill", colors.muted);
const line = (path, {dashed = false, both = false, end = true, stroke = colors.muted, width = 2.2} = {}) => {
svg.append("path")
.attr("d", path)
.attr("fill", "none")
.attr("stroke", stroke)
.attr("stroke-width", width)
.attr("stroke-linecap", "round")
.attr("stroke-linejoin", "round")
.attr("stroke-dasharray", dashed ? "7 7" : null)
.attr("marker-start", both ? "url(#sequence-arrow)" : null)
.attr("marker-end", end ? "url(#sequence-arrow)" : null);
};
const textLines = (group, lines, {x, y, size = 14, fill = colors.text, anchor = "middle", lineHeight = 18, weight = 400} = {}) => {
const text = group.append("text")
.attr("x", x)
.attr("y", y)
.attr("text-anchor", anchor)
.attr("font-size", size)
.attr("font-weight", weight)
.attr("fill", fill);
lines.forEach((entry, index) => {
text.append("tspan")
.attr("x", x)
.attr("dy", index === 0 ? 0 : lineHeight)
.text(entry);
});
};
const box = ({x, y, width: boxWidth, height: boxHeight, title, lines = [], fill = colors.surface, stroke = colors.border, titleSize = 17, textSize = 13.5}) => {
const group = svg.append("g");
group.append("rect")
.attr("x", x)
.attr("y", y)
.attr("width", boxWidth)
.attr("height", boxHeight)
.attr("rx", 10)
.attr("fill", fill)
.attr("stroke", stroke)
.attr("stroke-width", 2.1);
group.append("text")
.attr("x", x + boxWidth / 2)
.attr("y", y + 27)
.attr("text-anchor", "middle")
.attr("font-size", titleSize)
.attr("font-weight", 700)
.attr("fill", colors.text)
.text(title);
textLines(group, lines, {
x: x + boxWidth / 2,
y: y + 51,
size: textSize,
lineHeight: 18
});
};
const panel = ({x, y, width: panelWidth, height: panelHeight, title, fill}) => {
const group = svg.append("g");
group.append("rect")
.attr("x", x)
.attr("y", y)
.attr("width", panelWidth)
.attr("height", panelHeight)
.attr("rx", 16)
.attr("fill", fill)
.attr("stroke", colors.border)
.attr("stroke-width", 1.8);
group.append("text")
.attr("x", x + 18)
.attr("y", y + 29)
.attr("font-size", 17)
.attr("font-weight", 700)
.attr("fill", colors.navy)
.text(title);
};
const toolBox = ({x, y, width: boxWidth, height: boxHeight}) => {
const group = svg.append("g");
group.append("rect")
.attr("x", x)
.attr("y", y)
.attr("width", boxWidth)
.attr("height", boxHeight)
.attr("rx", 10)
.attr("fill", colors.surface)
.attr("stroke", colors.navy)
.attr("stroke-width", 2.1);
group.append("text")
.attr("x", x + boxWidth / 2)
.attr("y", y + 26)
.attr("text-anchor", "middle")
.attr("font-size", 17)
.attr("font-weight", 700)
.attr("fill", colors.text)
.text("Available tool");
group.append("line")
.attr("x1", x + boxWidth / 2)
.attr("x2", x + boxWidth / 2)
.attr("y1", y + 38)
.attr("y2", y + boxHeight - 10)
.attr("stroke", colors.border)
.attr("stroke-width", 1.5);
textLines(group, ["Affordances"], {
x: x + boxWidth * 0.25,
y: y + 53,
size: 13.5,
fill: colors.navy,
weight: 700
});
textLines(group, ["operations it can", "support or perform"], {
x: x + boxWidth * 0.25,
y: y + 73,
size: 12.5,
lineHeight: 16
});
textLines(group, ["Capability demands"], {
x: x + boxWidth * 0.75,
y: y + 53,
size: 13.5,
fill: colors.navy,
weight: 700
});
textLines(group, ["skills needed to", "use and check it"], {
x: x + boxWidth * 0.75,
y: y + 73,
size: 12.5,
lineHeight: 16
});
};
panel({x: 16, y: 48, width: 805, height: 632, title: "Episode t: current task", fill: colors.background});
panel({x: 840, y: 48, width: 244, height: 632, title: "Episode t + 1", fill: colors.future});
// Relations are drawn before the nodes so that arrowheads terminate cleanly at their borders.
line("M 133 220 C 133 232, 520 225, 520 245");
line("M 341 220 C 341 232, 585 225, 585 245");
line("M 626 220 L 626 245");
line("M 133 325 C 133 343, 340 335, 340 350");
line("M 341 325 L 410 350");
line("M 626 335 C 626 345, 500 340, 500 350");
line("M 38 160 C 24 160, 24 405, 60 405 L 275 405");
line("M 420 428 L 420 438");
line("M 355 492 L 460 492", {both: true});
line("M 409 550 L 409 562 L 205 580");
line("M 409 562 L 605 570");
line("M 780 617 C 825 617, 825 160, 867 160", {dashed: true, stroke: colors.accent});
line("M 1057 160 C 1069 160, 1076 168, 1076 180 L 1076 490 C 1076 502, 1070 510, 1064 510");
line("M 962 385 L 962 465");
box({
x: 38, y: 100, width: 190, height: 120,
title: "Conditions and incentives",
lines: ["information, operations,", "constraints, assessment, time,", "feedback and consequences"],
stroke: colors.navy,
titleSize: 14.5,
textSize: 12.2
});
box({
x: 246, y: 100, width: 190, height: 120,
title: "Capability Cₜ",
lines: ["prior knowledge, skills", "time and attention"],
stroke: colors.navy
});
toolBox({x: 454, y: 100, width: 345, height: 120});
box({
x: 38, y: 245, width: 190, height: 80,
title: "Task goal",
lines: ["desired performance now"],
fill: colors.goldFill,
stroke: colors.gold,
titleSize: 16.5,
textSize: 12.5
});
box({
x: 246, y: 245, width: 190, height: 80,
title: "Learning goal",
lines: ["desired later capability"],
fill: colors.accentFill,
stroke: colors.accent,
titleSize: 16.5,
textSize: 12.5
});
box({
x: 454, y: 245, width: 345, height: 90,
title: "Strategies feasible now",
lines: ["given the task, current capability,", "tool affordances and capability demands"],
stroke: colors.navy,
titleSize: 16.5,
textSize: 12.5
});
box({
x: 275, y: 350, width: 290, height: 78,
title: "Chosen strategy",
lines: ["expected benefits and costs", "under these conditions"],
fill: colors.goldFill,
stroke: colors.gold,
titleSize: 16.5,
textSize: 12.5
});
const enacted = svg.append("g");
enacted.append("rect")
.attr("x", 38)
.attr("y", 438)
.attr("width", 742)
.attr("height", 112)
.attr("rx", 12)
.attr("fill", "none")
.attr("stroke", colors.border)
.attr("stroke-width", 1.7)
.attr("stroke-dasharray", "6 6");
enacted.append("text")
.attr("x", 409)
.attr("y", 457)
.attr("text-anchor", "middle")
.attr("font-size", 13)
.attr("font-weight", 700)
.attr("fill", colors.muted)
.text("ENACTED DIVISION OF OPERATIONS");
box({
x: 55, y: 466, width: 300, height: 68,
title: "Person's operations",
lines: ["perceive, decide, interpret, check, act"],
stroke: colors.navy,
titleSize: 16,
textSize: 12.5
});
box({
x: 460, y: 466, width: 300, height: 68,
title: "Tool's operations",
lines: ["represent, retain, generate or execute"],
stroke: colors.border,
titleSize: 16,
textSize: 12.5
});
box({
x: 55, y: 580, width: 300, height: 85,
title: "Performance now",
lines: ["what is accomplished", "with assistance"],
fill: colors.goldFill,
stroke: colors.gold,
titleSize: 17,
textSize: 13
});
box({
x: 430, y: 570, width: 350, height: 95,
title: "Learning-relevant activity and feedback",
lines: ["what the person attends to, practises,", "interprets and receives feedback on"],
fill: colors.accentFill,
stroke: colors.accent,
titleSize: 15.5,
textSize: 12.5
});
box({
x: 867, y: 100, width: 190, height: 120,
title: "Capability Cₜ₊₁",
lines: ["prior knowledge, skills", "time and attention"],
stroke: colors.navy
});
box({
x: 860, y: 285, width: 204, height: 100,
title: "New task and tool",
lines: ["new conditions, goals,", "incentives, affordances", "and demands"],
stroke: colors.navy,
titleSize: 15.5,
textSize: 12.5
});
box({
x: 860, y: 465, width: 204, height: 90,
title: "Next strategy decision",
lines: ["task, capability and tool", "set feasibility; incentives", "shape expected value"],
fill: colors.surface,
stroke: colors.navy,
titleSize: 15.5,
textSize: 11.5
});
return svg.node();
}