Class Papercube.PaperTreeView
| Extends: | NodeGraph.DragPanMixin, SC.View |
| Defined in: | clients/papercube/views/papertree.js |
| Version: | 1.0 |
| Author: | Peter Bergstrom |
| Copyright: | 2008-2009 Peter Bergström. |
Overview
This is a tree map-like view of papers.
Property Summary
-
- (Integer) _cached_citeThreshold [R/W]Cite threshold cached value. -
- (Integer) _cached_depth [R/W]Depth cached value. -
- (Integer) _cached_refThreshold [R/W]Ref threshold cached value. -
- (Integer) _canvasHeight [R/W]Cached height of the view's canvas, set by the displayProperties. -
- (Integer) _canvasWidth [R/W]Cached width of the view's canvas, set by the displayProperties. -
- (Boolean) _displayRefs [R/W]Display references or citations. -
- (String) _foundGuid [R/W]The found GUID. -
- (Integer) _h [R/W]Cached height property from displayProperties. -
- (Integer) _metaDataBoxHeightSmall [R/W]Meta data box small height. -
- (Integer) _metaDataBoxWidthSmall [R/W]Meta data box small width. -
- (DOM Element) _node [R/W]The node element that is cloned over and over during the construction of the tree. -
- (Integer) _rowHeight [R/W]The height of a row in the visualization. -
- (DOM Element) _styleSheet [R/W]Cached stylesheet reference. -
- (DOM Element) _textNode [R/W]The text node element that is cloned over and over during the construction of the tree. -
- (Integer) _w [R/W]Cached width property from displayProperties. -
- (Integer) _x [R/W]Cached x-axis offset property from displayProperties. -
- (Integer) _y [R/W]Cached y-axis offset property from displayProperties. -
- (Object) canvas [R/W]The canvas element, not Canvas Tag, just DIVs. -
- (Integer) citeThresholdBinding [R/W]Bind the cite threshold binding. -
- (Integer) depthBinding [R/W]Bind the depth. -
- (Array) displayPropertiesBinding [R/W]Bind the display properties from the canvasController. -
- (Object) metaDataView [R/W]The DOM element that contains the meta data for an item. -
- (Object) outlets [R/W]Outlets for author stat view. -
- (Integer) refThresholdBinding [R/W]Bind the ref threshold binding. -
- (String) viewDirectionBinding [R/W]Bind the view direction from the viewController.
Method Summary
-
- (Array) _buildLevel(guid, level, parentWidth, masterLeft, idx)Recursively draw the tree. -
- (void) _hideMetaData()Hide meta data box. -
- (void) _render()Collect what needs to be rendered. -
- (Boolean) _showMetaData(evt, guid)Show meta data for paper! -
- (Boolean) displayPropertiesDidChange(force)When the displayProperities binding changes, update the view appropriately. -
- (void) init()Initalization function. -
- (void) mouseDown(evt)Save the GUID of the element and then show the fan. -
- (void) mouseExited(evt)When the mouse is moved out of the view, remove the class name that makes it visible. -
- (Boolean) redrawParamsDidChange()Redraw based on 'content', 'isVisible', 'viewDirection', 'refThreshold', 'depth', 'citeThreshold' binding changes. -
- (void) removeHighlight()Remove the highlight of redundant nodes.
Property Details
_cached_citeThreshold [R/W]
Cite threshold cached value.
- Integer _cached_citeThreshold
Default Value: 1
_cached_refThreshold [R/W]
Ref threshold cached value.
- Integer _cached_refThreshold
Default Value: 1
_canvasHeight [R/W]
Cached height of the view's canvas, set by the displayProperties.
- Integer _canvasHeight
Discussion
Default 600px.
_canvasWidth [R/W]
Cached width of the view's canvas, set by the displayProperties.
- Integer _canvasWidth
Default Value: 800px
_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
_node [R/W]
The node element that is cloned over and over during the construction of the tree.
- DOM Element _node
_textNode [R/W]
The text node element that is cloned over and over during the construction of the tree.
- DOM Element _textNode
citeThresholdBinding [R/W]
Bind the cite threshold binding.
- Integer citeThresholdBinding
Bound To: "Papercube.paperTreeController.citeThreshold"
Discussion
Don't show papers with less cites.
depthBinding [R/W]
Bind the depth.
- Integer depthBinding
Bound To: "Papercube.paperTreeController.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"
metaDataView [R/W]
The DOM element that contains the meta data for an item.
- Object metaDataView
Discussion
Bound to the '.meta-data?' element.
refThresholdBinding [R/W]
Bind the ref threshold binding.
- Integer refThresholdBinding
Bound To: "Papercube.paperTreeController.refThreshold",
Discussion
Don't show papers with less refs.
viewDirectionBinding [R/W]
Bind the view direction from the viewController.
- String viewDirectionBinding
Bound To: "Papercube.viewController.viewDirection"
Method Detail
_buildLevel()
Recursively draw the tree.
- (Array) _buildLevel (guid, level, parentWidth, masterLeft, idx)
Parameters
guid {string} The guid of the item.
level {Integer} The current level.
parentWidth {Integer} The width of the parent element.
masterLeft {Integer} The left position.
idx {Integer} The position of the relation.
Returns
(Array) {DOM Element} Returns the contstructed node to be appended to the parent.
_showMetaData()
Show meta data for paper!
- (Boolean) _showMetaData (evt, guid)
Parameters
(DOM Element)evt The mouse event.
guid {string} The guid of the item.
Returns
(Boolean) Returns NO if there is no content.
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 DOM nodes to be cloned for the tree.
Grab the stylesheet.
Set up the fan menu actions:
focusedFan: { CiteSeer: citeseerFunc, Save: saveFunc, "Zoom +": zoomInFunc, "Zoom -": zoomOutFunc }, unfocusedFan: { CiteSeer: citeseerFunc, Save: saveFunc, 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()
When the mouse is moved out of the view, remove the class name that makes it visible.
- (void) mouseExited (evt)
Parameters
(DOM Event)evt The mouseExited event.
redrawParamsDidChange()
Redraw based on 'content', 'isVisible', 'viewDirection', 'refThreshold', 'depth', 'citeThreshold' 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
depth
citeThreshold