Sketching in Code 1
Lesson Table of Contents
Video
Resources mentioned in the video can be found in links. Videos are hosted by Vimeo. You can load the video as an embed within this page or may view the video on Vimeo in a separate window / tab. If you enable on-site video, your preference will be remembered using a cookie.
Resources mentioned in the video can be found in links. Videos are hosted by Vimeo. You may disable Video Embeds or view the video on Vimeo.
Links
Lesson outline
View lesson outline
Lesson 8: Skill Lab 3
Sketching in code.
Objective
Use code to draw graphics as guided by recent concepts from class including preattentive features, introducing Skills Lab 3 with a focus on drawing glyphs through code.
Outline
This lecture bridges theoretical concepts from previous lessons (Gestalt Principles, preattentive features, color theory) with practical coding skills for drawing custom visualizations. Students work through tutorials at their own pace using a flipped classroom model, focusing on hands-on practice with Sketchingpy. The lecture prepares students to build artistic graphics that explore Gestalt Principles and preattentive features, setting the foundation for more complex interactive visualizations.
Drawing glyphs with code
Using programming to create custom visual elements (glyphs) that can be repeated, modified, and arranged to visualize data.
- Tutorial goal: Complete through Tutorial 7 in Skills Lab 3.
- Learning to draw basic shapes programmatically.
- Combining shapes to create meaningful visual elements.
- Applying preattentive features through code.
- Provides flexibility beyond standard chart types while applying principles learned in earlier lectures.
Practical application of previous concepts
Students learn to implement the perceptual principles covered in Lecture 7 through code.
- Gestalt Principles in code: proximity (grouping elements by distance), similarity (grouping by color, size, shape), continuity (creating visual flow), closure (implied shapes), and figure-ground relationships.
- Preattentive features in code: implementing visual features that are processed rapidly by the human visual system including color variations, size differences, orientation changes, position encoding, and shape distinctions.
Flipped classroom learning model
Asynchronous tutorial work through the Skills Labs with peer support and community learning opportunities.
- Self-paced progression through tutorials.
- Hands-on experimentation encouraged.
- Building up complexity gradually.
- Office hours for individual guidance.
- Portfolio development through assignments.
Creative coding assignment
Build an artistic graphic drawn using code that explores at least one Gestalt Principle and at least one preattentive feature.
- Sketchingpy editor recommended for submission.
- Must include instructions on how to run the code.
- Must specify open source license (e.g., BSD-3-Clause License).
- Alternative tools require prior discussion with instructor.
- No interactivity required (yet), will be refined in follow-up assignment.
- Practice for building highly customized visualizations bridging art and data visualization.
- Foundation for data-driven graphics and portfolio piece development.
- Inspiration sources: Sketchingpy examples gallery, OpenProcessing trending projects, Genuary creative coding prompts.
Take Aways
This lecture transitions from theory to practice, using coding to implement perceptual principles learned in earlier lectures while establishing a foundation for customized data visualizations.
- Code provides flexibility to create custom visual elements beyond standard chart types.
- Gestalt Principles and preattentive features can be programmatically implemented.
- Flipped classroom model enables self-paced learning with community support.
- Creative coding assignment builds foundation for future interactive visualizations.
- First step in portfolio development toward more complex data-driven graphics.
Citations
[1] B. Adhikari, "Marey's train schedule," University of Missouri Saint Louis, 2021. Available: https://badriadhikari.github.io/data-viz-workshop-2021/minards/
[2] A. Pottinger and Sketchingpy Contributors, "Sketchingpy," Sketchingpy Project, 2025. Available: https://sketchingpy.org/
[3] OpenProcessing, "Discover Trending Projects," OpenProcessing, 2025. Available: https://openprocessing.org/discover/#/trending
[4] Genuary, "Genuary Creative Coding Prompts," Genuary, 2025. Available: https://genuary.art
License
This lesson is part of Interactive Data Science and Visualization and is released under a CC-BY-NC 4.0 license.
Written materials
Exercise
We are going to do a little creative coding where we will build up a sketch over the next two exercises. This doesn't need to be too complicated or even too much code. Also, don't worry if this first attempt is a little rough. You will get a chance to refine your work!
All that said, please use the concepts we have been exploring from class to build an artistic graphic that is drawn using code. In this piece, please explore at least one Gestalt Principle and one Pre-attentive Feature. This will offer important practice for drawing graphics relevant to building highly customized visualizations. For this submission, please do not make it interactive yet. We will do that in the follow up activity! Need inspiration? Check out the following...
If you are new to programming, you may optionally elect to engage AI assistants. If that is of interest, check out the bonus Lesson 26 on using AI.
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.
Reading
Next lecture
Works cited
This is the works cited from the lecture. Note that additional sources may be used in exercises and other supporting documentation.
- Thanks for imagery. Available: https://badriadhikari.github.io/data-viz-workshop-2021/minards/