Function to initialize the slider for the min max sliders
This function maps a value of an interval between 0 and 1
(number)
is the value to map
(number)
is the minimal interval boundary
(number)
is the maximal interval boundary
number
:
a value between 0 and 1
This function checks the complexity of the structure of the given sentence and returns a complexity ratiing. The complexity of a sentence is based on the number of occured splitting words normalzed by the sentence length.
(string)
the sentence of which to calculate the complexity ratio
number
:
a rating between 0 and 1
This function calculates a normalized rating based of a sentence length the used measurement is based on a study https://strainindex.wordpress.com/2008/07/28/the-average-sentence-length/
(any)
(number)
the length of the sentence to get a rating from
number
:
a rating between 0 and 1
This function calculates the different readability factors of a single sentence
(string)
the sentence of which to calculate the readability ratios.
Object
:
the different measurements how difficult the given sentence is. 0 means very easy, 1 means very difficult.
calculates the average readability of a page
(Object)
PDF Import
(any)
Function that calculates the color from a red-white-blue gradient, based on a norm.
(number)
The norm to get a color from
any
:
red, green and blue color values based on the norm(0 = red, 0.5 = white, 1 = blue)
This function renders a pdf page into a canvas with a given scal
Element
:
canvas where the pdf page renders on(may not be finished rendering when the function returns)
Given a page and a character index of the text in the page, this function will return the bloc index that that character is in
(Object)
The page object from which you have the text character index
(number)
The character index in the text of the page
number
:
The index of the bloc the character is in
This function returns the width of a text with a given font
(Element)
A temporary/hidden canvas to draw onto
(string)
The text to calculate the widh on
(string)
The name/size of the font
number
:
the width of the text with the given font
Draws a filled rectanle inside a document element
(Element)
The element in which the rectangle should be drawn in
(number)
The x coordinate relative to the parent
(number)
The y coordinate relative to the parent
(number)
The width of the rectangle
(number)
The height of the rectangle
(number)
Global scale of width and height
(string)
the fill color. Same as color in css attributes.(ex: rgb(255, 0, 0))
(string)
additional css class to give to the element
Gets the height of the viewport
number
:
the height of the viewport
This function renders the detail view of a pdf page. This page consists of the pdf preview with the text highlighted in the respective color and the table with more details about every sentence. To highlight the text parts in the pdf preview, colored+transparent HTML-divs get rendered over the canvas with the respective position and size. Finding the correct position proved a difficult task, as sentence might span multiple lines and start/end at the middle of the page. As PDFjs only returns coordinates of blocs of texts and not the actual coordinates of sentences, some calculations must be done. A sentence might begin/end in the middle of a bloc, span across multiple blocs or one bloc might even contain multiple sentences. This function handles all these scenarios so that the overlayed divs are positioned correctly.
(Object)
The pdf page object
This function renders a single page overview item in the overview screen.
(Object)
the page object which to render in the overview.
Element
:
the rendered element
renders the pages of a given pdf file in overview screen
(Object)
Object that stores the information stored in the loaded pdf
calls the function to render the overview of the pdf pages
Returns all text from a pdf
(any)
(any)
Extracts vocabulary out of a reference paper
(any)
Shows an error message at the bottom of the screen
(string)
the error message to show
call this function on the start screen, when the user finished providing information.
Initializes the accorion on the start screen
This function get called when the page is first loaded, or whenever the user comes back to the start screen. It resets all the components back to its initial values.
This function gets called whenever the user resizes the window
Creates a line with a given start position, length and angle
(number)
x start coordinate of the line
(number)
y start coordinate of the line
(number)
length of the line
(number)
orientation of the line
Element
:
an element that renders as a line
Creates a line with a given start and end position
(number)
x start coordinate of the line
(number)
y start coordinate of the line
(number)
x end coordinate of the line
(any)
(number)
y end coordinate of the line
Element
:
an element that renders as a line