grid.newpage()
grid.box("result_table",
         paste("  ",
               c("swimmer", "distance", "stroke", "gender", "stage",
                 "time", "place"),
               sep=""),
         x=.5,
         y=.5,
         primary=paste("  ",
           c("swimmer", "distance", "stroke", "gender", "stage"),
           sep=""),
         foreign=paste("  ",
           c("swimmer", "distance", "stroke", "gender", "stage"),
           sep=""))

grid.box("swimmer_table",
         c("ID", "first", "last"),
         x=.8,
         y=.8,
         primary=c("ID"))

grid.box("distance_table",
         c("length"),
         x=.2,
         y=.7,
         primary="length")

grid.box("stroke_table",
         c("ID", "stroke"),
         x=.8,
         y=.5,
         primary="ID")

grid.box("gender_table",
         c("ID", "gender"),
         x=.2,
         y=.3,
         primary="ID")

grid.box("stage_table",
         c("stage"),
         x=.8,
         y=.25,
         primary="stage")

boxCurve("result_table", "swimmer_table",
         "  swimmer", "ID")
boxCurve("result_table", "stroke_table",
         "  stroke", "ID",
         direction=c("right", "down"))
boxCurve("result_table", "stage_table",
         "  stage", "stage",
         direction=c("right", "down"))
boxCurve("result_table", "distance_table",
         "  distance", "length",
         direction=c("left", "up"))
boxCurve("result_table", "gender_table",
         "  gender", "ID",
         direction=c("left", "down"))
