Now I promised to write some insights about visual...
# science
a
Now I promised to write some insights about visualization API (by the way we should think not only about plots, but also about data output like tables, I think that API could be similar). I've developed an API and JFreeChart-based implementation for DataForge. Now my team is trying to create something similar on multi-platform base. Very crude example is shown here: https://github.com/altavir/kplot/tree/dev/kplot-common/src/main/kotlin/scientifik/kplot with example here https://github.com/altavir/kplot/blob/master/kplot-examples/src/main/kotlin/scientifik/kplot/examples/JFreeChartFrameTest.kt but the quality of code there is really not so good, it was a toy model. The general idea is that using strongly typed configuration for plots keeps it tied to implementation also it makes it hard to create remote plotting (like one with controller on JVM and visualization window on browser). So instead I use tree-like value structure (I use one especially devised for DataForge, but we could use simple JSON instead). This tree is interpreted on a renderer side (renderer could be remote). Renderer just ignores tree elements it does not know. In order to make use of static typing, we can use templates or specification which are used as contexts during generation of configuration an could be used during interpretation of configuration as well (a specification just wraps a tree). The user can also use some undocumented features or reserve some special keys to transport tree as is to some renderer (in DataForge I use keys starting with @ as system). The important advantage of raw tree is that you can define a style in a same way you define configurtion and then apply it by simple merging those trees, it is purely declarative. Also configuration (and maybe data) with common structures like JSON. In DataForge, configuration is also observable, so any change in the tree is automatically reflected on the plot, I am not sure it is possible to do with Json, but there are ways to do so.