Skip to content

Commit

Permalink
feat: working event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
eliseeborn committed Apr 28, 2023
1 parent d442e37 commit b576b57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions commands/serve/web/components/Visualize/Chart.jsx
Expand Up @@ -18,6 +18,11 @@ export default function Chart({ id, onLoad }) {
n.then((viz) => {
onLoad(viz, el.current);
});
n.then((viz) => {
viz.on('chartSelected', (chart) => {
console.log(chart);
});
});
return () => {
n.then((v) => {
v.destroy();
Expand Down
8 changes: 0 additions & 8 deletions commands/serve/web/components/Visualize/Visualize.jsx
Expand Up @@ -96,14 +96,6 @@ export default function Visualize() {
[activeViz, expandedObject, currentThemeName]
);

useEffect(() => {
if (activeViz) {
activeViz.on('chartSelected', (chart) => {
console.log(chart);
});
}
}, [activeViz]);

useEffect(() => {
if (info) initiateWatch(info);
}, [info]);
Expand Down

0 comments on commit b576b57

Please sign in to comment.