stratocumulus

Stratocumulus Client Documentation v0.4.0

Welcome to Stratocumulus client architecture and interface documentation.

This document follows these naming conventions: ClassName, namespace, .CONSTANT, .classMethod(), :instanceProperty, :instanceMethod(), and [optionalParameter].

See also: IntroductionExamples - GitHub

This document is generated with yamdog.

0 Stratocumulus

Abstract Components:

Components:

Data Models:

Adapters:

Libraries:

Source: client/index.js

ArtifactNode(key)

Inherits StratumNode

ArtifactNode is a card-like element in space.

Parameters:

Contents:

Source: ArtifactNode/index.js

ArtifactNode:render()

Refesh the content.

Source: render.js

ArtifactStratum(context)

Inherits Stratum

ArtifactStratum is a document collection laid on a plane.

Parameters:

ArtifactStratum emits:

Contents:

Source: ArtifactStratum/index.js

ArtifactStratum:filter(context)

Filter the stratum by a filtering context. TODO

Parameters:

Source: filter.js

ArtifactStratum:getBasisForSubstratum(subcontext)

Overrides Stratum:getBasisForSubstratum

The method returns a basis for the given subcontext. The basis is useful to position substrata.

Parameters:

Returns:

Source: getBasisForSubstratum.js

ArtifactStratum:load()

Begin constructing stratum from the back-end. This makes the stratum alive.

Source: load.js

ArtifactStratum:remove()

Destroy the ArtifactStratum. Stop loading and kill listeners. However, does not remove the plane from the DOM.

Source: remove.js

ArtifactStratum:render()

Render artifacts. If elements already exist, update. This method is idempotent, thus you can call this method multiple times without unexpected side effects.

Source: render.js

ArtifactStratum:serveSubstratum(params)

The purspose of serveSubstratum is to orchestrate the content of this stratum so that its look and feel agrees with the loading state of the substratum.

Parameters:

Source: serveSubstratum.js

ArtifactStratum:triggerSubstratum(viewport)

This method implements viewport dependent behavior that subsequently initiates the loading of substratum if zoom level and other viewport conditions so allow.

Parameters:

Source: triggerSubstratum.js

CategoryNode(key, attrs)

Inherits ArtifactNode

A node in a stratum. Stratum maintains set of nodes. A slave component, causes only visual side-effects, model-ignorant.

Parameters:

Emits:

Contents:

Source: CategoryNode/index.js

CategoryNode:makeClosed()

Make the node look and behave like it has been closed.

Source: makeClosed.js

CategoryNode:makeOpened()

Make the node look and behave like it has been opened.

Source: makeOpened.js

CategoryNode:render()

Refresh the contents.

Source: render.js

CategoryNode:setLoadingAnimation(isEnabled)

Set if loading animation running or not.

Parameters:

Source: setLoadingAnimation.js

CategoryStratum(context)

A tree graph laid on a plane. The stratum is not yet added to the document. Append stratum.space to a parent space in order to do that.

CategoryStratum inherits Stratum

Parameters:

CategoryStratum emits:

Contents:

Source: CategoryStratum/index.js

CategoryStratum:enableFaceting()

Enable stratum faceting. In other words, listen nodes for opening requests.

Source: enableFaceting.js

CategoryStratum:filter(context)

Filter the stratum by a filtering context. This will send a new stratum build job.

Parameters:

Source: filter.js

CategoryStratum:findNearbyNode(viewport)

Find a stratum node close to viewport. The result can be null.

Source: findNearbyNode.js

CategoryStratum:getBasisForSubstratum(subcontext)

Overrides Stratum:getBasisForSubstratum

The method returns a basis for the given subcontext. The basis equals the basis of the facet node that represents the substratum.

Parameters:

Returns:

Source: getBasisForSubstratum.js

CategoryStratum:getFacetNode(subcontext)

Get a node by its subcontext. Can be null if no node found.

Parameters:

Returns:

Source: getFacetNode.js

CategoryStratum:load()

Begin constructing stratum from the back-end. This makes the stratum alive.

Source: load.js

CategoryStratum:prune()

Remove all graph node and edge elements that do not anymore exist in the given graph.

Source: prune.js

CategoryStratum:remove()

Destroy the stratum. Stop loading and kill listeners. However, does not remove the stratum from the DOM.

Source: remove.js

CategoryStratum:render(final, updateCount)

Render the graph. If elements already exist, update. This method is idempotent, thus you can call this method multiple times for example once for every new substratum from the server.

Parameters:

Source: render.js

CategoryStratum:renderContextLabel()

Render or update the large text label that tells the user how the stratum was formed.

Source: renderContextLabel.js

CategoryStratum:renderOverlapEdges(getOverlap)

EXPERIMENTAL

Render edges between substrata to reveal their overlap. Useful to inspect high overlap to design improved graph layouts.

Parameters:

Source: renderOverlapEdges.js

CategoryStratum:revealLabels()

Refresh the label visibility in a semantic zoom manner. Reveals and hides the labels based on their apparent size.

Source: revealLabels.js

CategoryStratum:serveSubstratum(params)

The purspose of serveSubstratum is to orchestrate the content of this stratum so that its look and feel agrees with the loading state of the substratum.

Parameters:

Source: serveSubstratum.js

CategoryStratum:triggerSubstratum(viewport)

This method implements viewport dependent behavior that subsequently initiates the loading of substratum if zoom level and other viewport conditions so allow.

Parameters:

Source: triggerSubstratum.js

Context(keys, values)

Class and methods for handling Corpora context objects. Keeps the keys and values in the correct order. Immutable.

Parameters:

Contents:

Source: Context/index.js

Context:add(key, value)

Add a context parameter as the last parameter. Creates a new Context.

Parameters:

Returns:

Source: append.js

Context:copy()

Clone the context.

Returns:

Source: copy.js

Context:each(fn)

Call the function for each key-value pair.

Parameters:

Source: each.js

Context:equals(ctx)

Test if two contexts are equal. Two context are equal if they have the same parameters and values in same order.

Parameters:

Returns:

Source: equals.js

Context:filter(fn)

Filter the context using a boolean function.

Parameters:

Returns:

Source: filter.js

Context:getFacetingContext()

Get a subset of this context that includes only non-filter parameters.

Returns:

Source: getFacetingContext.js

Context:getFilteringContext()

Get a subset of this context that includes only filtering parameters.

Returns:

Source: getFilteringContext.js

Context:getLastFacet()

Get the last faceting property as an object.

Returns:

Source: getLastFacet.js

Context:getRangeValue(param)

Returns:

Source: getRangeValue.js

Context:getValue(param)

Returns: first value of the given parameter. Null if not found.

Source: getValue.js

Context:hasParameter(param)

Source: hasParameter.js

Context:hasValue(param, value)

Returns:

Source: hasValue.js

Context:map(fn)

Map the context to an array.

Parameters:

Returns:

Source: map.js

Context:merge(ctx)

Merge with another context.

Parameters:

Returns:

Source: merge.js

Context:remove(key[, value])

Remove a context parameter. Creates a new Context.

Parameters:

Returns:

Source: remove.js

Context:removeLastFacet()

Remove the last faceting parameter, if any. Faceting parameters are keys beginning with ‘f_’ Useful for building broader context step by step. Creates a new Context.

Returns:

Source: removeLastFacet.js

Context:toArray()

Get the context as a serialized array.

Returns:

Example:

> context.toArray()
[{ parameter, value, type, typeChar }]

Source: toArray.js

Context:toCacheKey()

Build a cache key from the context. Cache key has consistent order for the context parameters, putting the filtering keys last.

Returns:

Source: toCacheKey.js

Context:toContextObject()

Get as a plain context object. If the context has duplicate keys, their values are joined with ‘__’. Note that a plain object does not maintain the key order.

Returns:

Source: toContextObject.js

Context:toFacetPath()

Build a local URL path and facet query from the context. A facet path begins with a slash and contain only faceting queries.

Returns:

Source: toFacetPath.js

Context:toNodeKey()

Take the last faceting property and build a node key from it.

Returns:

Source: toNodeKey.js

Context:toQueryString()

Get the context as a query string, e.g. “f_genres.id=123&r_years=100to400”

Returns:

Source: toQueryString.js

Context.fromContextObject(obj)

Create a Context from an object.

Parameters:

Returns:

Source: fromContextObject.js

Context.fromFacetPath(path)

Create a context from a facet path, e.g. “/?f_genres.id=ABC”

Parameters:

Returns:

Source: fromFacetPath.js

Context.fromQueryString(query)

Create a Context from a query string, e.g. “f_genres.id=ABC”

Parameters:

Returns:

Source: fromQueryString.js

ContextForm()

ContextForm is a viewer and editor for the current Context. It emits events when the context is modified through it. It provides methods to update the context it is currently viewing.

Emits:

Contents:

Source: ContextForm/index.js

ContextForm:getElement()

Returns:

Source: getElement.js

ContextForm:render()

Render the current context.

Source: render.js

ContextForm:setContext(newContext)

Replace the context and render the new one.

Source: setContext.js

ContextLabel(context, numArtifacts)

A Stratum context label. Displays the faceting context of the stratum.

Parameters:

Contents:

Source: ContextLabel/index.js

ContextLabel(bbox)

Position the label inside a bounding box.

Parameters:

Contents:

Source: alignToBox.js

ContextLabel:update(context, numArtifacts)

Update the context and render the label again.

Source: update.js

PathManager

The path manager handles URL navigation and browser history.pushState.

Contents:

Source: PathManager/index.js

PathManager:getContext()

Get a Context from the current page URL.

Returns:

Source: getContext.js

PathManager:setContext(context)

Rewrite the current URL to reflect the given Context.

Source: setContext.js

ReduxStore

This is a Redux-like store for updating a Context object and reacting to its changes.

Contents:

Source: ReduxStore/index.js

ReduxStore:dispatch(action)

Parameters:

Source: dispatch.js

ReduxStore:getState()

Get current state. In order to modify the state, dispatch actions.

Returns:

Source: getState.js

ReduxStore:subscribe(handler)

Parameters:

Source: subscribe.js

Sky

Sky manages stratum objects and their loading.

Parameters:

Emits:

Contents:

Source: Sky/index.js

Sky:filter(context)

Filter the visible strata.

Parameters:

Source: filter.js

Sky:findCurrentStratum()

Find the current stratum. Can be null.

Returns:

Source: findCurrentStratum.js

Sky.driver(sky, loader)

Driver for TreeLoader. Driver is a handler ran at each viewport idle event. Driver is responsible of triggering semantic zooming effects. Driver initiates the loading of sub- and superstrata.

Parameters:

Source: driver.js

Sky.generator(sky, loader)

Generator for TreeLoader. Generator defines how the loaded spaces are constructed and destructed.

Parameters:

Source: generator.js

Spinner

N nodes rotating.

Gives transparent and easy to configure loading animation.

Contents:

Source: Spinner/index.js

Spinner:stop()

Stop spinning, hide the spinner.

Source: stop.js

Stratum(context)

Inherits Emitter

Abstract class for ArtifactStratum and CategoryStratum. All subclasses should expose the same interface for Sky to handle them consistently.

Parameters:

Contents:

Source: Stratum/index.js

Stratum:filter(context)

A placeholder that ensures subclasses implement the method.

Filter the stratum by a filtering context.

Parameters:

Source: filter.js

Stratum:getBasisForSubstratum(subcontext)

A placeholder that ensures subclasses implement the method.

The method should return a basis for the given subcontext. Subclasses may invent their own substratum positioning logic. Therefore this method is useful to abstract out the computation of the basis from the Sky driver.

Parameters:

Returns:

Source: getBasisForSubstratum.js

Stratum:getBoundingCircle()

Get the cached stratum boundary.

Returns:

Source: getBoundingCircle.js

Stratum:getEverySubcontext()

Get the context of each substrata.

Returns:

Source: getEverySubcontext.js

Stratum:getNodes()

Get stratum nodes in an array.

Returns:

Source: getNodes.js

Stratum:getOrigin()

Get the origin point tensor of the stratum. Useful for determining the anchor point of the stratum. In future we might want the root node be the origin.

Returns:

Source: getOrigin.js

Stratum:getSpace()

Returns:

Source: getSpace.js

Stratum:getSubcontext(node)

Get faceting context for a substratum.

Parameters:

Returns:

Source: getSubcontext.js

Stratum:getSupercontext()

Get faceting context for the superstratum. Basically takes the stratum context, and returns a new context with the last faceting parameter removed.

Returns:

Source: getSupercontext.js

Stratum:navigateToNode(context, facetParam, facetValue)

Jump viewport to certain stratum node if such node is available.

Parameters:

Source: navigateToNode.js

Stratum:navigateToStratum(context)

Jump viewport to certain stratum and load the path if needed.

Parameters:

Source: navigateToStratum.js

Stratum:recomputeBoundingCircle()

Computation of bounding circle can be heavy, thus this method computes it at demand.

Source: recomputeBoundingCircle.js

Stratum:render()

A placeholder that ensures subclasses implement the render method.

Source: render.js

Stratum:scaleNodesToFit()

Transforms the node plane so that it fits the rendering area.

Source: scaleNodesToFit.js

Stratum:serveSubstratum(params)

A placeholder that ensures subclasses implement the method.

The purspose of serveSubstratum is to orchestrate the content of this stratum so that its look and feel agrees with the loading state of the substratum.

For example, use this method to visually open a category node when its substratum is loading or loaded.

Parameters:

Source: serveSubstratum.js

Stratum:triggerSubstratum(viewport)

A placeholder that ensures subclasses implement the method.

This method implements viewport dependent behavior that subsequently initiates the loading of substratum if zoom level and other viewport conditions so allow.

Parameters:

Source: triggerSubstratum.js

StratumNode

Abstract class for ArtifactNode and CategoryNode. Useful for ensuring Sky can handle nodes through the same interface.

Parameters:

Contents:

Source: StratumNode/index.js

StratumNode:getOrigin()

Get node center point as a point tensor. Useful for getting the node position in a consistent manner.

Returns:

Source: getOrigin.js

StratumNode:getRadius()

Get node radius as a distance tensor. Useful for trimming edges between nodes.

Returns:

Source: getRadius.js

StratumNode:remove()

Remove the rendered node. Useful when the graph has been filtered.

Source: remove.js

StratumNode:render()

Render the node. A placeholder that ensures subclass implements render.

Source: render.js

StratumNode:setScale(scale)

Rescale the node. Useful when the graph model layout has changed.

Parameters:

Source: setScale.js

StratumNode:translateTo(point)

Move the node to a position. Useful when the graph model layout has changed.

Parameters:

Source: translateTo.js

StratumNode:update(data)

Update node data and render.

Parameters:

Source: update.js

TimeSlider

A year-range slider.

Contents:

Source: TimeSlider/index.js

TimeSlider:getElement()

Source: getElement.js

TimeSlider:setRange(yearRange)

Set slider position.

Parameters:

Source: setRange.js

Toolbar()

A component for search and information tools.

Emits:

Contents:

Source: Toolbar/index.js

Toolbar:getElement()

Returns:

Source: getElement.js

Toolbar:setContext(newContext)

Propagate context changes to the forms and widgets.

Source: setContext.js

ViewportManager()

The viewport manager handles the tapspace.components.Viewport setup. The manager can be used to enable or disable interaction.

For example, we would like to avoid user to interact with the viewport before there is something to show. Otherwise a few accidental moves could pan the viewport somewhere where there will be no content.

Contents:

Source: ViewportManager/index.js

ViewportManager:enableNavigation()

Enable viewport navigation: cursor panning, wheel zooming, zoom buttons, and others.

It is recommended to call this only after the space has some visible content so that user does not get lost into empty space.

Source: enableNavigation.js

ViewportManager:getViewport()

Get the Viewport object.

Source: getViewport.js

io

Stratocumulus client-side IO.

Gather here all code that handles sending and receiving data from servers and databases. This helps a lot when migrating to new or updated backend APIs.

Contents:

Source: io/index.js

io.GraphStore

Emits:

Parameters:

Contents:

Source: GraphStore/index.js

io.GraphStore:fetch(context)

Start fetching a graph with the given context. Listens stream events.

Source: fetch.js

io.GraphStore:get(context)

Get current local graph for the given context. Return empty graph if not yet available. The returned graph is meant for read-only use.

Parameters:

Returns:

Source: get.js

io.GraphStore:provide(context, nodeAttrs)

Provide the graph a single node. This does not make the graph completed. Useful to initiate the graph with a single node. If the node already exists, do nothing.

Source: provide.js

io.GraphStore:subscribe(context, handler)

Subscribe to graph event stream.

Parameters:

Source: subscribe.js

io.GraphStore:unsubscribe(context, handler)

Unsubscribe from graph event stream.

Parameters:

Source: unsubscribe.js

io.LabelStore

This is a way to collect labels for faceted context labels.

Contents:

Source: LabelStore/index.js

io.LabelStore:read(kind, id)

Read a stored label. If label does not exist, return null.

Source: read.js

io.LabelStore:write(kind, id, label)

Store a label.

Source: write.js

io.corpora.fetchArtifact(id, callback)

Fetch single artifact from the Corpora API.

Parameters:

Source: corpora.js

io.corpora.fetchArtifactPage(context, callback)

Fetch single page of artifacts.

Parameters:

Source: corpora.js

io.corpora.fetchThumbnails(callback)

Fetch federation thumbnails

Parameters:

Source: corpora.js

io.stream.connect()

Open a SSE stream and begin to listen to events.

Source: stream.js

io.stream.off(path, handler)

Unregister a path listener

Parameters:

Source: stream.js

io.stream.on(path, handler)

Register a path listener. The handler will be called with a subgraph object when an event with the given path arrives.

Parameters:

Source: stream.js

io.stream.sendStratumBuildJob(path, context)

Send a job to server to build a stratum. The job result arrives later and triggers listeners for this path.

Parameters:

Source: stream.js

↑ Back To Top