https://kotlinlang.org logo
#datascience
Title
# datascience
a

altavir

12/14/2023, 6:17 PM
Another question is how does kandy treat observability (both data and layout) right now? I remember we talked about that, but I do not see anything in the documentation.
a

Andrei Kislitsyn

12/14/2023, 6:26 PM
What do you mean?
Access to it after plot creation? Or during it?
a

altavir

12/14/2023, 6:30 PM
After or asynchronously inside the plot block.
a

altavir

12/15/2023, 8:31 AM
I guess it means that there is no observability. Meaning you can't react on changes of the plot after it is created.
a

Andrei Kislitsyn

12/15/2023, 8:49 AM
IR is designed to be as flexible as possible in terms of features. This means you can add any feature to it, including observability.
a

altavir

12/15/2023, 8:51 AM
It seems like you use DataFrame for data representation internally, it blocks a lot of possibilities.
a

Andrei Kislitsyn

12/15/2023, 8:53 AM
But it doesn't have to be the only one
There are no dynamic elements in kandy-lets-plot, so we have not implemented such a feature. But if you want to implement kandy for another engine, like plotly, you can add an observability
a

altavir

12/15/2023, 8:54 AM
I guess, we will discuss it more then. Right now, implementing observability requires some kind of observable maps and lists as well as more flexible data representation
a

Andrei Kislitsyn

12/15/2023, 8:55 AM
Moreover, in IR (namely in
Plot
data class) as you can see there is no binding to DataFrame - there is
TableData
- it is an interface that you can implement at your discretion.
a

altavir

12/15/2023, 8:57 AM
But there are no details in
TableData
. So you either need to reimplement the whole logic for each new data representation or there are some implementation-specific internals somwhere inside. I mean, you can't add a new representation without changing the core code.
a

Andrei Kislitsyn

12/15/2023, 9:02 AM
It's quite logical, new kind of data - new logic for working with it.
a

altavir

12/15/2023, 9:05 AM
I do not think so. The abstraction should be done in a way that adding new implementation does not break it. For example there is a DataFrame data representation, there is a more universal table format in Tables-kt and yet KMath has its own mimimal data abstraction in order to work indepenently from thos libraries.
a

Andrei Kislitsyn

12/15/2023, 11:14 AM
Key part of implementation depends on engine. You can add something like
ObservableData.plot {}
for your particular engine, with almost the same DSL (but of course you can add there new features - flexible IR allows it), and then handle a plot IR.
DataFrame is convenient for us, so we use it in kandy-lets-plot. But again, any type of data can be used in IR, but since they can be completely different and depend on the engine, the main part of the implementation is in the translator