Wikipedia has cool timelines for organizations, like bands. For an example, see https://en.wikipedia.org/wiki/Joy_Division#Timeline
The format for this is defined in the specification described at https://en.wikipedia.org/wiki/Help:EasyTimeline_syntax
The code here cannot parse everything as defined in the specification, but it can parse enough to get something useful from files of this type.
The data files in /examples are copied directly from Wikipedia. The graphics are generated by the code here.
- Install a version of Go at or greater than 1.25.0 from https://go.dev/
- Clone this repository
- Run the program with the command
or compile the program with the command
go run cmd/main.go /path/to/data/filego build -o timeline cmd/main.go
- Choose a pre-compiled version from the Releases page that is suitable for your computer
- Download it and rename the download to
timeline - Open the Terminal.app program (on a Mac) or the command shell (on Windows)
- Using the
cdcommand, navigate to where you downloaded the program (cd ~/Downloadsorcd ~/Desktopon a Mac)
To
-
To see the options, run:
timeline --helpCurrently the options are:
-font; this sets the font for the text in the chart. The options are limited to one of: DMSans, ComputerModernRoman, Luxi (default "DMSans") with DMSans being a nice sans serif font, ComputerModernRoman which is a nice serifed font, and Luxi, which is built in-jenable verbose JSON output; this is generally not useful but if you want to see the internal representation of the data this is how to do it-labelbargap; this is an integer that sets the size of the gap between the label and the start of the bar in pixels. It is 5px by default. This is also used in many other places in the chart to define spacing-othe name of the output file, this defaults to the name of the input file (including any extensions) with the ending.png-tthis enables verbose text output; this is also generally not useful, but it is another representation of the data that was read from the input file-tMthis sets length of major tics on x-axis in pixels, the default is 8px-tmthis sets length of minor tics on x-axis in pixels, the default is 5px
for example, you can produce
the_cure.png(as shown above) with the command:timeline -o the_cure.png ./examples/the_cure.data
- Clean up
draw.gowhich is a damn travesty of Go - Write a PEG for the specification so everything can be parsed (there is some early drafts of this in
peg/, but there is a way to go- Write the code to handle all of the options in the spec that were parsed by the PEG
- Support PDF output
- Don't make the image bigger than the chart plus the legend



