Menu
Content Services

Premium Market Strategies Widget

Premium Market Strategies for displaying marketing insights.

Installation

script

Example

                              window.dtn.marketStrategies.createPremiumMarketStrategiesWidget({
 


                                
});
                              
                            

Types

Units

type Units = "Imperial" | "Metric";

These are the available metric systems that widget support.

Commodities

type Commodities = 
  | "CANOLA",
  | "CATTLE",
  | "CORN",
  | "FEED_CORN",
  | "HRS_WHEAT",
  | "SOYBEAN_MEAL",
  | "SOYBEANS",
  | "SRW_WHEAT";

This type describe possible commodities to display.

Configuration

apiKey

apiKey: string;

The widget access api key associated with your DTN account.

container

container: HTMLElement | string;

The container to mount the widget on. This can be a reference to an HTML element, or a valid selector string. If a string is encountered, document.querySelector will be used to search document for the container.

userId

userId: string;

User name in format: "firstName.lastName".

defaultCommodity

defaultCommodity: Commodities;

Set default commodities to display on widget initialization. Required field.

showCommodities

showCommodities?: Commodities[] | boolean  = true;

Whether or not to display commodities. It is possible to supply an array of commodities to display. Default set to true - lists all available Commodities.

Methods

setCommodity

setCommodity: (commodity: Commodities) => void;

Set commodity and load the widget with it.

Callbacks

onCommodityChange

onCommodityChange: (commodity: Commodities) => void;

This callback will be called whenever the commodity state changes. The callback takes a single argument which represents the new commodity state.