Skip to content

Commit

Permalink
클릭시 새창으로 링크 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
nomelancholy committed Dec 26, 2019
1 parent 4562191 commit a8b6402
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.js
Expand Up @@ -115,7 +115,7 @@ const data = [ // list of graph elements to start with
}
];
// 아래는 공식 사이트에 올라와 있는 예제 코드입니다
var cy = cytoscape({
const cy = cytoscape({

container: document.getElementById('cy'), // container to render in

Expand Down Expand Up @@ -149,4 +149,11 @@ var cy = cytoscape({
fit: true,
tile: true
}
});

cy.on('tap', function (e) {
const url = e.target.data('url')
if (url && url !== '') {
window.open(url);
}
});

0 comments on commit a8b6402

Please sign in to comment.