Change package and version for Plotly-kt

This commit is contained in:
Alexander Nozik 2025-03-16 17:11:12 +03:00
parent bb7361d97e
commit 9131d693d6
228 changed files with 72 additions and 76 deletions

View File

@ -3,7 +3,7 @@
## Unreleased
### Added
- Plotly refactored on top of visionforge/server
- Plotly refactored on top of visionforge/server. Now it is called `plotly-kt`. Version follows general VisionForge version.
### Changed
- Simplified Vision and VisionGroup logic. Observation logic moved out.

View File

@ -7,8 +7,7 @@ plugins {
alias(spclibs.plugins.kotlinx.kover)
}
val dataforgeVersion by extra("0.10.1-dev-1")
val plotlyVersion by extra("0.8.0")
val dataforgeVersion by extra("0.10.1")
allprojects {
group = "space.kscience"

View File

@ -28,7 +28,7 @@ kotlin {
kscience {
dependencies {
implementation(projects.plotly.plotlyktCore)
implementation(projects.plotlyKt.plotlyKtCore)
implementation(projects.visionforge.visionforgeGdml)
implementation(projects.visionforge.visionforgeMarkdown)
implementation(projects.visionforge.visionforgeThreejs)

View File

@ -44,7 +44,7 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(projects.visionforgeSolid)
implementation(projects.plotly.plotlyktCore)
implementation(projects.plotlyKt.plotlyKtCore)
implementation(projects.visionforgeMarkdown)
implementation(projects.visionforgeTables)
implementation(projects.cernRootLoader)
@ -74,7 +74,7 @@ kotlin {
}
}
val debug = true
val debug = false
val jsBrowserDistribution = if(debug) {
tasks.getByName("jsBrowserDevelopmentExecutableDistribution")

View File

@ -2,29 +2,27 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"@file:Repository(\"*mavenLocal\")\n",
"@file:Repository(\"https://repo.kotlin.link\")\n",
"@file:Repository(\"https://maven.pkg.jetbrains.space/spc/p/sci/dev\")\n",
"@file:DependsOn(\"space.kscience:visionforge-jupyter-common-jvm:0.3.0-dev-12\")\n",
"//import space.kscience.visionforge.jupyter.JupyterCommonIntegration\n",
"//\n",
"//val integration = JupyterCommonIntegration()\n",
"//USE(integration.getDefinitions(notebook).first())"
]
"//@file:Repository(\"*mavenLocal\")\n",
"//@file:Repository(\"https://repo.kotlin.link\")\n",
"//@file:Repository(\"https://maven.pkg.jetbrains.space/spc/p/sci/dev\")\n",
"//@file:DependsOn(\"space.kscience:visionforge-jupyter-common-jvm:0.3.0-dev-12\")\n",
"import space.kscience.visionforge.jupyter.JupyterCommonIntegration\n",
"\n",
"val integration = JupyterCommonIntegration()\n",
"USE(integration.getDefinitions(notebook))"
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"vf.fragment {\n",
" h1 { +\"AAA\" }\n",
@ -48,15 +46,15 @@
" }\n",
" }\n",
"}"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"Plotly.plot { \n",
" scatter{\n",
@ -64,14 +62,16 @@
" y(1,2,3)\n",
" }\n",
"}"
]
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"source": [],
"outputs": [],
"source": []
"execution_count": null
}
],
"metadata": {
@ -90,7 +90,10 @@
"version": "1.8.20"
},
"ktnbPluginMetadata": {
"projectLibraries": []
"projectDependencies": [
"visionforge.demo.playground.jvmMain"
],
"projectLibraries": false
}
},
"nbformat": 4,

View File

@ -5,12 +5,10 @@ import ru.mipt.npm.root.DGeoManager
import ru.mipt.npm.root.rootGeo
import ru.mipt.npm.root.serialization.TGeoManager
import ru.mipt.npm.root.toVector
import space.kscience.dataforge.meta.Meta
import space.kscience.dataforge.meta.get
import space.kscience.dataforge.meta.isLeaf
import space.kscience.dataforge.meta.string
import space.kscience.dataforge.meta.*
import space.kscience.visionforge.Colors
import space.kscience.visionforge.html.ResourceLocation
import space.kscience.visionforge.html.meta
import space.kscience.visionforge.solid.*
import java.util.zip.ZipInputStream
import kotlin.io.path.Path
@ -41,16 +39,22 @@ fun main() {
println(it)
}
val events = BMN.readEventJson(TGeoManager::class.java.getResourceAsStream("/root/event_0.json")!!.bufferedReader().readText())
val events = BMN.readEventJson(
TGeoManager::class.java.getResourceAsStream("/root/event_0.json")!!.bufferedReader().readText()
)
makeVisionFile(path = Path("data/output.html"), resourceLocation = ResourceLocation.EMBED) {
vision("canvas") {
requirePlugin(Solids)
meta {
"layers" put ListValue(0, 1, 2, 3, 4, 5, 6)
}
solid {
ambientLight {
color(Colors.white)
}
rootGeo(geo,"BM@N", ignoreRootColors = true).also {
rootGeo(geo, "BM@N", ignoreRootColors = true).also {
Path("data/BM@N.vf.json").writeText(Solids.encodeToString(it))
}

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
### Changed
- Name change from `plotlykt` to `plotly-kt`. Version now follows VisionForge version.
- Moved plotly implementation on top of VisionForge framework.
- `Plot` and `Trace` now inherit `Vision`.
- `Trace` no longer inherit `Scheme`. It requires `Trace.Factory` and import of `space.kscience.plotly.models.invoke` to be automatically created.

View File

@ -0,0 +1,7 @@
plugins{
id("org.jetbrains.changelog")
}
readme {
readmeTemplate = file("docs/templates/README-TEMPLATE.md")
}

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -8,8 +8,8 @@ repositories {
}
dependencies {
implementation(projects.plotly.plotlyktServer)
implementation(projects.plotly.plotlyktScript)
implementation(projects.plotlyKt.plotlyKtServer)
// implementation(projects.plotly.plotlyktScript)
implementation(kotlin("script-runtime"))
implementation("org.jetbrains.kotlinx:dataframe:0.15.0")
}
@ -21,9 +21,9 @@ kotlin{
// A workaround for https://youtrack.jetbrains.com/issue/KT-44101
val copyPlotlyResources by tasks.creating(Copy::class){
dependsOn(":plotly:plotlykt-server:jvmProcessResources")
mustRunAfter(":plotly:plotlykt-server:jvmTestProcessResources")
from(project(":plotly:plotlykt-server").layout.buildDirectory.file("processedResources/jvm/main"))
dependsOn(":plotly-kt:plotly-kt-server:jvmProcessResources")
mustRunAfter(":plotly-kt:plotly-kt-server:jvmTestProcessResources")
from(project(":plotly-kt:plotly-kt-server").layout.buildDirectory.file("processedResources/jvm/main"))
into(layout.buildDirectory.file("resources/main"))
}

View File

@ -16,7 +16,7 @@ kotlin {
sourceSets {
jvmMain {
dependencies {
implementation(projects.plotly.plotlyktServer)
implementation(projects.plotlyKt.plotlyKtServer)
api("io.ktor:ktor-server-cio")
implementation(compose.runtime)

View File

@ -15,7 +15,7 @@ kotlin {
sourceSets{
jsMain{
dependencies{
implementation(projects.plotly.plotlyktCore)
implementation(projects.plotlyKt.plotlyKtCore)
implementation(spclibs.kotlinx.coroutines.core)
}
}

View File

@ -17,7 +17,7 @@ kotlin {
sourceSets{
commonMain {
dependencies {
implementation(project(":plotly:plotlykt-core"))
implementation(project(":plotly-kt:plotly-kt-core"))
}
}
}

Some files were not shown because too many files have changed in this diff Show More