Version 2021

Common Context Menu Items

The common context menu items are the commands available for all out-of-the-box visualizations. These include Calculation, Drill, Exclude, Go to Targets, Group, Keep Only, Show Data, and Change Visualization. The common context menu items are configured by setting the commonConfig variable when using the getContextMenuConfig API.

The commonConfig variable should be an object array and each object has a type property. All the supported types can be found in the enumeration:

mstrmojo.DEFAULT_CONTEXT_MENU.

Calculation

To show the Calculation menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.CALCULATION

Visible/Enable Rules

Visible:

  • Not in presentation mode
  • Not when editing the custom visualization as a visualization filter
  • The given headers to base on are valid

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.CALCULATION
    },
    //Other commands to configure.
    //...
    ];

Drill

To show the Drill menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.DRILL

Visible/Enable Rules

Visible:

  • If selected nodes support view filter actions
  • The drill feature is supported
  • Not editing the custom visualization as a visualization filter

Enabled:

  • The given attribute to drill from is valid
  • There are candidate attributes to drill

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.DRILL
    },

Exclude

To show the Exclude menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.EXCLUDE

Visible/Enable Rules

Visible:

  • If selected nodes support view filter actions

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.EXCLUDE
    },

Go to Targets

To show the Targets menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.GO_TO_TARGETS

Visible/Enable Rules

Visible:

  • If selected nodes support view filter actions
  • Using the custom visualization to filter other visualizations in other pages

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.GO_TO_TARGETS
    },
    //Other commands to configure.
    //...
    ];

Group

To show the Group menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.GROUP

Visible/Enable Rules

Visible:

  • Not in presentation mode
  • Not editing the custom visualization as a visualization filter
  • The given headers to base on are valid

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.GROUP
    },
    //Other commands to configure.
    //...
    ];

Keep Only

To show the Keep Only menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.KEEP_ONLY

Visible/Enable Rules

Visible:

  • If selected nodes support view filter actions

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.KEEP_ONLY
    },
    //Other commands to configure.
    //...
    ];

Show Data

To display the Show Data menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.SHOW_DATA

Visible/Enable Rules

Visible:

  • If selected nodes support view filter actions

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.SHOW_DATA
    },
    //Other commands to configure.
    //...
    ];

Change Visualization

To display the Change Visualization menu item, set the type value to:

mstrmojo.DEFAULT_CONTEXT_MENU.CHANGE_VISUALIZATION

Visible/Enable Rules

Visible:

  • If isShown is true
  • Not in presentation mode
  • Not in a custom visualization when selecting data points for visualization-based filter, as shown below:
  • Not in Library

Enabled:

  • Always enabled if visible

Example

Copy
    var commonConfig = [
    //Other commands to configure.
    //...
    {
        type: mstrmojo.DEFAULT_CONTEXT_MENU.CHANGE_VISUALIZATION,
        //only show 'change visualization' context menu on blank space
        isShown: !graphicModel
    },
    //Other commands to configure.
    //...
    ];

    var customConfig = [
    //Configure the custom part of context menu.
    //...
    ];