Package 'timeLineGraphics'

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

Help Index


aspectRatio

Description

compute ratio needed for maintaining proper aspect ratio in graph overlay image

Usage

aspectRatio(rim)

Arguments

rim

is rasterized version of im

Value

numerical ratio needed for maintaining proper aspect ratio in graph overlay image

Examples

aspectRatio(as.raster(magick::image_read(example2()[[1]]$pics[[1]])))

backFitRaster

Description

given a maximum vertical size in inches that is allowable, find x size of raster image

Usage

backFitRaster(y2x, maxy, ymargin)

Arguments

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

Details

graph units<-yinch(y in inches)

Value

numerical x size of raster image

Examples

backFitRaster(1.333,10,.05)

example2

Description

generate structured list for mockup example

Usage

example2()

Value

structured list for mockup example


nextMultiple10

Description

find next higher multiple of 10

Usage

nextMultiple10(x)

Arguments

x

integer

Value

integer next higher multiple of 10

Examples

nextMultiple10(1732)
nextMultiple10(1699)

roy

Description

determine the range of years

Usage

roy(l)

Arguments

l

is a list

  • character string $name the person's name

  • integer $start starting year

  • integer $end ending year

  • character string $color background color for the horizontal line

  • list of overlay pictures $pics, each entry contains

    • character string path name for a picture

    • integer year for placement of left edge of picture

Value

integer vector containing the range of years

Examples

roy(example2())

stripPlot

Description

iteratively plot each horizontal strip

Usage

stripPlot(l, ht, vfactor, ymargin, nameCEX, leftOver)

Arguments

l

is a list

  • character string $name the person's name

  • integer $start starting year

  • integer $end ending year

  • character string $color background color for the horizontal line

  • list of overlay pictures $pics, each entry contains

    • character string path name for a picture

    • integer year for placement of left edge of picture

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

Value

No return value, called for side effects


timeLineGraphics

Description

This function is the driver that organizes the production of an html page containing horizontal strips that symbolize events in a person's life.

Usage

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
)

Arguments

l

is a list

  • character string $name the person's name

  • integer $start starting year

  • integer $end ending year

  • character string $color background color for the horizontal line

  • list of overlay pictures $pics, each entry contains

    • character string path name for a picture

    • integer year for placement of left edge of picture

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

Details

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

Value

No return value, called for side effects