Closed sureshg closed 2 years ago
We were not planning that. So far the use-case in mind was that most of the data wrangling is done on (JVM) backend and only the rendering is done by webapps frontend. So the Lets-Plot kotlin API is only available for JVM apps. Would you wish to use this API to build plots in the client entirely?
Would you wish to use this API to build plots in the client entirely?
Yes, using it as a plot/charting library (because it's 100% kotlin) for a kotlin/js application.
Good proposal.
Pls, take a look: https://github.com/JetBrains/lets-plot-kotlin/discussions/73
@alshan Awesome..will check it.
@alshan I am getting following error on the latest release. Any hint on what's wrong here?
* What went wrong:
Could not determine the dependencies of task ':packageJson'.
> Could not resolve all dependencies for configuration ':npm'.
> Could not resolve org.jetbrains.lets-plot:lets-plot-kotlin-js:3.0.1.
Required by:
project :
> No matching variant of org.jetbrains.lets-plot:lets-plot-kotlin-js:3.0.1 was found. The consumer was configured to find a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js', attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but:
- Variant 'jsApiElements-published' capability org.jetbrains.lets-plot:lets-plot-kotlin-js:3.0.1 declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
- Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir'
- Variant 'jsRuntimeElements-published' capability org.jetbrains.lets-plot:lets-plot-kotlin-js:3.0.1 declares a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js':
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'legacy' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir'
- Variant 'metadataApiElements-published' capability org.jetbrains.lets-plot:lets-plot-kotlin-js:3.0.1:
- Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a usage of 'kotlin-runtime' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
- Other compatible attribute:
- Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
plugins {
kotlin("js") version "1.5.20"
kotlin("plugin.serialization") version "1.5.20"
}
kotlin {
js(IR) {
browser {
distribution {
directory = File("$projectDir/docs")
}
commonWebpackConfig {
cssSupport.enabled = true
outputFileName = "app.js"
}
testTask {
useKarma {
useChromeHeadless()
}
}
}
binaries.executable()
compilations.all { kotlinOptions {} }
}
}
...
dependencies {
...
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-js:3.0.1")
}
Hi @sureshg , turned out that Lets-plot library v3.0.1 is not compatible with new Kotlin/JS compiler IR backend.
We will migrate to IR in the next release. Meanwhile, the only option it seems is to use the legacy (default) compiler backend.
@alshan Thanks, will wait for the next IR release then.
Update: in v3.0.2 we haven't manage to generate Kotlin/JS IR artifacts due to one issue (at least): KJS / IR: "NullPointerException: Parameter specified as non-null is null".
It seems like this issue affects not only Kotlin v1.5.21 but v1.5.30-M1 as well.
Hi @sureshg , it took a while, Kotlin/JS IR compiler is finally supported in v3.1.0
Here is an example of a simple Kotlin/JS IR app.
Are there any plans to make this library multiplatform, so that it can be used in Kotlin/JS based web applications?