Sign in or register
for additional privileges

Scalar 1 User’s Guide

You appear to be using an older verion of Internet Explorer. For the best experience please upgrade your IE version or switch to a another web browser.

ScalarNode

The ScalarNode class represents a single node of a Scalar book.

Methods


MethodTypeDescription
getDisplayTitle( removeMarkup:boolean )stringReturns the title of the node, formatted for display. If the removeMarkup parameter is true, HTML markup will be removed from the title.
getDominantScalarType()objectReturns an object literal describing the most specialized type associated with the node— for example: while every path is also a page, this method will only return the “path” object for nodes that are paths.
getRelatedNodes( type:string, direction:string, includeNonPages:boolean )array

Returns an array of ScalarNode objects related to the node by the specified criteria.

Method parameters:
  • type - The type of relationship to match. Possible values include “annotation”, “path”, “reply” (i.e. comment), and “tag”.

  • direction - The direction of the relationship relative to this node, either “outgoing” or “incoming”.

  • includeNonPages - If true, will include non-page nodes (like authors, for example) in the results.
getRelations( type:string, direction:string, sort:string, includeNonPages:boolean )array

Returns an array of ScalarRelation objects related to the node by the specified criteria.

Method parameters:
  • type - The type of relationship to match. Possible values include “annotation”, “path”, “reply” (i.e. comment), and “tag”.

  • direction - The direction of the relationship relative to this node, either “outgoing” or “incoming”.

  • sort - Sort method to be applied to the results. Available options are “index”, which returns results in their author-specified order, or “reverseindex” which reverses the author-specified order of the results.

  • includeNonPages - If true, will include non-page nodes (like authors, for example) in the results.
getSortTitle()stringReturns the title of the node, formatted for alphabetical sorting (i.e. with initial non-alphabetic components like the word “the” removed). Normally used for internal processing of arrays of nodes.
hasScalarType( typeName:string )booleanReturns true if any of the Scalar types associated with the node match the specified type name.

Properties


PropertyTypeDescription
colorstringThe HTML color associated with this node.
currentScalarVersionThe most current known ScalarVersion associated with the node.
dataobjectThe raw JSON data for the node.
defaultViewstringThe name of the default view associated with this node.
incomingRelationsarrayAn array of ScalarRelation objects describing the node’s incoming relationships.
outgoingRelationsarrayAn array of ScalarRelation objects describing the node’s outgoing relationships.
propertiesobjectAll known properties associated with the node.
scalarTypesarrayAn array of objects describing all of the Scalar types this node is a member of.
slugstringThe unique URI segment that identifies the node within the current book.
thumbnailstringThe URL of the thumbnail image associated with this node.
urlstringThe URL of the node.
versionsarrayAn array of all known ScalarVersions associated with the node.
Comment on this page
 

Discussion of "ScalarNode"

Add your voice to this discussion.

Checking your signed in status ...

Previous page on path Scalar API JavaScript library reference, page 3 of 5 Next page on path