Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
README.org 8.40 KiB

Data Driven Visualization

This repository contains materials and examples for creating dynamic data visualizations using LaTeX’s PGFPlots package. The collection focuses on automating visualization workflows through CSV data integration, enabling seamless updates and modifications through data changes.

Key features:

- Automated data visualization pipeline using CSV files
- Dynamic update system through data modifications
- Customizable visualization templates
- Integration with LaTeX documents
- Best practices for data management and visualization

The repository provides practical tools and examples for transforming raw data into professional, publication-ready visualizations using LaTeX’s powerful PGFPlots system. Users can leverage these resources to create their own dynamic visualizations that automatically update with data changes, perfect for research papers, presentations, and reports.

Disclaimer

This is actually a wrapper for the splendid package =wheelchart= by matexmatics to lower the hurdle for quickly creating charts.

Acknowledgement

This package was written with a lot of help by the TeX.StackExchange-Community in answering the following questions:

  • https://tex.stackexchange.com/q/738083/98739
  • https://tex.stackexchange.com/q/737987/98739
  • https://tex.stackexchange.com/q/737932/98739
  • https://tex.stackexchange.com/q/737843/98739
  • https://tex.stackexchange.com/q/737689/98739
  • https://tex.stackexchange.com/q/737629/98739
  • https://tex.stackexchange.com/q/738278/98739
  • https://tex.stackexchange.com/q/738450/98739

Data set

We define some columns with the important information

category,name,description,startangle,totalangle,color
category
This categorizes the item into either e.g. Service, Tools, Basisdienste, Hardware.
name
The name of the item, e.g. GitLab
description
A very short description what the item is about or if there is a strong connection to anything further.
startangle
give the integer where the ring starts. In other words, 90 is at top, 0 is at ‘3 o’clock’, -90 is at ‘6 o’clock’ and e.g. 180 is at ‘9 o’clock’.
totalangle
This is more tricky, based on the startangle you define the ‘length’ of the ring by giving the totalangle. Covering from 12 o’clock til 3 o’clock you have to write: startangle: 90, totalangle: 45”.
color
Declare a specific color for this slice.

Let’s fill the data set with the actual content:

category,name,description,startangle,totalangle,color
project,TechRevamp,,60,300,red
project,SmartCity Initiative,,-120,90,red
project,Quantum Computing Research,,10,150,red
project,AI for Healthcare,,80,120,red
project,Space Exploration 2030,,0,100,red
project,Green Energy Solutions,,-30,180,red
datasteward,Global Data Hub,,20,200,purple
datasteward,Digital Preservation Network,,-60,150,purple
datasteward,AI Ethics Standards,,-40,220,purple
datasteward,Environmental Data Stewardship,,-100,150,purple
natInf,Future Cities Network,,10,230,brown
natInf,Deep Sea Exploration Initiative,,-80,200,brown
natInf,Global Health Data Alliance,,-20,150,brown
natInf,Data-Driven Climate Action,,-90,110,brown
natInf,Interstellar Communications,,-50,260,brown
service,Smart Grid Management,,60,220,blue
service,Cloud Data Services,,-30,160,blue
service,Urban Mobility Solutions,,80,50,blue
service,Telemedicine Platform,,10,130,blue
service,Blockchain for Secure Transactions,,0,200,blue
consulting,Innovation Strategy Consulting,,30,270,magenta
consulting,Leadership Development Workshops,,90,50,magenta
consulting,Market Expansion Support,,70,110,magenta
consulting,Digital Transformation Consulting,,50,120,magenta

Visualization with LaTeX

Definition of commands

Load the package (ddv.sty) in the preamble.
\usepackage[
  <global-key-value>
]{ddv}

You can pass several options to the package wich are taken then for all of the plots.

For creating a visualization use \DDV{<local-key-value>}.

Options

Basic ones:
  • dataset: give the name of the .csv (including suffix), e.g. dataset={data-example.csv}, this is the same as dataset={name={data-example.csv}}
    • filter: filter for a category. You can also filter for two categories, but then surround them by another pair of {}, e.g. filter={{datasteward,natInf}}. If you pass none to the key, there is no filtering (default).
    • sorting: manipulate the sorting according to a column header, e.g. sorting={category}.
  • title: A title shown on top of the plot, e.g. title={<title name>}, this is the same as title={name={<title name>}}
    • font: specify the display of the title, e.g. font={\itshape },
    • fontsize: adjust the fontsize using an integer, e.g. fontsize=30.
    • fontcolor: define the font color, you can use either RGB-definition or a color name, e.g. fontcolor={{0,84,159}}.
    • options: inject plain and further options according to the wheelchart syntax. With that you can overwrite defaults.
  • stages: a list of strings separated by comma which are used for the stages (outer ring). Since there are commas, you need to surround them with an additional set of {}, e.g. stages={{Phase One,Phase Two, Phase Three}}, this is the same as stages={name={{Phase One, Phase Two, Phase Three}}}
    • font: specify the display of the stages, e.g. font={\scshape },
    • fontcolor: define the font color, you can use either RGB-definition or a color name, e.g. fontcolor={{0,84,159}}.
    • fontsize: adjust the fontsize using an integer, e.g. fontsize=30.
    • bgcolor: define the background color, you can use either RGB-definition or a color name, e.g. bgcolor={{0,84,159}}.
    • insde: this is a boolean, write inside=true to have the stages as the inner circle.
    • options: inject plain and further options according to the wheelchart syntax. With that you can overwrite defaults.
  • slices: only subkeys are valid with slices:
    • description: a boolean for showing the content of the column description, activate with description=true.
    • font: specify the display of the slices, e.g. font={\itshape },
    • fontcolor: define the font color, (passing a defined color name), e.g. fontcolor={my-blue}.
    • fontsize: adjust the fontsize using an integer, e.g. fontsize=30.
    • bgcolor: define the background color (passing a defined color name), e.g. fontcolor={my-super-dark-blue}. When you pass a color to this key then the color definition in the database (column color) is disabled.
    • bgcolorseries: define two colors that will color the slices, e.g. bgcolorseries={{red,blue}} (see the double {}!), this will start with red for the inner circle and blue for the outer circle.
    • options: inject plain and further options according to the wheelchart syntax. With that you can overwrite defaults.
  • innercirclesize: Define the initial size of the inner circle diameter, must be an integer, default is 4.

How to use and apply the key-values

This is a locally defined plot:
\DDV{
  dataset     ={data-example.csv},
  stages      ={{Plan,Production,Analysis,Storage,Access,Re-use}},
  title       ={{Overview of our projects},
                fontcolor   ={red}}
}

You get the same result with the global definition in this mwe:

\documentclass[border=10pt]{standalone}
\usepackage[
  dataset     ={data-example.csv},
  stages      ={{Plan,Production,Analysis,Storage,Access,Re-use}},
  title       ={{Overview of our projects},
                fontcolor   ={red}}
]{ddv}
\begin{document}
\DDV{}
\end{document}

images/mwe.jpg

Poster example

The file data-driven-visualization-poster.tex leads to this result:

images/data-driven-visualization-poster.jpg