Class Papercube.PapersPerYearView

Extends: NodeGraph.DragPanMixin, SC.View
Defined in: clients/papercube/views/papers_per_year.js
Version: 1.0
Author: Peter Bergstrom
Copyright: 2008-2009 Peter Bergström.

Overview

Papercube.PapersPerYearView

This view shows the references or citations of a paper in chronological order, from it's publication year, into the past or the future. It uses nodes and edges to show the relationships. A paper only occurs once and there can be multiple edges going into a paper. This makes it almost the reverse of Circle View.

Constants defined in core.js:

var YEARLINE = 5; var YEARTEXT = 6; var PERYEAR_DEFAULT_SCALE = 20;

Property Summary

Method Summary

Property Details

_cached_citeThreshold [R/W]

Cite threshold cached value.

-   Integer _cached_citeThreshold

Default Value: 1


_cached_depth [R/W]

Depth cached value.

-   Integer _cached_depth

Default Value: 8


_cached_hideBogusYears [R/W]

Hide bogus paper years cached value.

-   Boolean _cached_hideBogusYears

Default Value: false


_cached_refThreshold [R/W]

Ref threshold cached value.

-   Integer _cached_refThreshold

Default Value: 0


_canvasHeight [R/W]

Cached height of the view's canvas, set by the displayProperties.

-   Integer _canvasHeight


_canvasWidth [R/W]

Cached width of the view's canvas, set by the displayProperties.

-   Integer _canvasWidth

Default Value: 800px


_displayRefs [R/W]

Display references or citations.

-   Boolean _displayRefs

Default Value: YES


_foundGuid [R/W]

The found GUID.

-   String _foundGuid


_h [R/W]

Cached height property from displayProperties.

-   Integer _h


_metaDataBoxHeightSmall [R/W]

Meta data box small height.

-   Integer _metaDataBoxHeightSmall

Default Value: 120


_metaDataBoxWidthSmall [R/W]

Meta data box small width.

-   Integer _metaDataBoxWidthSmall

Default Value: 400


_selection [R/W]

The current selection.

-   String _selection


_w [R/W]

Cached width property from displayProperties.

-   Integer _w


_x [R/W]

Cached x-axis offset property from displayProperties.

-   Integer _x


_y [R/W]

Cached y-axis offset property from displayProperties.

-   Integer _y


citeThresholdBinding [R/W]

Bind the cite threshold binding.

-   Integer citeThresholdBinding

Bound To: "Papercube.papersPerYearController.citeThreshold"

Discussion

Don't show papers with less cites.


depthBinding [R/W]

Bind the depth.

-   Integer depthBinding

Bound To: "Papercube.papersPerYearController.depth"

Discussion

Don't show items beyond this depth.


displayPropertiesBinding [R/W]

Bind the display properties from the canvasController.

-   Array displayPropertiesBinding

Bound To: "Papercube.canvasController.displayProperties"


edgeCiteColor [R/W]

Cite edge color.

-   String edgeCiteColor

Default Value: 'red'


edgeRefColor [R/W]

Ref edge color.

-   String edgeRefColor

Default Value: 'blue'


edgeWidth [R/W]

Edge width.

-   String edgeWidth

Default Value: 1px


hideBogusYearsBinding [R/W]

Bind the hide bogus year param.

-   Boolean hideBogusYearsBinding

Bound To: "Papercube.papersPerYearController.hideBogusYears"

Discussion

Don't show items that have bogus years.


metaDataView [R/W]

The DOM element that contains the meta data for an item.

-   Object metaDataView

Discussion

Bound to the '.meta-data?' element.


nodeBorderColor [R/W]

Node border color.

-   String nodeBorderColor

Default Value: '#EAA400'


nodeBorderColorSel [R/W]

Selected node border color.

-   String nodeBorderColorSel

Default Value: '#FFB60B'


nodeBorderWidth [R/W]

The default width of the node border.

-   Integer nodeBorderWidth

Default Value: 1px


nodeColor [R/W]

Node background color.

-   String nodeColor

Default Value: '#FFCB2F'


nodeColorSel [R/W]

Selected node background color.

-   String nodeColorSel

Default Value: 'yellow'


nodeOpacity [R/W]

Node opacity.

-   Float nodeOpacity

Default Value: 0.5


nodeOpacitySel [R/W]

Selected node opacity.

-   Float nodeOpacitySel

Default Value: 1.0


nodeTextColor [R/W]

Node text color.

-   String nodeTextColor

Default Value: '#666'


nodeTextRatio [R/W]

The nodeTextRatio allows the font size for the node to the calculated.

-   Integer nodeTextRatio

Default Value: 5

Discussion

The font size is calculated as radius/nodeTextRatio.


outlets [R/W]

Outlets for author stat view.

-   Object outlets


refThresholdBinding [R/W]

Bind the ref threshold binding.

-   Integer refThresholdBinding

Bound To: "Papercube.papersPerYearController.refThreshold"

Discussion

Don't show papers with less refs.


svgCanvas [R/W]

"canvas" for the svg tag.

-   DOM Element svgCanvas


viewDirectionBinding [R/W]

Bind the view direction from the viewController.

-   String viewDirectionBinding

Bound To: "Papercube.viewController.viewDirection"


yearLineColor [R/W]

Year line color

-   String yearLineColor

Default Value: '#666'


yearLineWidth [R/W]

Year line width.

-   String yearLineWidth

Default Value: 1px


yearTextColor [R/W]

Year text color

-   String yearTextColor

Default Value: '#555'


Method Detail

_checkForData()

Check what data needs to be retrieved.

-   (void) _checkForData (guid, level)

Parameters

guid {string} The guid of the item.

level {Integer} The current level.


_clearSVG()

Clear all SVG elements.

-   (void) _clearSVG ()


_clearSVGElms()

Clear SVG elements selectively.

-   (void) _clearSVGElms (has, array, svg)

Parameters

has {Object} The old DOM node cache.

array {Array} The array of currently rendered DOM nodes.

(DOM Element)svg The DOM element to attach to.


_createNode()

Create a new node element.

-   (void) _createNode (guid, params, tParams, title)

Parameters

guid {string} The cache key.

params {Object} Node positioning parameters.

tParams {Object} Text positioning parameters.

title {string} The title string.


_createSVGElement()

Create a new SVG element.

-   (Array) _createSVGElement (type, attributes, events, kind)

Parameters

type {string} The node type.

attributes {Object} The attributes hash.

events {Object} The events hash.

kind {Integer} Flag that specifies what SVG element to attach the element to.

Returns

(Array) {DOM Element} The SVG element that was created.


_createYearLine()

Create a new year line element.

-   (void) _createYearLine (guid, params)

Parameters

guid {string} The cache key.

params {Object} Year line positioning parameters.


_createYearText()

Create a new year text element.

-   (void) _createYearText (guid, params, text)

Parameters

guid {string} The cache key.

params {Object} Year text positioning parameters.


_handleErrorParams()

Create or update the error message when there are more than 300 papers in a year.

-   (void) _handleErrorParams (key, errParams)

Parameters

key {string} The cache key.

errParams {Object} Position parameters.


_handleLinesTransition()

Handle the lines and year text transition.

-   (void) _handleLinesTransition (guid, lineParams, yearTextLParams, yearTextRParams)

Parameters

guid {string} The cache key.

lineParams {Object} Line positioning parameters.

yearTextLParams {Object} Left year text positioning parameters.

yearTextRParams {Object} Right year text positioning parameters.


_handleNodeTransition()

Handle the node transition.

-   (void) _handleNodeTransition (guid, params, tParams)

Parameters

guid {string} The cache key.

params {Object} Node positioning parameters.

tParams {Object} Text positioning parameters.


_hideMetaData()

Hide meta data box.

-   (void) _hideMetaData ()


_removeEdges()

Remove selected edges.

-   (void) _removeEdges ()


_render()

Collect what needs to be rendered.

-   (void) _render ()

Discussion

Then render the view.


_showMetaData()

Show meta data for paper!

-   (Boolean) _showMetaData (coordinates, guid)

Parameters

coordinates {Object} The x,y coordinates of the mouse pointer.

guid {string} The guid of the item.

Returns

(Boolean) Returns NO if there are no coordinates or content.


_waitToCallServer()

Call the server to retrieve papers after waiting for a while.

-   (void) _waitToCallServer (guids, callBack)

Parameters

guids {Array} The array of guids that need to be retrieved.

callBack {Function} The callBack function is called when the request is successful.


displayPropertiesDidChange()

When the displayProperities binding changes, update the view appropriately.

-   (Boolean) displayPropertiesDidChange (force)

Parameters

force {boolean} If YES, force a redraw.

Returns

(Boolean) Returns NO if there is no guid of if the view is not visible.

Observes

displayProperties


init()

Initalization function.

-   (void) init ()

Discussion

Set up the SVG DOM Nodes.

Set up the fan menu actions:

focusedFan: { CiteSeer: citeseerFunc, Save: saveFunc, "Pin Lines": pinLinesFunc, "Zoom +": zoomInFunc, "Zoom -": zoomOutFunc }, unfocusedFan: { CiteSeer: citeseerFunc, Save: saveFunc, "Pin Lines": pinLinesFunc, Refocus: refocusFunc, "Zoom +": zoomInFunc, "Zoom -": zoomOutFunc }


mouseDown()

Save the GUID of the element and then show the fan.

-   (void) mouseDown (evt)

Parameters

(DOM Event)evt The mouseDown event.


mouseExited()

If the mouse leaves the area, hide the meta-data view.

-   (void) mouseExited (evt)

Parameters

(DOM Event)evt The mouseExited event.


mouseMoved()

If the mouse is moved on top of the view, see if there is any meta data to show.

-   (void) mouseMoved (evt)

Parameters

(DOM Event)evt The mouseMoved event.


pinLinesForPaper()

Pin the lines for paper.

-   (void) pinLinesForPaper ()


redrawParamsDidChange()

Redraw based on 'content', 'isVisible', 'viewDirection', 'refThreshold', 'depth', 'citeThreshold', 'hideBogusYears' binding changes.

-   (Boolean) redrawParamsDidChange ()

Returns

(Boolean) Returns NO if there is no guid of if the view is not visible.

Observes

content

isVisible

viewDirection

refThreshold

citeThreshold

depth

hideBogusYears


Documentation generated by JsDoc Toolkit 2.0.2 on Sat Nov 21 2009 21:24:39 GMT-0800 (PST)