Title: | HTML with Horizontal Strips Symbolizing Events in a Person's Life |
---|---|
Description: | Produce an HTML page containing horizontal strips that symbolize events in a person's lsife. Since this is entirely a visualization, the image <https://barryzee.github.io/henry-timeline/henry.html> will show the basic use to show a timeline of events. The image <https://barryzee.github.io/vermeer/cssOverlay.html> shows how to correlate two timelines of events. A brief description is available at <https://barryzee.github.io/timeLineGraphics_manuscript/golden_age.html>. |
Authors: | Barry Zeeberg [aut, cre] |
Maintainer: | Barry Zeeberg <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2024-11-22 05:22:50 UTC |
Source: | https://github.com/cran/timeLineGraphics |
compute ratio needed for maintaining proper aspect ratio in graph overlay image
aspectRatio(rim)
aspectRatio(rim)
rim |
is rasterized version of im |
numerical ratio needed for maintaining proper aspect ratio in graph overlay image
aspectRatio(as.raster(magick::image_read(example2()[[1]]$pics[[1]])))
aspectRatio(as.raster(magick::image_read(example2()[[1]]$pics[[1]])))
given a maximum vertical size in inches that is allowable, find x size of raster image
backFitRaster(y2x, maxy, ymargin)
backFitRaster(y2x, maxy, ymargin)
y2x |
is original aspect ratio of image |
maxy |
is max vertical size in inches |
ymargin |
is fraction of maxy to leave as top and bottom margin |
graph units<-yinch(y in inches)
numerical x size of raster image
backFitRaster(1.333,10,.05)
backFitRaster(1.333,10,.05)
generate structured list for mockup example
example2()
example2()
structured list for mockup example
find next higher multiple of 10
nextMultiple10(x)
nextMultiple10(x)
x |
integer |
integer next higher multiple of 10
nextMultiple10(1732) nextMultiple10(1699)
nextMultiple10(1732) nextMultiple10(1699)
determine the range of years
roy(l)
roy(l)
l |
is a list
|
integer vector containing the range of years
roy(example2())
roy(example2())
iteratively plot each horizontal strip
stripPlot(l, ht, vfactor, ymargin, nameCEX, leftOver)
stripPlot(l, ht, vfactor, ymargin, nameCEX, leftOver)
l |
is a list
|
ht |
is total height of entire graph |
vfactor |
is height of a horizontal strip |
ymargin |
is fraction of maxy to leave as top and bottom margin |
nameCEX |
control size of font in text() to display names associated with each horizontal strip |
leftOver |
if TRUE then pictures that do not fit in horizontal strip are placed to left of strip rather than omitted |
No return value, called for side effects
This function is the driver that organizes the production of an html page containing horizontal strips that symbolize events in a person's life.
timeLineGraphics( l, vfactor = 3, abline = TRUE, bkgRBG = c(13, 65, 130), ablineRBG = c(26, 85, 145), pdfWidth = 20, pdfHeight = 20, extendRight = 50, yearsTicks = 10, ymargin = 0.05, nameCEX = 4, main = "Timelines", WidthHTML = 850, imageDir = tempdir(), leftOver = TRUE )
timeLineGraphics( l, vfactor = 3, abline = TRUE, bkgRBG = c(13, 65, 130), ablineRBG = c(26, 85, 145), pdfWidth = 20, pdfHeight = 20, extendRight = 50, yearsTicks = 10, ymargin = 0.05, nameCEX = 4, main = "Timelines", WidthHTML = 850, imageDir = tempdir(), leftOver = TRUE )
l |
is a list
|
vfactor |
is height of a horizontal strip |
abline |
is Boolean if TRUE add dates and corresponding vertical ablines |
bkgRBG |
is ie c(13,65,130) specifying background color |
ablineRBG |
specifying abline color |
pdfWidth |
the width parameter to pdf() |
pdfHeight |
the height parameter to pdf() |
extendRight |
extends plot to the right to provide room to fit in names |
yearsTicks |
number of years interval between x axis ticks |
ymargin |
is fraction of maxy to leave as top and bottom margin |
nameCEX |
control size of font in text() to display names associated with each horizontal strip |
main |
main title for the graph |
WidthHTML |
the width of the figure when imported into html page |
imageDir |
where to save the image output files |
leftOver |
if TRUE then pictures that do not fit in horizontal strip are placed to left of strip rather than omitted |
the parameters here work fine in general but they were tuned to match the chart in https://mathigon.org/timeline since my intention is to generate a consistent display of that chart and my chart above one another a consideration is to have the horizontal strips sufficiently tall so that the images of the in-laid paintings can be seen clearly the default RBG values match the design in https://mathigon.org/timeline construct graph whose x axis is years y axis is items to be plotted such as a person's years of birth and death within a broad colored horizontal line overlain with pictures related to that person
No return value, called for side effects