Skip to content

timmermike/PSEinsteinDiscoveryCard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Note, this component is forked from thedges/PSEinsteinDiscoveryCard. Its purpose is to show the same data by calling the Scoring API directly. No "Writeback" required.

PSEinsteinDiscoveryCard

This component is an enhancement some examples found in an SDO for showing Einstein Discovery results in a component on page. The original components found were "hard coded" to the object that stored the Einstein Discovery results. This component is fully generic and can be placed on any object and all parameters are configurable.

The following is example screenshot of the component showing the Einstein Discovery results in component on right-hand side.

alt text

Pre-requisite

  • Setup Einstein Discovery and deploy a Model as defined here

Custom color and logo

Latest version has configuration options (Card title color, Header logo, Header background image, Header background color) to configure the colors to your needs. Here is sample card:

This component has the following configuration properties:

  • Prediction Definition ID - ID of the PredictionDefinition to use for live scoring

  • Card title - the title string of the card to be displayed at top

  • Card title color - the text color for the title of the card to be displayed at top

  • Header logo - the icon to show on right-side of header section; this should be relative URL to a static resource file; default is Einstein logo at "/resource/PSEinsteinImages/einstein_header_icon.svg"; if you use custom logo icon, suggest to adjust height to about 110px

  • Header background image - the background image of the header section; this should be relative URL to a static resource file; default is cloud image at "/resource/PSEinsteinImages/einstein_header_background.svg"

  • Header background color - the background color of the header section (this will override the background image)

  • Label for outcome score - the label string to display at right of outcome score

  • Unit of measure of outcome score - the unit of measure for the outcome score

  • Space before unit of measure - boolean flag to put a space before the unit of measure

  • Place unit before outcome value - boolean flag to place unit before outcome value (ex: for $ values)

  • Color range definition for red,yellow,green - a range of values to determine the color of the outcome score. The string is in format like "-100,0|0,0|0,100" where first range defines red, second yellow and third green.

  • Label for section 1 - the label to show at top of the first section of Einstein Discovery results

  • Empty msg for section 1 - the message to show if this data is empty

  • Section 1 color range - a range of values to determine the color of the section 1 values. The string is in format like "0,25|25,75|75,100" where first range defines red, second yellow and third green.

  • Section 1 Scale - number formatting - number of decimal places to show for the section 1 values.

  • Section 1 Limit - limit of results to show in section 1. "other" and "baseline" are always included. We do not recommend setting this value as 'other' does not (currently) add in the cut values.

  • Label for section 2 - the label to show at top of the section section of Einstein Discovery results

  • Empty msg for section 2 - the message to show if this data is empty

  • Section 2 color range - a range of values to determine the color of the section 2 values. The string is in format like "-100,0|0,0|0,100" where first range defines red, second yellow and third green.

  • Section 2 Scale - Number formatting - number of decimal places to show for the section 2 values.

  • Section 2 Limit - limit for results to show in section 2

Deploy to Salesforce

About

A card to show Einstein Discovery results pulled from the Scoring API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 48.3%
  • JavaScript 34.3%
  • Apex 17.4%