Client Class
The client file
Item Index
Methods
- * Draw LifeLines
- * generate 1-person-blocks
- * generate blocks
- * parse a persons Life into Events
- * sort blocks
- *draw persons of a block
- *drawAnnotationSymbol
- *drawDropLines
- *drawTime
- *fadeInLifeLines
- *write text on LifeLine
- arrayDiff
- cmpBirthDates
- cmpDates
- cmpEvents
- cmpNumbers
- copyArray
- copyObject
- drawAnnotation
- drawEverything
- fillBlock
- fullRelationCurveTo
- getX
- otherPersonId
- personColor
- relationCurveTo
- resetDois
- selectMatchingLine
- setDois
- setFocusLine
- sign
- sortBlockPersons
Methods
* Draw LifeLines
-
event
-
currentDoi
Draws a person's lifeLine from event to event
Parameters:
-
event
EventEvent in a persons Life
-
currentDoi
Numbermaximal DOI value
* generate 1-person-blocks
()
Generate 1-person-blocks for persons without relationships, preprocess data
* generate blocks
()
Generate blocks of relationships
* parse a persons Life into Events
-
person
Sorts a persons Life into chronological events and assigns them canvas coordinates.
Parameters:
-
person
Persona person of a block
* sort blocks
()
Determine the block order (global layout)
*draw persons of a block
-
a
Draws Lifelines of a Block
Parameters:
-
a
Personperson in the block Person
*drawAnnotationSymbol
-
EventAnnotation
Draws a Star on a persons Lifeline, if a special event happened in a persons life.
Parameters:
-
EventAnnotation
Eventof a person
*drawDropLines
()
Draws droplines from parents to children, handels different visibility cases between involved people, and fades lines accordingly.
*drawTime
()
Draws a timeline on at top and at the bottom of the timeline,, from Birthdate of the oldest person to the deathdate of the youngest.
*fadeInLifeLines
()
Fades in invisible Lifelines if the unimportant persons is in a relationship with a more important person.
*write text on LifeLine
()
Writes a person's name and DOI value on their lifeline
arrayDiff
-
a
-
b
Parameters:
-
a
Array -
b
Array
Returns:
a without the objects of b
cmpBirthDates
-
a
-
b
Compare birth dates of persons for sorting
Returns:
cmpDates
-
a
-
b
Compare dates for sorting
Parameters:
-
a
Date -
b
Date
Returns:
cmpEvents
-
a
-
b
Compare events for sorting
Parameters:
-
a
Event -
b
Event
Returns:
cmpNumbers
-
a
-
b
Compare numbers for sorting
Parameters:
-
a
Number -
b
Number
Returns:
copyArray
-
a
Copy an array (copy every object in the array)
Parameters:
-
a
Array
Returns:
copyObject
-
o
Copy an object
Parameters:
-
o
Object
Returns:
drawAnnotation
-
AnnotationSymbol
Draws annotation textbox. Calculates textbox position and text breaks.
Parameters:
-
AnnotationSymbol
Pathincludes Position and AnnotationData
drawEverything
()
As the name says. Must be called every time the layout changes
fillBlock
-
relId
-
block
Insert conjugal relationship and the involved persons into the block; then go to their other conjugal relationships, add them to the block, ... and so on, until the block is completed.
Parameters:
-
relId
Number -
block
Block
fullRelationCurveTo
-
path
-
endPoint
-
curveHeight
Draws a "full relation curve", meaning two curves that are connected by a straight line
Parameters:
-
path
paper.Path -
endPoint
paper.Point -
curveHeight
Number
getX
-
date
Parameters:
-
date
Date
Returns:
x-position on screen for date
otherPersonId
-
p
-
rel
Parameters:
-
p
Person -
rel
Relationship
Returns:
id of other person in the relationship
personColor
-
person
Parameters:
-
person
Person
Returns:
color of person's line, determined by doi and sex
relationCurveTo
-
path
-
endPoint
Draws a curve for the current path to endPoint (used in fullRelationCurveTo)
Parameters:
-
path
paper.Path -
endPoint
paper.Point
resetDois
-
value
Set doi values of all persons to value
Parameters:
-
value
Number
selectMatchingLine
()
Conducts person search, and sets this person in focus.
setDois
-
p
-
currentDoi
This recursive function calculates the DOI values for every person, starting at the person in focus.
Parameters:
-
p
PersonPerson in focus
-
currentDoi
Numbermaximal DOI value
setFocusLine
-
line
Sets the clicked LifeLine in focus, starts the line animation, and starts calculation of Dois.
Parameters:
-
line
PathThe lifeline which is new Focus point.
sign
-
x
Sign function
Parameters:
-
x
Number
Returns:
sortBlockPersons
()
Sort the persons of a block by birth date
Events
db_data
Called when database data is received
Event Payload:
-
data
Objectcontains the database content from the server
keypress
Starts person search on key "enter".
onFrame Animation
If animation Event takes place, animate LifeLine
onMouseDown
Starts different interactions, depending on which object was clicked.
onresize
If window changes size resize and redraw TimeNets
show_invisible_check
Displays invisible lines
timenet_list
Called when information about available timenets is received from the server
Event Payload:
-
data
Objectcontains the list of timenet ids