Skip to main content
Version: 10.15.0

env

The env API provides read-only access to environment and system information from the ThoughtSpot platform. This includes debug mode status, device information, and color palettes.

Properties

isDebugMode

Indicates whether debug mode is enabled.

const { env } = viz;
env.isDebugMode

Type: boolean

Description: When true, indicates that the visualization is running in debug mode, which typically enables additional logging and development features.

isLiveboardContext

Indicates whether the visualization is running within a Liveboard context.

const { env } = viz;
env.isLiveboardContext

Type: boolean

Description: When true, indicates that the chart is visualised within a ThoughtSpot Liveboard.

isMobile

Indicates whether the visualization is being viewed on a mobile device.

const { env } = viz;
env.isMobile

Type: boolean

Description: When true, indicates that the user is viewing the visualization on a mobile device.

isPrintMode

Indicates whether the visualization is being rendered for printing.

const { env } = viz;
env.isPrintMode

Type: boolean

Description: When true, indicates that the chart is being exported as png or pdf format on export server.

colorPalettes

Provides access to the ThoughtSpot color palettes.

const { env } = viz;
env.colorPalettes

Type: ColorPalette[] (Array of color palette objects)

Description: Contains the color palettes defined in ThoughtSpot, typically used for consistent color schemes across visualizations.

Each color palette in the array is an object with the following properties:

PropertyTypeDescription
primaryColorstringThe main brand color in hex format (e.g., "#2770EF"). This is typically the first color used in charts and represents your organization's primary brand color.
secondaryColorsstring[]An array of additional colors in hex format that complement the primary color. These are used when multiple colors are needed (e.g., for different categories in a chart).