Work with Comments in Analytic Applications
At application runtime you can view and create comments on a widget or table cell from both analytic and planning models. At design time you can leverage script APIs to allow for more actions about comments. Commenting is available in both stories and analytic applications. Only the specifics in the analytics designer are described here.
You can add comments to the following widgets in analytic applications:
-
chart
-
table
-
geo map
-
image
-
shape
-
text
-
RSS reader
-
web page
-
R visualization
-
clock
First, to enable commenting for a widget, at design time go to the Quick Menus section of its Styling panel and select Comment.
If you create a story from an analytic application, comments won’t be carried to the story.
Add Comments
For how to add comments to a table cell, refer to Adding Comments to a Data Cell.
To add comments to a widget, from the context menu select Comment.
Show or Hide Comments
In the view time mode (after selecting Exit Fullscreen), you can directly show or hide all comments by selecting Comment Mode under Display in the toolbar.
If your application is in embedded mode, you need to first switch on Commenting in Embedded Mode via . Then you can leverage the following API to show or hide comments:
Application.setCommentModeEnabled(isEnabled:bool)
Get, Post or Remove Table Cell Comments
In addition to directly creating or removing comments in an analytic application as in a story, you can leverage scripts APIs to enable getting, posting or removing comments on a table cell either based on comment IDs or the data context.
-
Select Button_1 to get the comment on one table cell and fill it into the input field.
-
Select Button_2 and post the comment in the input field to any selected table cell.
First write the following script for Button_1:
var comments = Table_1.getDataSource().getComments().getAllComments(Table_1.getSelections()[0]); console.log(comments); var str = ""; for(var i = 0 ; i < comments.length; i ++){ var text = comments[i].text; str = str + txt; } InputField_1.setValue(str);
Then write the following script for Button_2:
var str = InputField_1.getValue(); Table_1.getDataSource().getComments().addComment(Table_1.getSelections()[0],str);