데이터 시각화 구성요소에 대한 샘플 코드
이벤트가 트리거될 때 작업을 정의하기 위해 샘플 코드가 제공됩니다. 웹 페이지에 구성요소를 포함하기 전에 사용 사례에 대한 샘플 코드를 업데이트합니다.
샘플 코드
{
'NOW_VIS_WRAPPER#PROPERTY_OVERRIDE' : (e) => {
// Dispatched when the visualization overrides its property. For example when the user selects a different group by from the alternative group by selection
var {properties} = e.detail.payload;
console.log(properties);
},
'NOW_VIS_WRAPPER#SELECTED' : (e) => {
// Dispatched when the user selects/de-selects element on data visualizations, typically to filter other content on the page
var {title, type, isSelected, params, data} = e.detail.payload;
console.log(title, type, isSelected, params, data);
},
'NOW_VIS_WRAPPER#CLICKED' : (e) => {
// Dispatched when the visualization is clicked
var {title, type, params, data} = e.detail.payload;
console.log(title, type, params, data);
}