LaTeX/Tikz animation goodness
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
book
ch3
.gitignore gitgnore update Dec 28, 2017
LICENSE
README.md
accumulating-mode-montage-3x1.png
accumulation-mode-montage.sh
batch-fixed-array.tex
batch-fixed-final.png
batch-fixed-montage-2x2.png
batch-fixed.gif
batch-fixed.mp4
batch-fixed.pdf
batch-fixed.sh
batch-fixed.tex
classic-batch-300.gif
classic-batch-array.tex
classic-batch-final.png
classic-batch-first.png
classic-batch-montage-2x2.png
classic-batch-second.png
classic-batch.gif
classic-batch.mp4
classic-batch.pdf
classic-batch.sh
classic-batch.tex
diagrams-sgmc.tex Initial import. Jul 3, 2017
diagrams.tex
fmt-sql.sh
gaming-diagrams.tex
gaming-event-time-final.png
gaming-event-time-narrow-final.png
gaming-event-time-narrow.tex
gaming-event-time.gif
gaming-event-time.tex
gaming-overview.tex
gaming-proc-time-final.png
gaming-proc-time-narrow-final.png
gaming-proc-time-narrow.gif
gaming-proc-time-narrow.tex
gaming-proc-time.gif
gaming-proc-time.tex
gaming-team-scores-final.png
gaming-team-scores-narrow-final.png
gaming-team-scores-narrow.gif
gaming-team-scores-narrow.tex
gaming-team-scores.gif
gaming-team-scores.tex
gaming-user-scores-final.png Initial import. Jul 3, 2017
gaming-user-scores-narrow-final.png
gaming-user-scores-narrow.gif
gaming-user-scores-narrow.tex Initial import. Jul 3, 2017
gaming-user-scores.gif
gaming-user-scores.tex
ingress-time-final.png
ingress-time-joint-final.png
ingress-time-joint-montage-1x3.png
ingress-time-joint.gif
ingress-time-joint.mp4
ingress-time-joint.pdf
ingress-time-joint.sh
ingress-time-joint.tex
ingress-time-v2-final.png
ingress-time-v2.gif
ingress-time-v2.tex
ingress-time.gif
ingress-time.tex
input-only-first.png
input-only.gif
input-only.pdf Yet moar recoloring, plus window alignment, window size, and bounded … Jan 14, 2018
input-only.tex
input-output-wm-final.png
input-output-wm.gif
input-output-wm.pdf
input-output-wm.tex
input-output.1a.tex
input-toggle-final.png
input-toggle-montage-2x1.png
input-toggle-nonlinear-final.png
input-toggle-nonlinear.gif
input-toggle-nonlinear.tex
input-toggle.gif
input-toggle.mp4
input-toggle.pdf
input-toggle.sh
input-toggle.tex
micro-batch-speculative-late.gif
micro-batch-speculative-late.tex
micro-batch-wm-final.png
micro-batch-wm.gif
micro-batch-wm.tex
montage.sh
proc-time-accumulating-1m-final.png
proc-time-accumulating-1m.gif
proc-time-accumulating-1m.tex
proc-time-accumulating.gif
proc-time-accumulating.tex
proc-time-discarding-1m-final.png
proc-time-discarding-1m.gif
proc-time-discarding-1m.tex
proc-time-discarding-final.png
proc-time-discarding-joint-final.png
proc-time-discarding-joint-montage-1x3.png
proc-time-discarding-joint.gif
proc-time-discarding-joint.mp4
proc-time-discarding-joint.pdf
proc-time-discarding-joint.sh
proc-time-discarding-joint.tex
proc-time-discarding-v2-final.png
proc-time-discarding-v2.gif
proc-time-discarding-v2.tex
proc-time-discarding.gif
proc-time-discarding.tex
re-window-final.png
re-window-first-stage-final.png
re-window-first-stage-first.png
re-window-first-stage.gif
re-window-first-stage.tex
re-window-first.png
re-window-small.gif
re-window.gif
re-window.tex
render-book.sh
sessions-bounded-final.png
sessions-bounded-montage-2x2.png
sessions-bounded-second.png
sessions-bounded.gif
sessions-bounded.mp4
sessions-bounded.pdf
sessions-bounded.sh
sessions-bounded.tex
sessions-boxed-final.png
sessions-boxed-first.png
sessions-boxed-montage-2x2.png
sessions-boxed-second.png
sessions-boxed.gif
sessions-boxed.mp4
sessions-boxed.pdf
sessions-boxed.sh
sessions-boxed.tex
sessions-final.png
sessions-first.png
sessions.gif
sessions.pdf
sessions.tex
streaming-2min-aligned-final.png
streaming-2min-aligned-montage-2x2.png
streaming-2min-aligned.gif
streaming-2min-aligned.mp4
streaming-2min-aligned.pdf
streaming-2min-aligned.sh
streaming-2min-aligned.tex
streaming-2min-delay-final.png
streaming-2min-delay-montage-2x2.png
streaming-2min-delay.gif
streaming-2min-delay.mp4
streaming-2min-delay.pdf
streaming-2min-delay.sh
streaming-2min-delay.tex
streaming-2min-final.png
streaming-base.tex
streaming-per-record-final.png
streaming-per-record-montage-2x2.png
streaming-per-record.gif
streaming-per-record.mp4
streaming-per-record.pdf
streaming-per-record.sh
streaming-per-record.tex
streaming-perfect-wm-final.png
streaming-perfect-wm.gif
streaming-perfect-wm.tex
streaming-speculative-late-allowed-lateness-1min-final.png
streaming-speculative-late-allowed-lateness-1min-first.png
streaming-speculative-late-allowed-lateness-1min-montage-2x2.png
streaming-speculative-late-allowed-lateness-1min.gif
streaming-speculative-late-allowed-lateness-1min.mp4
streaming-speculative-late-allowed-lateness-1min.pdf
streaming-speculative-late-allowed-lateness-1min.sh
streaming-speculative-late-allowed-lateness-1min.tex
streaming-speculative-late-allowed-lateness.gif
streaming-speculative-late-allowed-lateness.mp4
streaming-speculative-late-allowed-lateness.tex
streaming-speculative-late-discarding-final.png Montages, montage rendering scripts, some more recolorings and touchups Feb 11, 2018
streaming-speculative-late-discarding-montage-2x2.png
streaming-speculative-late-discarding.gif Mass checkpoint Jul 9, 2018
streaming-speculative-late-discarding.mp4
streaming-speculative-late-discarding.pdf
streaming-speculative-late-discarding.sh
streaming-speculative-late-discarding.tex
streaming-speculative-late-example.png
streaming-speculative-late-final.png
streaming-speculative-late-joint-final.png
streaming-speculative-late-joint-montage-1x4.png
streaming-speculative-late-joint.gif
streaming-speculative-late-joint.mp4
streaming-speculative-late-joint.pdf
streaming-speculative-late-joint.sh
streaming-speculative-late-joint.tex
streaming-speculative-late-montage-2x2.png
streaming-speculative-late-retracting-final.png
streaming-speculative-late-retracting-montage-2x2.png
streaming-speculative-late-retracting.gif
streaming-speculative-late-retracting.mp4
streaming-speculative-late-retracting.pdf
streaming-speculative-late-retracting.sh
streaming-speculative-late-retracting.tex
streaming-speculative-late-sgmc.gif
streaming-speculative-late-sgmc.tex
streaming-speculative-late-toggle-joint-10-final.png
streaming-speculative-late-toggle-joint-10-first.png
streaming-speculative-late-toggle-joint-10.gif
streaming-speculative-late-toggle-joint-10.tex
streaming-speculative-late-toggle-joint-final.png
streaming-speculative-late-toggle-joint-montage-1x3.png
streaming-speculative-late-toggle-joint.gif
streaming-speculative-late-toggle-joint.mp4
streaming-speculative-late-toggle-joint.pdf
streaming-speculative-late-toggle-joint.sh
streaming-speculative-late-toggle-joint.tex
streaming-speculative-late-v2-final.png
streaming-speculative-late-v2.gif
streaming-speculative-late-v2.tex
streaming-speculative-late-white.pdf
streaming-speculative-late.gif Mass checkpoint Jul 9, 2018
streaming-speculative-late.mp4
streaming-speculative-late.pdf
streaming-speculative-late.sh
streaming-speculative-late.tex
streaming-wm-0.png
streaming-wm-example.png
streaming-wm-final.png
streaming-wm-joint-final.png
streaming-wm-joint-montage-1x4.png
streaming-wm-joint.gif
streaming-wm-joint.mp4
streaming-wm-joint.pdf
streaming-wm-joint.sh
streaming-wm-joint.tex
streaming-wm-montage-2x2.png
streaming-wm-percentile-final.png
streaming-wm-percentile-montage-2x2.png
streaming-wm-percentile.gif
streaming-wm-percentile.mp4
streaming-wm-percentile.pdf
streaming-wm-percentile.sh
streaming-wm-percentile.tex
streaming-wm-white.pdf
streaming-wm.gif Mass checkpoint Jul 9, 2018
streaming-wm.mp4
streaming-wm.pdf
streaming-wm.sh
streaming-wm.tex
streaming-wm.tiny.gif
streams-tables-batch-fixed-80.png
streams-tables-batch-fixed-final.png
streams-tables-batch-fixed-montage-2x2.png
streams-tables-batch-fixed.gif
streams-tables-batch-fixed.mp4
streams-tables-batch-fixed.pdf
streams-tables-batch-fixed.sh
streams-tables-batch-fixed.tex
streams-tables-classic-batch-80.png
streams-tables-classic-batch-final.png
streams-tables-classic-batch-montage-2x2.png
streams-tables-classic-batch-sum-only.tex
streams-tables-classic-batch.gif
streams-tables-classic-batch.mp4
streams-tables-classic-batch.pdf
streams-tables-classic-batch.sh
streams-tables-classic-batch.tex
streams-tables-gbk-80.png
streams-tables-gbk-final.png
streams-tables-gbk-first.png
streams-tables-gbk-montage-2x2.png
streams-tables-gbk.gif
streams-tables-gbk.mp4 s/Team scores/Team totals/g, plus some fixups in per-record and sessi… Jul 9, 2018
streams-tables-gbk.pdf
streams-tables-gbk.sh Montages, montage rendering scripts, some more recolorings and touchups Feb 11, 2018
streams-tables-gbk.tex
streams-tables-sql-temporal-join-80.png
streams-tables-sql-temporal-join-final.png
streams-tables-sql-temporal-join-first.png
streams-tables-sql-temporal-join-montage-2x2.png
streams-tables-sql-temporal-join-wm-80.png
streams-tables-sql-temporal-join-wm-final.png
streams-tables-sql-temporal-join-wm-first.png
streams-tables-sql-temporal-join-wm-montage-2x2.png
streams-tables-sql-temporal-join-wm.gif
streams-tables-sql-temporal-join-wm.mp4
streams-tables-sql-temporal-join-wm.pdf
streams-tables-sql-temporal-join-wm.sh
streams-tables-sql-temporal-join-wm.tex
streams-tables-sql-temporal-join.gif
streams-tables-sql-temporal-join.mp4
streams-tables-sql-temporal-join.pdf
streams-tables-sql-temporal-join.sh
streams-tables-sql-temporal-join.tex
streams-tables-sql-validity-windows-80.png
streams-tables-sql-validity-windows-final.png
streams-tables-sql-validity-windows-montage-2x2.png
streams-tables-sql-validity-windows.gif
streams-tables-sql-validity-windows.mp4
streams-tables-sql-validity-windows.pdf
streams-tables-sql-validity-windows.sh
streams-tables-sql-validity-windows.tex
streams-tables-streaming-1min-80.png
streams-tables-streaming-1min-final.png
streams-tables-streaming-1min-montage-2x2.png
streams-tables-streaming-1min.gif
streams-tables-streaming-1min.mp4
streams-tables-streaming-1min.pdf
streams-tables-streaming-1min.sh
streams-tables-streaming-1min.tex s/Team scores/Team totals/g, plus some fixups in per-record and sessi… Jul 9, 2018
streams-tables-streaming-per-record-80.png
streams-tables-streaming-per-record-final.png
streams-tables-streaming-per-record-montage-2x2.png
streams-tables-streaming-per-record.gif
streams-tables-streaming-per-record.mp4
streams-tables-streaming-per-record.pdf
streams-tables-streaming-per-record.sh
streams-tables-streaming-per-record.tex
streams-tables-streaming-sessions-80.png
streams-tables-streaming-sessions-final.png
streams-tables-streaming-sessions-montage-2x2.png
streams-tables-streaming-sessions-no-retractions-80.png
streams-tables-streaming-sessions-no-retractions-final.png
streams-tables-streaming-sessions-no-retractions-montage-2x2.png
streams-tables-streaming-sessions-no-retractions.gif
streams-tables-streaming-sessions-no-retractions.mp4
streams-tables-streaming-sessions-no-retractions.pdf
streams-tables-streaming-sessions-no-retractions.sh
streams-tables-streaming-sessions-no-retractions.tex
streams-tables-streaming-sessions.gif
streams-tables-streaming-sessions.mp4
streams-tables-streaming-sessions.pdf
streams-tables-streaming-sessions.sh Montages, montage rendering scripts, some more recolorings and touchups Feb 11, 2018
streams-tables-streaming-sessions.tex
streams-tables-streaming-speculative-late-80.png
streams-tables-streaming-speculative-late-final.png
streams-tables-streaming-speculative-late-montage-2x2.png
streams-tables-streaming-speculative-late.gif
streams-tables-streaming-speculative-late.mp4
streams-tables-streaming-speculative-late.pdf
streams-tables-streaming-speculative-late.sh
streams-tables-streaming-speculative-late.tex
streams-tables-streaming-wm-80.png
streams-tables-streaming-wm-final.png
streams-tables-streaming-wm-late-80.png
streams-tables-streaming-wm-late-final.png
streams-tables-streaming-wm-late-montage-2x2.png
streams-tables-streaming-wm-late.gif
streams-tables-streaming-wm-late.mp4
streams-tables-streaming-wm-late.pdf
streams-tables-streaming-wm-late.sh
streams-tables-streaming-wm-late.tex
streams-tables-streaming-wm-montage-2x2.png
streams-tables-streaming-wm-v1.sh
streams-tables-streaming-wm.gif
streams-tables-streaming-wm.mp4
streams-tables-streaming-wm.pdf
streams-tables-streaming-wm.sh
streams-tables-streaming-wm.tex
streams-tables-streaming-wm.tiny.gif
test-diagram-0.png
test-diagram-1.png
test-diagram.png
test-diagram.tex
test.sql
trim.sh
tuple-time-final.png
tuple-time-v2.gif
tuple-time-v2.tex
tuple-time.gif
tuple-time.tex
white-batch-fixed-final.png
white-batch-fixed-first.png
white-batch-fixed.gif
white-batch-fixed.pdf
white-batch-fixed.tex
white-classic-batch-final.png Initial import. Jul 3, 2017
white-classic-batch-first.png
white-classic-batch.gif
white-classic-batch.pdf Initial import. Jul 3, 2017
white-classic-batch.tex
white-streaming-speculative-late-final.png
white-streaming-speculative-late-first.png
white-streaming-speculative-late.gif
white-streaming-speculative-late.pdf
white-streaming-speculative-late.tex
white-streaming-wm-final.png
white-streaming-wm-first.png
white-streaming-wm.gif
white-streaming-wm.pdf
white-streaming-wm.tex
window-alignment-aligned-final.png
window-alignment-aligned-montage-1x3.png
window-alignment-aligned-second.png
window-alignment-aligned.gif
window-alignment-aligned.mp4 Add root MP4s Jul 9, 2018
window-alignment-aligned.pdf
window-alignment-aligned.sh
window-alignment-aligned.tex
window-alignment-unaligned-final.png
window-alignment-unaligned-montage-1x3.png
window-alignment-unaligned-second.png
window-alignment-unaligned.gif
window-alignment-unaligned.mp4
window-alignment-unaligned.pdf
window-alignment-unaligned.sh
window-alignment-unaligned.tex
window-sizes-final.png
window-sizes-montage-1x3.png
window-sizes-second.png Yet moar recoloring, plus window alignment, window size, and bounded … Jan 14, 2018
window-sizes.gif
window-sizes.mp4 Add root MP4s Jul 9, 2018
window-sizes.pdf
window-sizes.sh
window-sizes.tex

README.md

LaTeX/Tikz animation goodness.

Overview:

Each diagram corresponds to a single main LaTeX file, e.g. the sessions diagram corresponds to sessions.tex. All of the diagrams depend on a common library of commands definitions and initialization in the diagrams.tex file.

Each frame of animation advances processing time by 1/9 of a minute (i.e. 0.111). I don't remember why I set it up this way originally, I just did, and it's worked out pretty well.

The main command used to render a single frame is \TriggersDiagram. It takes two parameters*:

  1. The processing time for the frame.
  2. The Tikz commands used to draw any state, output, etc primitives on the screen.

*Technically it takes three parameters. The truly first parameter is the color of the horizontal line indicating what time it is in processing time, for fading that line out. This is typically only used for the final frames of the animation.

Most of the rendering is done using other custom commands for basic primitives, like \DrawState and \DrawOutput. Poking around in the existing files and the command definitions should be pretty helpful for figuring them all out.

Setup (Mac - RECOMMENDED):

  1. Install Homebrew and Homebrew-Cask:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew tap caskroom/cask
    
  2. Install mactex, TexShop, and ImageMagick:

    brew cask install mactex
    brew cask install texshop
    brew install imagemagick
    
  3. Install Roboto font

    cd /usr/local/texlive/texmf-local
    wget http://mirrors.ctan.org/fonts/roboto.zip
    sudo unzip roboto.zip 
    
  4. Install FiraSans font (font details)

    cd /usr/local/texlive/texmf-local
    wget http://mirrors.ctan.org/fonts/newtxsf.zip
    sudo unzip newtxsf.zip
    

You should then be able to load, edit, and render PDFs in TexShop. PDF → GIF conversion is detailed below.g

Setup (Linux Workstation):

NOTE: I never fully managed to get fonts working properly on Linux. You'll either have to figure out how to make that work, or comment out the FiraSans lines in diagrams.tex to get this to render on your workstation. Or just use a Mac, as above.

Some subset of the following commands are needed to install the necessary LaTeX packages (I'm not sure which, since I was totally shooting in the dark trying to get this set up the first time, and I know of no good way to return to a clean state to try it all over again from the beginning):

tlmgr init-usertree
tlmgr update --self
tlmgr install texgreek cbfonts cbfonts-fd tlmgr install greek-fontenc fira

You'll also need the pdflatex and convert (i.e. Image Magick) commands installed. For me, they already were (not sure if I installed them manually once upon a time, or not).

LaTeX to PDF:

Mac: Open file in TexShop, Render to PDF (command+t).

Linux: pdflatex sessions.tex

PDF to GIF:

# High-resolution
NAME=sessions && time convert -density 300 -delay 15 -loop 0 $NAME.pdf $NAME.gif

# Low-resolution
NAME=sessions && time convert -density 150 -delay 15 -loop 0 $NAME.pdf $NAME.gif

Extract frames from GIF to PNG:

# First frame
NAME=sessions && convert "$NAME.gif[0]" $NAME-first.png

# Last frame
NAME=sessions && convert "$NAME.gif[-1]" $NAME-final.png