Skip to content

Commit

Permalink
Add docs section with potential classroom activities (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefmolin authored Aug 30, 2024
1 parent 8c208e3 commit c16e3dc
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<hr/>
</div>

Data Morph transforms an input dataset of 2D points into select shapes, while preserving the summary statistics to a given number of decimal points through simulated annealing.
Data Morph transforms an input dataset of 2D points into select shapes, while preserving the summary statistics to a given number of decimal points through simulated annealing. It is intended to be used as a teaching tool to illustrate the importance of data visualization (see the [Data Morph in the Classroom](https://github.com/stefmolin/data-morph/#data-morph-in-the-classroom) section for ideas).

<div align="center">
<img alt="Morphing the panda dataset into the star shape." src="https://raw.githubusercontent.com/stefmolin/data-morph/main/docs/_static/panda-to-star-eased.gif">
Expand Down Expand Up @@ -156,11 +156,21 @@ In this example, we morphed the built-in panda `Dataset` into the star `Shape`.

* The `ShapeFactory.AVAILABLE_SHAPES` attribute contains a list of available shapes, which are also visualized in the `ShapeFactory` documentation.

## Data Morph in the Classroom

Data Morph is intended to be used as a teaching tool to illustrate the importance of data visualization. Here are some potential classroom activities for instructors:

- **Statistics Focus**: Have students pick one of the [built-in datasets](https://stefaniemolin.com/data-morph/stable/api/data_morph.data.loader.html#data_morph.data.loader.DataLoader), and morph it into all available [target shapes](https://stefaniemolin.com/data-morph/stable/api/data_morph.shapes.factory.html#data_morph.shapes.factory.ShapeFactory). Ask students to comment on which transformations worked best and why.
- **Creativity Focus**: Have students [create a new dataset](https://stefaniemolin.com/data-morph/stable/custom_datasets.html) (*e.g.*, your school logo or something that the student designs), and morph that into multiple [target shapes](https://stefaniemolin.com/data-morph/stable/api/data_morph.shapes.factory.html#data_morph.shapes.factory.ShapeFactory). Ask students to comment on which transformations worked best and why.
- **Math and Coding Focus**: Have students create a custom [shape](https://stefaniemolin.com/data-morph-talk/#/shape-class-hierarchy) by inheriting from `LineCollection` or `PointCollection` (there will be a tutorial on this in the future), and try morphing a couple of the [built-in datasets](https://stefaniemolin.com/data-morph/stable/api/data_morph.data.loader.html#data_morph.data.loader.DataLoader) into that shape. Ask students to explain how they chose to calculate the shape, and comment on which transformations worked best and why.

If you end up using Data Morph in your classroom, I would love to hear about it. Please [send me a message](https://stefaniemolin.com/contact/) detailing how you used it and how it went.

## Acknowledgements

This code has been altered by Stefanie Molin ([@stefmolin](https://github.com/stefmolin)) to work for other input datasets by parameterizing the target shapes with information from the input shape. The original code works for a specific dataset called the "Datasaurus" and was created for the paper *Same Stats, Different Graphs: Generating Datasets with Varied Appearance and Identical Statistics through Simulated Annealing* by Justin Matejka and George Fitzmaurice (ACM CHI 2017).

The paper and video can be found on the Autodesk Research website [here](https://www.research.autodesk.com/publications/same-stats-different-graphs-generating-datasets-with-varied-appearance-and-identical-statistics-through-simulated-annealing/). The version of the code placed on GitHub at [jmatejka/same-stats-different-graphs](https://github.com/jmatejka/same-stats-different-graphs), served as the starting point for the Data Morph code base, which is on GitHub at [stefmolin/data-morph](https://github.com/stefmolin/data-morph).
The paper and video can be found on the Autodesk Research website [here](https://www.research.autodesk.com/publications/same-stats-different-graphs-generating-datasets-with-varied-appearance-and-identical-statistics-through-simulated-annealing/). The version of the code placed on GitHub at [jmatejka/same-stats-different-graphs](https://github.com/jmatejka/same-stats-different-graphs), served as the starting point for the Data Morph codebase, which is on GitHub at [stefmolin/data-morph](https://github.com/stefmolin/data-morph).

Read more about the creation of Data Morph [here](https://stefaniemolin.com/articles/data-science/introducing-data-morph/) and [here](https://stefaniemolin.com/data-morph-talk/#/).

Expand Down
26 changes: 26 additions & 0 deletions docs/classroom-ideas.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Data Morph in the classroom
---------------------------

Data Morph is intended to be used as a teaching tool to illustrate the importance
of data visualization. Here are some potential classroom activities for instructors:

* **Statistics Focus**: Have students pick one of the `built-in datasets
<./api/data_morph.data.loader.html#data_morph.data.loader.DataLoader>`_,
and morph it into all available `target shapes
<./api/data_morph.shapes.factory.html#data_morph.shapes.factory.ShapeFactory>`_.
Ask students to comment on which transformations worked best and why.
* **Creativity Focus**: Have students :doc:`create a new dataset <custom_datasets>`
(*e.g.*, your school logo or something that the student designs), and morph that into multiple
`target shapes <./api/data_morph.shapes.factory.html#data_morph.shapes.factory.ShapeFactory>`_.
Ask students to comment on which transformations worked best and why.
* **Math and Coding Focus**: Have students create a custom `shape
<https://stefaniemolin.com/data-morph-talk/#/shape-class-hierarchy>`_ by inheriting
from :class:`.LineCollection` or :class:`.PointCollection` (there will be a
tutorial on this in the future), and try morphing a couple of the `built-in datasets
<./api/data_morph.data.loader.html#data_morph.data.loader.DataLoader>`_
into that shape. Ask students to explain how they chose to calculate the shape, and
comment on which transformations worked best and why.

If you end up using Data Morph in your classroom, I would love to hear about it. Please
`send me a message <https://stefaniemolin.com/contact/>`_ detailing how you used it and
how it went.
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Data Morph
.. include:: quickstart.rst
:start-after: .. INSTALLATION

.. include:: classroom-ideas.rst

Citations
---------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ maintainers = [
{ name = "Stefanie Molin" },
]
authors = [
{ name = "Stefanie Molin", email = "[email protected].com" },
{ name = "Stefanie Molin", email = "data-morph@stefaniemolin.com" },
{ name = "Aaron Stevens", email = "[email protected]" },
{ name = "Justin Matejka", email = "[email protected]" },
]
Expand Down
6 changes: 4 additions & 2 deletions src/data_morph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Data Morph.
Morph an input dataset of 2D points into select shapes, while preserving the summary
statistics to a given number of decimal points through simulated annealing.
statistics to a given number of decimal points through simulated annealing. It is intended
to be used as a teaching tool to illustrate the importance of data visualization (see
`Data Morph in the classroom`_ for ideas).
Notes
-----
Expand All @@ -17,7 +19,7 @@
<https://www.research.autodesk.com/publications/same-stats-different-graphs-generating-datasets-with-varied-appearance-and-identical-statistics-through-simulated-annealing/>`_.
The version of the code placed on GitHub at
`jmatejka/same-stats-different-graphs <https://github.com/jmatejka/same-stats-different-graphs>`_,
served as the starting point for the Data Morph code base, which is on GitHub at
served as the starting point for the Data Morph codebase, which is on GitHub at
`stefmolin/data-morph <https://github.com/stefmolin/data-morph>`_.
Read more about the creation of Data Morph in `this article
Expand Down

0 comments on commit c16e3dc

Please sign in to comment.