Scripting Documentation

Scripting Documentation of graphomate treemaps for SAP Lumira Designer

Rev 2020.4 – as of October 2020

PDF

Introduction

The graphomate treemaps extension supports the scripting language of Designer. Therefore, it is possible to determine properties of the extension at run-time. New data can be set or titles can be adapted. Furthermore, it is possible to use drilldown functionalities of the extension and thus create interactive dashboards.

This document provides a list of available functions, events and examples. We are steadily working on expanding the range of functions. If you miss certain functions, please give us a note. Therefore you can use our online form under http://www.graphomate.com/en/feedback.

Events

The following events are available. User-made scripts can be deposited on the Standard Properties Sheet under the point Events.

Ereignis NameBeschreibung
On Element Clicked

Is triggered if the user clicks on an element of the treemap at run-time. In order to allow a drilldown, it is necessary to react on the user input at this point. The return values of the following functions are updated at the moment of the event:
getSelectedMemberKey(),

getSelectedMemberText(),

getClickedElementIndex(),

getClickedSeriesIndex()

On New Data ArrivalIs triggered when the treemap receives updated data. This is happening, for example, when the dimension of a Data Source or if a filter has been changed.

Functions

The following functions are available in the graphomate treemaps extension. They can be addressed in the scripting editor of Designer.

Getter NameExampleReturntypeExample ReturntypeDescription
getColorScheme()GRAPHOMATETREEMAP_1.getColorScheme();StringSpectral,9Returns the current ColorBrewer scheme for the treemap. The return value contains the scheme name – an seperated with a comma – the number of classes.
getColorCalculationMethod()GRAPHOMATETREEMAP_1.getColorCalculationMethod();StringhierarchyReturns the method used for coloring the rectangles of the treemap. 
getDepth()GRAPHOMATETREEMAP_1.getDepth();int3Returns on how many levels the restriction of the hierarchy depth is fixed.
getDescriptionArea()GRAPHOMATETREEMAP_1.getDescriptionArea();booleanfalseReturns whether the rectangle labels contain the area dimension and the value of the members.
getDescriptionDeviation()GRAPHOMATETREEMAP_1.getDescriptionDeviation();booleanfalseReturns whether the rectangle labels contain the area dimension and the value of the members.
getDescriptionName()GRAPHOMATETREEMAP_1.getDescriptionName();booleanfalseReturns whether the rectangle labels contain the name of the memeber.
getDescriptionPath()GRAPHOMATETREEMAP_1.getDescriptionPath();booleantrueReturns whether the rectangle labels contain the hierarchy levels.
getDescriptionVisible()GRAPHOMATETREEMAP_1.getDescriptionVisible();booleantrueReturns whether the rectangle labels are displayed.
getEmbedded()GRAPHOMATETREEMAP_1.getEmbedded();booleanfalseReturn whether the embedded mode (frames to display the hierarchy levels) of the treemaps is active.
getExtendedNumberFormat()GRAPHOMATETREEMAP_1.getExtendedNumberFormat();String-||.|,|1|1|

Returns the number format for the extended mode. The format string can be found in the manual.

getExtendedNumberFormatPercentage()GRAPHOMATETREEMAP_1.getExtendedNumberFormatPercentage();String-||.|,|1|1|%25Returns the number format for the percentage values in the extended mode. The format string can be found in the manual.
getHideOverflowingDescriptions()GRAPHOMATETREEMAP_1.getHideOverflowingDesicription();booleantrueReturns whether the option to remove overflowing labels has been selected.
getLabelFormatMode()GRAPHOMATETREEMAP_1.getLabelFormatMode();StringextendedReturns which mode is used for the label format.
getLimitDepth()GRAPHOMATETREEMAP_1.getLimitDepth();booleantrueReturns whether it is possible to use the limitation of the depth of the hierarchy, which is represented in the treemap.
getLocale()GRAPHOMATETREEMAP_1.getLocale();StringfrReturns the setting that is currently selected for locale.
getNegativeDeviationIsGood()GRAPHOMATETREEMAP_1.getNegativeDeviationIsGood();booleantrueReturns whether the negative deviations are interpreted as positive or negative.
getNumberFormat()GRAPHOMATETREEMAP_1.getNumberFormat();String0,0.0Returns the number format for the basic mode. The format string corresponds to the format numeral.js (see http://www.numeraljs.com).
getNumberFormatPercentage()GRAPHOMATETREEMAP_1.getNumberFormatPercentage();String0 %Returns the number format for the percentage values in the basic mode. The format string corresponds to the format numeral.js (see http://www.numeraljs.com).
getRestPadding()GRAPHOMATETREEMAP_1.getRestPadding();int3Returns the width of the spacing between the frames and the treemap (for the left, right and bottom side), which is used in the embedded mode.
getSelectedMember(Dimension dimensionKey)GRAPHOMATETREEMAP_1.getSelectedMember("0D_NWI_RCOD");Member
After the user clicked on an element/a category in the treemap, this function returns the member of the specified dimension dimensionKey. The member provides different properties such as text, internalKey and externalKey.
getSelectedMemberKey(String dimensionKey)GRAPHOMATETREEMAP_1.getSelectedMemberKey("0D_NWI_RCOD");String10274After the user clicked on an element/a category in the treemap, this function returns the Key of the member of the selected dimension dimensionKey. The Keys of the dimensions are shown in the Initial View.
getSelectedMemberText(String dimensionKey)GRAPHOMATETREEMAP_1.getSelectedMemberText("0D_NWI_RCOD");StringNorth WestAfter the user clicked on an element/a category in the treemap, this function returns the Text of the member of the selected dimension dimensionKey. The return value is similar to the function getSelectedMemberKey().
getShowLegend()GRAPHOMATETREEMAP_1.getShowLegend();booleantrueReturns whether the legend (on the upper left above the treemap) is displayed.
getShowTitle()GRAPHOMATETREEMAP_1.getShowTitle();booleantrueReturns whether the title is displayed.
getTopPadding()GRAPHOMATETREEMAP_1.getTopPadding();int15Returns the width of the spacing between the top side of the frames and the treemap, which is used in the embedded mode.
getTitle()GRAPHOMATETREEMAP_1.getTitle();StringSales in Mio. EUR|2013 ACT and BUD|North WestReturns the title of the treemap as a string value. A line break is represented with a pipe (|). 
getTooltipArea()GRAPHOMATETREEMAP_1.getTooltipArea();booleanfalseReturns whether the tooltips contain the area dimension and the value of the members.
getTooltipDeviation()GRAPHOMATETREEMAP_1.getTooltipDeviation();booleanfalseReturns whether the tooltips contain the color dimension and the value of the members.
getTooltipName()GRAPHOMATETREEMAP_1.getTooltipName();booleanfalseReturns whether the tooltips contain the name of the member.
getTooltipPath()GRAPHOMATETREEMAP_1.getTooltipPath();booleantrueReturns whether the tooltips contain the hierarchy levels.
getTooltipVisible()GRAPHOMATETREEMAP_1.getTooltipVisible();booleantrueReturns whether the tooltips are displayed.
getUseFormattedData()GRAPHOMATETREEMAP_1.getUsedFormattedData();booleantrueReturns whether the preformatted data from Designer is used for the entries of the table. 


Setter NameExampleDescription
setColorCalculationMethod(String val)GRAPHOMATETREEMAP_1.setColorCalculationMethod("hierarchy");Sets the method by which the rectangles of the treemap are colored. Valid values for method are: hierarchy, areaIdentity, colorIdentity, absoluteDeviation, percentDeviation.
setColorScheme(String val)GRAPHOMATETREEMAP_1.setColorScheme("Set1, 4");Sets the new ColorBrewer scheme for the treemap and the number of classes. Both values must be separated by a comma and passed in a string. 
setDepth(int level) GRAPHOMATETREEMAP_1.setDepth(2);Limits the number of hierarchy levels displayed in the treemap to the value level.
setDescriptionpArea(boolean val)GRAPHOMATETREEMAP_1.setDescriptionArea(true);Sets whether the rectangle labels contain the area dimension and the value of the member. 
setDescriptionDeviation(boolean val)GRAPHOMATETREEMAP_1.setDescriptionDeviation(true);Sets whether the rectangle labels contain the color dimension and the value of the member.
setDescriptionName(boolean val)GRAPHOMATETREEMAP_1.setDescriptionName(true);Sets whether the rectangle labels contain the name of the member.
setDescriptionPath(boolean val)GRAPHOMATETREEMAP_1.setDescriptionPath(false);Sets whether the rectangle labels contain the area hierarchy levels.
setDescriptionVisible(boolean val)GRAPHOMATETREEMAP_1.setDescriptionVisible(true);Sets whether the rectangle lables are displayed. 
setEmbedded(boolean val)GRAPHOMATETREEMAP_1.setEmbedded(true);Allows to turn on and off the embedded mode (frame to display the hierarchy levels).
setExtendedNumberFormat(String val) GRAPHOMATETREEMAP_1.setExtendedNumberFormat("-||.|,|1|1|");Sets the number format for the extended mode. The format string can be found in the manual.
setExtendedNumberFormatPercentage(String val) GRAPHOMATETREEMAP_1.setExtendedNumberFormatPercentage("-||.|,|1|1|%25");Sets the number format for the percentages in the extended mode. The format string can be found in the manual.
setHideOverflowingDescriptions(boolean val)GRAPHOMATETREEMAP_1.setHideOverflowingDesicription(false);Sets whether overflowing labels are to be removed.
setLabelFormatMode(String val)GRAPHOMATETREEMAP_1.setLabelFormatMode("extended");

Sets a string value for the used label format mode. Available values are basic and extended.

setLimitDepth(boolean val)GRAPHOMATETREEMAP_1.setLimitDepth(false);Sets whether the limitation of the depth of the hierarchy is activated.
setLocale(String val)GRAPHOMATETREEMAP_1.setLocale("de");Sets the value of the locale. Allowed values are: de, en, fr and auto. If auto is used, the locale from the query is used for formatting the data.
setNegativeDeviationIsGood(boolean val)GRAPHOMATETREEMAP_1.setNegativeDeviationIsGood(true);Sets whether the negative deviations are interpreted as positive or negative.
setNumberFormat(String val) GRAPHOMATETREEMAP_1.setNumberFormat("0,0.0");Sets the number format for the basic mode. The format string corresponds to the format numeral.js (see http://www.numeraljs.com).
setNumberFormatPercentage(String val) GRAPHOMATETREEMAP_1.setNumberFormatPercentage("0 %");Sets the number format for the percentages in the basic mode. The format string corresponds to the format numeral.js (see http://www.numeraljs.com).
setRestPadding(int val)GRAPHOMATETREEMAP_1.setRestPadding(1);Sets the width of the spacing between the frames and the treemap (for the left, right and bottom side) in the embedded mode.
setShowLegend(boolean val)GRAPHOMATETREEMAP_1.setShowLegend(true);Sets whether the legend is displayed. 
setShowTitle(boolean val)GRAPHOMATETREEMAP_1.setShowTitle(true);Sets whether the title is displayed.
setTopPadding(int val)GRAPHOMATETREEMAP_1.setTopPadding(1);Sets the width of the spacing between the top side of the frames and the treemap in the embedded mode.
setTitle(String val)GRAPHOMATETREEMAP_1.setTitle("Sales in Mio. EUR|2013 ACT and BUD|North West");Sets the title of the treemap. Expects value as a string. Line breaks (\n) are interpreted as such.
setTooltipArea(boolean val)GRAPHOMATETREEMAP_1.setTooltipArea(true);Sets whether the tooltips contain the area dimension and the value of the member.
setTooltipDeviation(boolean val)GRAPHOMATETREEMAP_1.setTooltipDeviation(true);Sets whether the tooltips contain the color dimension and the value of the member.
setTooltipName(boolean val)GRAPHOMATETREEMAP_1.setTooltipName(true);Sets whether the tooltips contain the name of the member.
setTooltipPath(boolean val)GRAPHOMATETREEMAP_1.setTooltipPath(false);Sets whether the tooltips contain the hierarchy levels.
setTooltipVisible(boolean val)GRAPHOMATETREEMAP_1.setTooltipVisible(true);Sets whether the tooltips are displayed. 
setUseFormattedData(boolean val)GRAPHOMATETREEMAP_1.setUseFormattedData(true);Sets whether the preformatted data from Designer is used for the entries of the table. This is possible only for the values that are passed from the query. Values, which are calculated in the table itself, eg for the deviations, are formatted still either in the basic or extended number format.