Lesson 9
Previous Lesson | Course Home | Next Lesson

Sketching in Code 2

Looking at the other elements we can bring into our work... text, images, data, and the user. Please try to complete the remaining tutorials under Skills Lab 3 at Labs.

If you are having trouble, you may optionally elect to engage AI assistants. If that is of interest, check out the bonus Lesson 26 on using AI.

Lesson Table of Contents

Video

No video for this lesson.

Lesson outline

View lesson outline

Lesson 9: Skills Lab 4

Sketching with code continued.

Objective

Continue exploration of creative coding with Python by integrating text, images, data, and user interaction into code-based visualizations.

Outline

Building on the foundational concepts from Sketching in Code 1, this lecture focuses on integrating multiple modalities into data visualizations and adding interactivity to engage users. We bridge the gap between static visualizations and interactive experiences.

Adding text to visualizations

Text serves as a critical component of data visualization, providing labels, annotations, context, and explanation.

  • Font selection and typography
  • Text positioning and alignment
  • Readability and legibility
  • Text as a visual element (glyphs)
Working with images

Incorporating images into sketches expands creative possibilities.

  • Loading and displaying image files
  • Image manipulation and transformation
  • Using images as data sources
  • Combining images with generative graphics
Data integration

Moving from abstract graphics to data-driven visualizations.

  • Loading data from files (CSV, JSON, etc.)
  • Parsing and processing data structures
  • Mapping data values to visual properties
  • Creating dynamic visualizations from datasets
User interaction fundamentals

Introduction to interactive programming with event-driven concepts.

  • Event-driven programming concepts
  • Mouse and keyboard input
  • State management in interactive sketches
  • Feedback mechanisms for user actions
Considerations for interactivity

When designing interaction, focus on one primary user action at a time and ensure interactions respond meaningfully to their context.

  • Single actions: Click, hover, keys
  • Visual feedback that relates to the interaction
  • State changes that reflect user intent
  • Progressive disclosure of information
  • Balancing complexity with usability
Skills Lab 3

This lecture primarily consists of hands-on tutorials rather than traditional slides.

  • Tutorial 11 covers working with text in Sketchingpy
  • Incorporating images into your sketches
  • Loading and visualizing data
  • Creating basic interactions
  • Sketchingpy Online Editor available at https://editor.sketchingpy.org/
Building on previous concepts

This lecture builds directly on concepts from earlier in the course.

  • Gestalt principles (Lecture 7): Apply proximity, similarity, and continuity to guide users through interactive experiences
  • Pre-attentive features (Lectures 6-7): Use color, motion, and position to draw attention to interactive elements and provide feedback
  • Visual encoding (Lectures 1, 5): Continue using effective encoding devices while adding the dimension of interaction
Connections to data visualization perspectives

Adding these elements continues our exploration of multiple perspectives on data visualization.

  • Data visualization as representation: How information becomes visible through code
  • Data visualization as task: Interactive elements support user tasks by allowing exploration and manipulation of data
  • Data visualization as message: Text and images enhance storytelling capabilities, while interaction can guide readers through a narrative
  • Data visualization as dialogue: User interaction begins the transition from passive viewing to active participation in the visualization experience

Take Aways

Text, images, data, and user interaction offer engagement, exploration, and storytelling.

  • Text provides essential context and can serve as a visual design element
  • Images expand creative possibilities and can be used as data sources
  • Data integration enables creating visualizations that respond to real-world information
  • Simple single-action interactions create meaningful user engagement
  • Interactive design builds on Gestalt principles and pre-attentive features
  • Event-driven programming patterns enable responsive, stateful visualizations

Citations

[1] Thanks to https://badriadhikari.github.io/data-viz-workshop-2021/minards/ for imagery.

License

This lesson is part of Interactive Data Science and Visualization and is released under a CC-BY-NC 4.0 license.

Download outline as markdown

Exercise

For this follow up exercise, we are going to add interactivity. Specifically, add interaction that uses only a single action or verb like hover or click. This action could be contextualized like we saw in Skills Lab 4's rotating color wheels. However, the goal is to explore how our work can respond to a simple user action.

Note that the Zulip community is not available to this MOOC. Please consider sharing your exercise via social media such as Bluesky with the tag #OpenDataVizSciCourse.

Next lecture

Ready to continue? Go to the next lesson.