# Methods

To support deeper customization, Cartographer provides a number of public API methods.

# currentProject v2

Returns current project configuration.

# currentFactors v2

Returns user input data vector, including both activated and non-activated answers.

See afterUpdateFactor event for description of available factor data elements.

# currentActiveFactors v2

Returns user input data vector, including only activated answers.

# isReplaying

Returns whether Cartographer is currently in the replay state, such as when restoring recommendations state after returning to the recommender from visiting recommended product detail page.

See History Replay section for the description of managing history state.

# replay

Replays the provided history state array.

PARAMETER PURPOSE
events Array of history events

# saveSession v3

Saves current session details.

PARAMETER PURPOSE
callback A callback to receive saved session key and session details.

# replaySession v3

Retrieves previously saved session details. Use replay method to restore the previous quiz state.

PARAMETER PURPOSE
sessionKey Previously saved session key.
callback A callback to receive saved session details.

# updateRecommendations

Refreshes recommendations.

# deactivateQuestions

Deactivates given question without removing user selections. This is useful when implementing custom page routing and it is necessary to preserve selected answers rather than clearing them when returning to earlier pages.

PARAMETER PURPOSE
$question DOM element containing the question.

# undoQuestions

Unlike deactivateQuestion method, removes user selections from given questions and updates history state.

PARAMETER PURPOSE
$questions jQuery list with DOM elements containing questions to remove selections from.

Navigates to any page preceding the current page. Target page must have been passed through by the user on the way to the current page, meaning it is not possible to jump recommendation tree branches using this method. Automatically deactivates and removes user selection from pages.

Only returning to the previously visited page is supported, and it is not possible to jump to not yet visited page.

PARAMETER PURPOSE
$page DOM element containing the target page.

# restart v2

Completely resets recommender state without reloading the page. As result of this method, all questions will be deactivated, user answers will be removed, and the first page will be displayed.

# summary

Retrieves current summary description.