Adding Comments to Widgets and Table Cells
Commenting is available in both stories and analytic applications. Only the usage specific to the analytics designer is described here.
You can view and create comments on a widget or a table cell from both analytic models and planning models.
Widgets that you can add comments to include:
-
chart
-
table
-
geo map
-
image
-
shape
-
text
-
RSS reader
-
web page
-
R visualization
-
clock
To enable or disable the comment option in the quick menu of a widget, you can go to the Quick Menus section of the widget's Styling panel, then select or deselect the option Comment.
If you create a story from an analytic application, comments in the application won’t be carried to the created story.
When running an analytic application, in the view mode (Exit Fullscreen), you can directly show or hide all comments by choosing the Display button from the toolbar and check the option Comment Mode. In the embed mode, you need to first enable the option Commenting in Embedded Mode via , then you can leverage the following API to show or hide comments:
Application.setCommentModeEnabled(isEnabled:bool)
In addition to directly creating or removing comments in an analytic application as in a story, you can leverage corresponding scripts APIs to get, post, remove comments on a table cell either based on comment IDs or the data context.
All the comments added are also displayed in the Comments view of the Collaboration panel. But currently there's a limitation that even if you hide a widget, all comments related to the widget will still be displayed in the Collaboration panel.
-
Click a button (Button_1) and get the comment created on one cell and input it into the input field.
-
Click another button (Button_2) and post the comment in the input field to any table cell they select.
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);