Closed lobis closed 3 years ago
Thanks, I've reproduced it on JS (works perfectly fine on the JVM). For some reason, it ignores the trace type parameter when used directly from JS.
The Random is not the issue. Random()
function creates a new generator with a random seed whereas Random
singleton (companion object) represents the default generator that is created on start. In this context, there is no difference.
Thanks, I've reproduced it on JS (works perfectly fine on the JVM). For some reason, it ignores the trace type parameter when used directly from JS.
The Random is not the issue.
Random()
function creates a new generator with a random seed whereasRandom
singleton (companion object) represents the default generator that is created on start. In this context, there is no difference.
For some reason I couldn't get the Random()
to work on my plot, I had to change it to Random
as you see on the code in order to work. Probably some issue with dependencies on my side. (I imported import kotlin.random.Random
to access Random
).
Just for educational purposes. The problem is that I used the direct dynamic conversion of Kotlon structures to Json and the enum class is converted into structure instead of value. Like this:
I will fix that shortly.
Fixed and will be available in 0.4.0
No, we need to migrate to a new version because there are some breaking changes and the package version change (kscience->space.kscience). I've published the 0.4.0-dev-2
to the dev repository. So you can use right now via
reposirories{
maven("https://repo.kotlin.link")
}
depdendencies{
implementation("space.kscience:plotlykt-core:0.4.0-dev-2")
}
There are breaking changes in package names, so be sure to check examples in dev branch.
I believe there is an issue with the histogram examples (or perhaps with histograms itself). I have created a simple js histogram rendering using https://github.com/mipt-npm/plotly.kt/blob/master/examples/src/main/kotlin/histogram/BasicHistogram.kt as a reference. The code is the following: (version
0.3.1
)I believe this should produce a good looking histogram however what is produced is the following:
Also there is another issue in the examples, the usage of
Random
, which according to the documentation (https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.random/-random/) should be called likeRandom.nextDouble()
instead ofRandom().nextDouble()
as it is written in the examples.