THINK FIRST·CODE LATER

← All labs

From a task chain to linked views

Problem

Each input line is a chain of tasks separated by >, each task ACTION TARGET ATTRIBUTE…. Map actions to view types: summarize, discover, explore, browse → overview; identify, lookup, locate → detail; compare → comparison; present → presentation; annotate → annotation layer; record → provenance log; derive → new attribute. Each view type has a requirement text:

  • overview: an overview of all items (aggregate or dense chart)
  • detail: selection of one item + a detail view
  • comparison: juxtaposed or superimposed views of the compared items
  • presentation: a separate, static, annotated artifact for another audience
  • annotation layer: notes attached to marks; provenance log: saved states of the analysis; new attribute: a computed column before encoding

For each step print 3. identify features district -> detail: selection of one item + a detail view. Then interactive views: 3 (overview, detail, comparison) (distinct non-presentation view types in order of first use), links needed: overview->detail, detail->comparison (each change of view type between consecutive steps, ignoring changes to/from presentation, without repeats; or none), and, if the chain contains present, note: the presentation step needs a different artifact, not the dashboard. Print an empty line after each chain.

Data for this lab

Your program reads its data from standard input. Download the file, then give it to your program as shown below. Start with data set 1: its expected output is given.

v3-4-data-1.txt

summarize distribution pm25 > discover outliers pm25 > identify features district > compare trends pm25 > present trends pm25
What your program must print for v3-4-data-1.txt
1. summarize distribution pm25 -> overview: an overview of all items (aggregate or dense chart)
2. discover outliers pm25 -> overview: an overview of all items (aggregate or dense chart)
3. identify features district -> detail: selection of one item + a detail view
4. compare trends pm25 -> comparison: juxtaposed or superimposed views of the compared items
5. present trends pm25 -> presentation: a separate, static, annotated artifact for another audience
interactive views: 3 (overview, detail, comparison)
links needed: overview->detail, detail->comparison
note: the presentation step needs a different artifact, not the dashboard

Run your program first, then open this and compare line by line: your output must contain these lines exactly.

How to give the file to my program

Terminal (macOS, Linux, or Windows Command Prompt), in the folder that holds both files:

python my_lab.py < v3-4-data-1.txt

Windows PowerShell (the default terminal of VS Code on Windows) does not understand <:

Get-Content v3-4-data-1.txt | python my_lab.py

PyCharm: Run → Edit Configurations → tick Redirect input from and choose the file.

Jupyter: put this at the top of the cell that holds your program:

import sys
sys.stdin = open("v3-4-data-1.txt", encoding="utf-8")

Write it here, in Jupyter or in your IDE, then paste it. Run it on the sample input yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.