Kino.listen for custom kinos? #1998
Replies: 3 comments 3 replies
-
It is not possible at the moment but maybe we can create our own Kino.Listenable protocol that folks could hook into? Maybe you can provide your own listen though… @jonatanklosko, is the detection/monitor API to know when you were removed from a cell public? |
Beta Was this translation helpful? Give feedback.
-
There is currently no established way, although there are ways to do it. Here's a notebook to give some ideas. |
Beta Was this translation helpful? Give feedback.
-
@josevalim I think we could have an API in |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have followed the guide to create a custom Kino with
Kino.JS.Live
. It's a visualization made with svg.js of the Circle of Fifths (music notes ordered in fifth sequence). Whenever the user clicks one of the keys (C G D A B F#...) the svg.js powered wheel rotates to show that key at noon, and I would like to capture that event in the elixir side and show some details of the tonal key in a Kino.Frame. The code I would like to write in livebook is something like this.I have no idea what's needed in the custom kino side to achieve this kind of code in a livebook cell. As I understand,
broadcast_event/3
is for sending events from elixir to js andcts.pushEvent("topic", message)
makes possible the communication in the other direction, from js to the custom Kino. What I would like to to is to be able to generate events from the custom kino that may be consumed directly in livebook. Is that possible?Thanks
Germán
Beta Was this translation helpful? Give feedback.
All reactions