Giter VIP home page Giter VIP logo

lapse's Introduction

lapse

A simple tool for visualizing the evolution of a version-controlled text file.


At some point, I observed that large blobs of text can resemble land- and cityscapes when viewed at a certain angle and distance. My first attempt to capture this observation came in the form of a filter manually applied to an image of an entry in one of my journals:

Image of blurred text, oriented to resemble a cityscape

It wasn't long before I realized that, given the history of transformations applied to a bit of text, it would be possible to create a sort of flip-book visualization of that text reminiscent of an evolving landscape. lapse is a tiny tool, borne of other tools, capable of producing such a visualization. This is what it looks like; for this example, I chose a file with thousands of lines that had been touched by hundreds of minds over nearly ten years:

Visualization of the evolution of a very large, very old text file

I've used a combination of readily available command-line tools such as git, watch, and sed, in conjunction with some features of the iTerm2 terminal application, to achieve this.

I think the results are slightly beautiful.

Usage

This tool currently expects to be executed from the iTerm2 application on a Mac, as it relies on the iTerm2 Applescript API to programmatically generate a sequence of "observer" sessions using a particular UI profile (which manipulates the visual aesthetic of the animated text).

To run this on your own machine, you'll need to install iTerm2 and create a profile called "TINY". I named it this because for a file as large as the one I was targeting during development, I needed the rendered font size to be as small as possible in order to reasonably fit the entire animation on one screen. You can configure this profile however you like, but currently the name is hard-coded and must be "TINY".

##
# Example usage:
#     TARGET_PROJECT=~/github/cool_project TARGET_FILE=app/models/cool_model.rb SPEED=0.05 ./lapse.sh
#
# Required arguments:
#     TARGET_PROJECT - a path (relative or absolute) to the base Git repository of TARGET_FILE
#        TARGET_FILE - a path (relative to TARGET_PROJECT, or absolute) to the file to visualize
#
#
# Optional arguments:
#     TARGET_REVISION_RANGE - [default: "master"] a Git revision range (following the format accepted
#                             by `git log`) indicating the slice of project history to visualize;
#                             specifying a single commit or branch name implicitly indicates the
#                             beginning of the range is the first reachable commit containing TARGET_FILE
#                     SPEED - [default: 0.2] a numeric value (floating point accepted) measuring the
#                             desired time in seconds between each "frame" of the visualization
##

Ideas for improvement

  • parameterize the name of the iTerm2 profile to use for configuring the animation aesthetic
  • find a way to remove dependency on iTerm2, or add support for default the Terminal application and make it configurable
  • add support for generating a screen capture of the resulting animation

lapse's People

Contributors

dabrady avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.