Visualising data using python and SVG

Data visualisation is crucial for interpreting complex datasets. Standard plots like line charts and scatterplots are useful but often fall short when you're working with complex data. In those cases, we need custom visual design. The javascript D3 library (Document Driven Documents) is the "go to" for creating these, but has a steep learning curve.

We've developed a data visualisation tutorial series for pythonistas, using SVG, Marimo and anywidget. Below is a list of Marimo notebooks designed to guide you through various aspects of custom data visualisation.

Tutorials

  1. Setting things up
  2. Plotting using the Altair library
  3. HTML and CSS
  4. SVG: Scalable Vector Graphics
  5. From data to SVG elements
  6. Creating SVG with python
  7. Visualising an airport dataset
  8. Filtering data using marimo widgets
  9. Creating custom visuals
  10. Creating tooltips
  11. Advanced: anywidget
  12. Advanced: brushing and linking
  13. Advanced: drawing to canvas
Important: to run the actual notebooks and get access to simple exercises, clone the code from out gitlab repository.

Additional resources

  1. Cheatsheet PDF
  2. Gotchas
  3. Worked example: Sequence Diversity Diagram
  4. Worked example: Bacteriophage experiment results

If you have questions/suggestions, you can find my email on my "who's who" profile at KU Leuven.

A big thank you to the Marimo and anywidget communities, especially Trevor Manz, Myles Scolnick and Akshay Agrawal.

These tutorials are created in the context of the Data Visualisation in Data Science course at KU Leuven, Belgium, and a biological data visualisation workshop at the European Bioinformatics Institute.