diff --git a/build.gradle.kts b/build.gradle.kts index 3b6598a3..5a0f3400 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,31 +1,35 @@ plugins { - id("ru.mipt.npm.project") + id("ru.mipt.npm.gradle.project") + kotlin("jvm") apply false + kotlin("jupyter.api") apply false } val dataforgeVersion by extra("0.3.0") -val ktorVersion by extra("1.5.1") -val htmlVersion by extra("0.7.2") -val kotlinWrappersVersion by extra("pre.129-kotlin-1.4.20") +val ktorVersion by extra(ru.mipt.npm.gradle.KScienceVersions.ktorVersion) +val htmlVersion by extra(ru.mipt.npm.gradle.KScienceVersions.htmlVersion) +val kotlinWrappersVersion by extra("pre.148-kotlin-1.4.30") val fxVersion by extra("14") allprojects { repositories { mavenLocal() + mavenCentral() jcenter() + maven("https://kotlin.bintray.com/kotlin-js-wrappers") maven("https://dl.bintray.com/pdvrieze/maven") maven("http://maven.jzy3d.org/releases") } group = "hep.dataforge" - version = "0.2.0-dev-4" + version = "0.2.0-dev-5" } val githubProject by extra("visionforge") val bintrayRepo by extra("dataforge") subprojects { - if(name.startsWith("visionforge")) { - apply() + if (name.startsWith("visionforge")) { + plugins.apply("ru.mipt.npm.gradle.publish") } } diff --git a/demo/gdml/build.gradle.kts b/demo/gdml/build.gradle.kts index ef958795..1246edad 100644 --- a/demo/gdml/build.gradle.kts +++ b/demo/gdml/build.gradle.kts @@ -2,7 +2,7 @@ import ru.mipt.npm.gradle.DependencyConfiguration import ru.mipt.npm.gradle.FXModule plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") application } diff --git a/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt b/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt index e37ba142..1ddc853e 100644 --- a/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt +++ b/demo/gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/demo/cubes.kt @@ -1,14 +1,14 @@ package hep.dataforge.vision.gdml.demo -import kscience.gdml.* +import space.kscience.gdml.* -fun cubes(): GDML = GDML { +fun cubes(): Gdml = Gdml { val center = define.position("center") structure { - val air = ref("G4_AIR") - val tubeMaterial = ref("tube") - val boxMaterial = ref("box") + val air = ref("G4_AIR") + val tubeMaterial = ref("tube") + val boxMaterial = ref("box") val segment = solids.tube("segment", 20, 5.0) { rmin = 17 deltaphi = 60 diff --git a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt index f8cd3be7..b0caeeb8 100644 --- a/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt +++ b/demo/gdml/src/jsMain/kotlin/hep/dataforge/vision/gdml/demo/GDMLAppComponent.kt @@ -15,8 +15,8 @@ import hep.dataforge.vision.solid.specifications.Canvas3DOptions import hep.dataforge.vision.solid.three.ThreeCanvas import kotlinx.browser.window import kotlinx.css.* -import kscience.gdml.GDML -import kscience.gdml.decodeFromString +import space.kscience.gdml.Gdml +import space.kscience.gdml.decodeFromString import org.w3c.files.FileReader import org.w3c.files.get import react.RProps @@ -55,7 +55,7 @@ val GDMLApp = functionalComponent("GDMLApp") { props -> val visionManager = props.context.plugins.fetch(SolidManager).visionManager val parsedVision = when { name.endsWith(".gdml") || name.endsWith(".xml") -> { - val gdml = GDML.decodeFromString(data) + val gdml = Gdml.decodeFromString(data) gdml.toVision() } name.endsWith(".json") -> visionManager.decodeFromString(data) diff --git a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt index 0a8876b2..e1756d51 100644 --- a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt +++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/readFile.kt @@ -9,7 +9,7 @@ import hep.dataforge.vision.solid.SolidManager import hep.dataforge.vision.solid.SolidMaterial import hep.dataforge.vision.Vision import hep.dataforge.vision.VisionManager -import kscience.gdml.GDML +import space.kscience.gdml.Gdml import java.io.File import java.util.zip.GZIPInputStream import java.util.zip.ZipInputStream @@ -17,7 +17,7 @@ import java.util.zip.ZipInputStream @OptIn(DFExperimental::class) fun VisionManager.readFile(file: File): Vision = when { file.extension == "gdml" || file.extension == "xml" -> { - GDML.readFile(file.toPath()).toVision { + Gdml.readFile(file.toPath()).toVision { // lUnit = LUnit.CM // // solidConfiguration = { parent, solid -> diff --git a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt index ccc7da85..472d28cf 100644 --- a/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt +++ b/demo/gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/demo/saveToJson.kt @@ -3,8 +3,8 @@ package hep.dataforge.vision.gdml.demo import hep.dataforge.vision.gdml.readFile import hep.dataforge.vision.gdml.toVision import hep.dataforge.vision.solid.SolidManager -import kscience.gdml.GDML -import kscience.gdml.LUnit +import space.kscience.gdml.Gdml +import space.kscience.gdml.LUnit import java.io.File import java.nio.file.Paths @@ -14,7 +14,7 @@ fun main(args: Array) { require(inputFileName.endsWith(".gdml")){"GDML required"} val outputFileName = args.getOrNull(1)?:inputFileName.replace(".gdml",".json") - val gdml = GDML.readFile(Paths.get(inputFileName)) + val gdml = Gdml.readFile(Paths.get(inputFileName)) //GDML.readFile(Paths.get("D:\\Work\\Projects\\visionforge\\visionforge-spatial-gdml\\src\\jvmTest\\resources\\gdml\\simple1.gdml")) val vision = gdml.toVision { diff --git a/demo/jupyter-playground/build.gradle.kts b/demo/jupyter-playground/build.gradle.kts new file mode 100644 index 00000000..5dfb8fbb --- /dev/null +++ b/demo/jupyter-playground/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + kotlin("jvm") + kotlin("jupyter.api") + id("com.github.johnrengelman.shadow") version "6.1.0" +} + +repositories { + mavenCentral() + maven("https://repo.kotlin.link") + maven("https://dl.bintray.com/mipt-npm/dataforge") + maven("https://dl.bintray.com/mipt-npm/kscience") + maven("https://dl.bintray.com/mipt-npm/dev") +} + +dependencies { + implementation(project(":demo:playground")) +} + +tasks.withType { + kotlinOptions { + useIR = true + jvmTarget = ru.mipt.npm.gradle.KScienceVersions.JVM_TARGET.toString() + } +} + +extensions.findByType()?.apply { + targetCompatibility = ru.mipt.npm.gradle.KScienceVersions.JVM_TARGET +} + +tasks.withType { + useJUnitPlatform() +} + +tasks.processJupyterApiResources { + libraryProducers = listOf("hep.dataforge.playground.VisionForgePlayGroundForJupyter") +} \ No newline at end of file diff --git a/demo/jupyter-playground/src/main/kotlin/hep/dataforge/playground/VisionForgePlayGroundForJupyter.kt b/demo/jupyter-playground/src/main/kotlin/hep/dataforge/playground/VisionForgePlayGroundForJupyter.kt new file mode 100644 index 00000000..95037870 --- /dev/null +++ b/demo/jupyter-playground/src/main/kotlin/hep/dataforge/playground/VisionForgePlayGroundForJupyter.kt @@ -0,0 +1,88 @@ +package hep.dataforge.playground + +import hep.dataforge.context.Context +import hep.dataforge.vision.VisionManager +import hep.dataforge.vision.gdml.gdml +import hep.dataforge.vision.html.Page +import hep.dataforge.vision.html.embedVisionFragment +import hep.dataforge.vision.html.fragment +import hep.dataforge.vision.html.scriptHeader +import hep.dataforge.vision.plotly.PlotlyPlugin +import hep.dataforge.vision.plotly.VisionOfPlotly +import hep.dataforge.vision.solid.SolidManager +import hep.dataforge.vision.solid.solid +import hep.dataforge.vision.visionManager +import kotlinx.html.div +import kotlinx.html.stream.createHTML +import kscience.plotly.Plot +import kscience.plotly.PlotlyFragment +import org.jetbrains.kotlinx.jupyter.api.HTML +import org.jetbrains.kotlinx.jupyter.api.Notebook +import org.jetbrains.kotlinx.jupyter.api.annotations.JupyterLibrary +import org.jetbrains.kotlinx.jupyter.api.libraries.* +import space.kscience.gdml.Gdml + +@JupyterLibrary +internal class VisionForgePlayGroundForJupyter : JupyterIntegration() { + + private val context = Context("Playground") { + plugin(SolidManager) + plugin(PlotlyPlugin) + } + + val jsBundle = ResourceFallbacksBundle(listOf(ResourceLocation("js/visionforge-playground.js", + ResourcePathType.CLASSPATH_PATH))) + val jsResource = LibraryResource(name = "VisionForge", type = ResourceType.JS, bundles = listOf(jsBundle)) + + override fun Builder.onLoaded(notebook: Notebook?) { + resource(jsResource) + + import("space.kscience.gdml.*", "kscience.plotly.*", "kscience.plotly.models.*") + + onLoaded { + val header = scriptHeader("js/visionforge-playground.js", null, hep.dataforge.vision.html.ResourceLocation.EMBED) + display(HTML(createHTML().apply(header).finalize())) + } + + render { gdmlModel -> + val fragment = VisionManager.fragment { + vision { + solid { + gdml(gdmlModel) + } + } + } + + val html = createHTML().div { + embedVisionFragment(context.visionManager, fragment = fragment) + } + + HTML(html) + } + + render { plot -> + val fragment = VisionManager.fragment { + vision { + VisionOfPlotly(plot.config) + } + } + + val html = createHTML().div { + embedVisionFragment(context.visionManager, fragment = fragment) + } + + HTML(html) + } + + render { fragment -> + HTML(createHTML().apply(fragment.visit).finalize()) + } + + render { page -> + HTML(page.render(createHTML()), true) + } + + + } + +} diff --git a/demo/muon-monitor/build.gradle.kts b/demo/muon-monitor/build.gradle.kts index 7665ce21..8b51da72 100644 --- a/demo/muon-monitor/build.gradle.kts +++ b/demo/muon-monitor/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.Companion.MAIN_COMPILATION_NAME plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") application } @@ -57,7 +57,7 @@ kotlin { } application { - mainClass.set("ru.mipt.npm.muon.monitor.server.MMServerKt") + mainClass.set("ru.mipt.npm.gradle.muon.monitor.server.MMServerKt") } distributions { diff --git a/playground/build.gradle.kts b/demo/playground/build.gradle.kts similarity index 78% rename from playground/build.gradle.kts rename to demo/playground/build.gradle.kts index 4df93ed9..3159194c 100644 --- a/playground/build.gradle.kts +++ b/demo/playground/build.gradle.kts @@ -46,22 +46,22 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - implementation(project(":visionforge-solid")) - implementation(project(":visionforge-gdml")) - implementation(project(":visionforge-plotly")) + api(project(":visionforge-solid")) + api(project(":visionforge-gdml")) + api(project(":visionforge-plotly")) } } val jsMain by getting{ dependencies { - implementation(project(":ui:bootstrap")) - implementation(project(":visionforge-threejs")) + api(project(":ui:bootstrap")) + api(project(":visionforge-threejs")) } } val jvmMain by getting{ dependencies { - implementation(project(":visionforge-server")) + api(project(":visionforge-server")) implementation("com.github.Ricky12Awesome:json-schema-serialization:0.6.6") } } diff --git a/playground/src/jsMain/kotlin/playgroundMain.kt b/demo/playground/src/jsMain/kotlin/playgroundMain.kt similarity index 100% rename from playground/src/jsMain/kotlin/playgroundMain.kt rename to demo/playground/src/jsMain/kotlin/playgroundMain.kt diff --git a/playground/src/jsMain/resources/css/common.css b/demo/playground/src/jsMain/resources/css/common.css similarity index 100% rename from playground/src/jsMain/resources/css/common.css rename to demo/playground/src/jsMain/resources/css/common.css diff --git a/playground/src/jsMain/resources/index.html b/demo/playground/src/jsMain/resources/index.html similarity index 100% rename from playground/src/jsMain/resources/index.html rename to demo/playground/src/jsMain/resources/index.html diff --git a/playground/src/jvmMain/kotlin/generateSchema.kt b/demo/playground/src/jvmMain/kotlin/generateSchema.kt similarity index 100% rename from playground/src/jvmMain/kotlin/generateSchema.kt rename to demo/playground/src/jvmMain/kotlin/generateSchema.kt diff --git a/playground/src/jvmMain/kotlin/plotlyVision.kt b/demo/playground/src/jvmMain/kotlin/plotlyVision.kt similarity index 93% rename from playground/src/jvmMain/kotlin/plotlyVision.kt rename to demo/playground/src/jvmMain/kotlin/plotlyVision.kt index 9ce31eec..22b0863b 100644 --- a/playground/src/jvmMain/kotlin/plotlyVision.kt +++ b/demo/playground/src/jvmMain/kotlin/plotlyVision.kt @@ -6,8 +6,6 @@ import hep.dataforge.vision.VisionManager import hep.dataforge.vision.html.fragment import hep.dataforge.vision.plotly.plotly import hep.dataforge.vision.plotly.withPlotly -import kotlinx.html.hr -import kotlinx.html.p import kscience.plotly.scatter @DFExperimental diff --git a/playground/src/jvmMain/kotlin/randomSpheres.kt b/demo/playground/src/jvmMain/kotlin/randomSpheres.kt similarity index 100% rename from playground/src/jvmMain/kotlin/randomSpheres.kt rename to demo/playground/src/jvmMain/kotlin/randomSpheres.kt diff --git a/playground/src/jvmMain/kotlin/serverExtensions.kt b/demo/playground/src/jvmMain/kotlin/serverExtensions.kt similarity index 97% rename from playground/src/jvmMain/kotlin/serverExtensions.kt rename to demo/playground/src/jvmMain/kotlin/serverExtensions.kt index 7e107f0e..7008e4f3 100644 --- a/playground/src/jvmMain/kotlin/serverExtensions.kt +++ b/demo/playground/src/jvmMain/kotlin/serverExtensions.kt @@ -4,9 +4,9 @@ import hep.dataforge.context.Context import hep.dataforge.misc.DFExperimental import hep.dataforge.vision.html.HtmlVisionFragment import hep.dataforge.vision.html.ResourceLocation +import hep.dataforge.vision.html.page import hep.dataforge.vision.html.scriptHeader import hep.dataforge.vision.makeFile -import hep.dataforge.vision.page import hep.dataforge.vision.three.server.VisionServer import hep.dataforge.vision.three.server.useScript import java.awt.Desktop diff --git a/playground/src/jvmMain/kotlin/simpleCube.kt b/demo/playground/src/jvmMain/kotlin/simpleCube.kt similarity index 100% rename from playground/src/jvmMain/kotlin/simpleCube.kt rename to demo/playground/src/jvmMain/kotlin/simpleCube.kt diff --git a/demo/sat-demo/build.gradle.kts b/demo/sat-demo/build.gradle.kts index 16e5d24e..c2d4c852 100644 --- a/demo/sat-demo/build.gradle.kts +++ b/demo/sat-demo/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.jvm") + id("ru.mipt.npm.gradle.jvm") application } @@ -18,5 +18,5 @@ dependencies{ } application { - mainClass.set("ru.mipt.npm.sat.SatServerKt") + mainClass.set("ru.mipt.npm.gradle.sat.SatServerKt") } diff --git a/demo/solid-showcase/build.gradle.kts b/demo/solid-showcase/build.gradle.kts index ff6e017c..6cdec7f0 100644 --- a/demo/solid-showcase/build.gradle.kts +++ b/demo/solid-showcase/build.gradle.kts @@ -2,7 +2,7 @@ import ru.mipt.npm.gradle.DependencyConfiguration import ru.mipt.npm.gradle.FXModule plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") application } diff --git a/demo/solid-showcase/src/jsMain/kotlin/hep/dataforge/vision/solid/demo/VariableBox.kt b/demo/solid-showcase/src/jsMain/kotlin/hep/dataforge/vision/solid/demo/VariableBox.kt index f9ed1443..e90cc845 100644 --- a/demo/solid-showcase/src/jsMain/kotlin/hep/dataforge/vision/solid/demo/VariableBox.kt +++ b/demo/solid-showcase/src/jsMain/kotlin/hep/dataforge/vision/solid/demo/VariableBox.kt @@ -4,7 +4,10 @@ import hep.dataforge.meta.* import hep.dataforge.names.plus import hep.dataforge.names.startsWith import hep.dataforge.values.asValue +import hep.dataforge.vision.getProperty import hep.dataforge.vision.onPropertyChange +import hep.dataforge.vision.set +import hep.dataforge.vision.setProperty import hep.dataforge.vision.solid.* import hep.dataforge.vision.solid.Solid.Companion.GEOMETRY_KEY import hep.dataforge.vision.solid.three.* diff --git a/docs/design.md b/docs/design.md index ca84e64f..79014d73 100644 --- a/docs/design.md +++ b/docs/design.md @@ -14,4 +14,6 @@ The actual layering scheme is more complicated. All objects support styling. The ### Intermediate representation +An important thing about VisionForge is that it does not strictly bound to a single format representation. + ### Kotlin DSL for creating vision-graphs \ No newline at end of file diff --git a/docs/solids.md b/docs/solids.md index a5d9441c..8f1b8e3f 100644 --- a/docs/solids.md +++ b/docs/solids.md @@ -74,4 +74,4 @@ Not all GDML solids are currently supported by the converter, they could be adde VisionForge is not tied to any single renderer. Right now the primary target is the Browser rendering with [Three.js library](https://threejs.org/). The Three.js supports different renderers including WebGL with hardware support and virtual reality. -The bindings for three-js was implemented in kotlin-js based on a [work by Lars Ivar Hatledal](https://github.com/markaren/three-kt-wrapper). The wrapper allows seamless integration with a lot of different library APIs incliding custom cameras and CSG. \ No newline at end of file +The bindings for three-js was implemented in kotlin-js based on a [work by Lars Ivar Hatledal](https://github.com/markaren/three-kt-wrapper). The wrapper allows seamless integration with a lot of different library APIs including custom cameras and CSG. \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 28ff446a..442d9132 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 007af867..68836190 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,25 +1,23 @@ pluginManagement { val kotlinVersion = "1.4.30" - val toolsVersion = "0.7.6" + val toolsVersion = "0.8.3" repositories { mavenLocal() + maven("https://repo.kotlin.link") + mavenCentral() jcenter() gradlePluginPortal() - maven("https://dl.bintray.com/kotlin/kotlin-eap") - maven("https://dl.bintray.com/kotlin/kotlinx") - maven("https://dl.bintray.com/mipt-npm/dataforge") - maven("https://dl.bintray.com/mipt-npm/kscience") - maven("https://dl.bintray.com/mipt-npm/dev") } plugins { - id("ru.mipt.npm.project") version toolsVersion - id("ru.mipt.npm.mpp") version toolsVersion - id("ru.mipt.npm.jvm") version toolsVersion - id("ru.mipt.npm.js") version toolsVersion - id("ru.mipt.npm.publish") version toolsVersion + id("ru.mipt.npm.gradle.project") version toolsVersion + id("ru.mipt.npm.gradle.mpp") version toolsVersion + id("ru.mipt.npm.gradle.jvm") version toolsVersion + id("ru.mipt.npm.gradle.js") version toolsVersion + id("ru.mipt.npm.gradle.publish") version toolsVersion kotlin("jvm") version kotlinVersion + kotlin("jupyter.api") version "0.8.3.218" kotlin("js") version kotlinVersion kotlin("multiplatform") version kotlinVersion } @@ -45,8 +43,9 @@ include( ":visionforge-server", ":visionforge-plotly", ":demo:solid-showcase", -// ":demo:gdml", + ":demo:gdml", ":demo:muon-monitor", - ":demo:sat-demo" -// ":playground" + ":demo:sat-demo", + ":demo:playground", + ":demo:jupyter-playground" ) diff --git a/ui/bootstrap/build.gradle.kts b/ui/bootstrap/build.gradle.kts index 8d404277..ed14f9c3 100644 --- a/ui/bootstrap/build.gradle.kts +++ b/ui/bootstrap/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.js") + id("ru.mipt.npm.gradle.js") } val dataforgeVersion: String by rootProject.extra diff --git a/ui/material/build.gradle.kts b/ui/material/build.gradle.kts index 15eb5377..b68d5df2 100644 --- a/ui/material/build.gradle.kts +++ b/ui/material/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.js") + id("ru.mipt.npm.gradle.js") } val dataforgeVersion: String by rootProject.extra diff --git a/ui/react/build.gradle.kts b/ui/react/build.gradle.kts index ebfa3cdd..b430a3d2 100644 --- a/ui/react/build.gradle.kts +++ b/ui/react/build.gradle.kts @@ -1,13 +1,13 @@ plugins { - id("ru.mipt.npm.js") + id("ru.mipt.npm.gradle.js") } -val reactVersion by extra("17.0.0") +val reactVersion by extra("17.0.1") val kotlinWrappersVersion: String by rootProject.extra dependencies{ api(project(":visionforge-solid")) - api("org.jetbrains:kotlin-styled:5.2.0-$kotlinWrappersVersion") + api("org.jetbrains:kotlin-styled:5.2.1-$kotlinWrappersVersion") api("org.jetbrains:kotlin-react-dom:$reactVersion-$kotlinWrappersVersion") implementation(project(":visionforge-threejs")) } \ No newline at end of file diff --git a/ui/ring/build.gradle.kts b/ui/ring/build.gradle.kts index a14662c4..16aa8c92 100644 --- a/ui/ring/build.gradle.kts +++ b/ui/ring/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.js") + id("ru.mipt.npm.gradle.js") } val dataforgeVersion: String by rootProject.extra diff --git a/visionforge-core/build.gradle.kts b/visionforge-core/build.gradle.kts index d888a4c3..05e9d619 100644 --- a/visionforge-core/build.gradle.kts +++ b/visionforge-core/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") } val dataforgeVersion: String by rootProject.extra diff --git a/visionforge-core/src/commonMain/kotlin/hep/dataforge/vision/html/Page.kt b/visionforge-core/src/commonMain/kotlin/hep/dataforge/vision/html/Page.kt index 213710cf..c9feb965 100644 --- a/visionforge-core/src/commonMain/kotlin/hep/dataforge/vision/html/Page.kt +++ b/visionforge-core/src/commonMain/kotlin/hep/dataforge/vision/html/Page.kt @@ -1,8 +1,10 @@ package hep.dataforge.vision.html import hep.dataforge.context.Context +import hep.dataforge.misc.DFExperimental import hep.dataforge.vision.visionManager import kotlinx.html.* +import kotlinx.html.stream.createHTML public data class Page( public val context: Context, @@ -24,4 +26,12 @@ public data class Page( embedVisionFragment(context.visionManager, fragment = content) } }.finalize() -} \ No newline at end of file +} + + +@DFExperimental +public fun Context.page( + title: String, + content: HtmlVisionFragment, + vararg headers: Pair, +): Page = Page(this, title, mapOf(*headers), content) \ No newline at end of file diff --git a/visionforge-core/src/jvmMain/kotlin/hep/dataforge/vision/html/htmlExport.kt b/visionforge-core/src/jvmMain/kotlin/hep/dataforge/vision/html/htmlExport.kt index e18c65c3..70fe0bab 100644 --- a/visionforge-core/src/jvmMain/kotlin/hep/dataforge/vision/html/htmlExport.kt +++ b/visionforge-core/src/jvmMain/kotlin/hep/dataforge/vision/html/htmlExport.kt @@ -56,25 +56,17 @@ import java.nio.file.Path // } //} -@DFExperimental -public fun Context.page( - title: String, - content: HtmlVisionFragment, - vararg headers: Pair, -): Page = Page(this, title, mapOf(*headers), content) - - @DFExperimental public fun Page.makeFile( path: Path?, - defaultHeaders: ((Path) -> Map)? = null, + defaultHeaders: ((Path) -> Map)? = null, ): Path { val actualFile = path?.let { Path.of(System.getProperty("user.home")).resolve(path) } ?: Files.createTempFile("tempPlot", ".html") val actualDefaultHeaders = defaultHeaders?.invoke(actualFile) - val actualPage = if(actualDefaultHeaders == null) this else copy(headers = actualDefaultHeaders + headers) + val actualPage = if (actualDefaultHeaders == null) this else copy(headers = actualDefaultHeaders + headers) val htmlString = actualPage.render(createHTML()) diff --git a/visionforge-fx/build.gradle.kts b/visionforge-fx/build.gradle.kts index 43a2d0ad..2ba679a1 100644 --- a/visionforge-fx/build.gradle.kts +++ b/visionforge-fx/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.jvm") + id("ru.mipt.npm.gradle.jvm") } val dataforgeVersion: String by rootProject.extra diff --git a/visionforge-gdml/build.gradle.kts b/visionforge-gdml/build.gradle.kts index 59f0f524..24090940 100644 --- a/visionforge-gdml/build.gradle.kts +++ b/visionforge-gdml/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") } kotlin { @@ -7,7 +7,7 @@ kotlin { val commonMain by getting { dependencies { api(project(":visionforge-solid")) - api("kscience.gdml:gdml:0.2.0") + api("space.kscience:gdml:0.2.0") } } } diff --git a/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt b/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GdmlTransformer.kt similarity index 73% rename from visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt rename to visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GdmlTransformer.kt index 69a8dbbb..098edded 100644 --- a/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GDMLTransformer.kt +++ b/visionforge-gdml/src/commonMain/kotlin/hep/dataforge/vision/gdml/GdmlTransformer.kt @@ -12,7 +12,7 @@ import hep.dataforge.vision.solid.* import hep.dataforge.vision.solid.SolidMaterial.Companion.MATERIAL_COLOR_KEY import hep.dataforge.vision.styleSheet import hep.dataforge.vision.useStyle -import kscience.gdml.* +import space.kscience.gdml.* import kotlin.math.cos import kotlin.math.sin import kotlin.random.Random @@ -26,7 +26,7 @@ private inline operator fun Number.times(d: Double) = toDouble() * d @Suppress("NOTHING_TO_INLINE") private inline operator fun Number.times(f: Float) = toFloat() * f -public class GDMLTransformerSettings { +public class GdmlTransformerSettings { public enum class Action { ADD, REJECT, @@ -36,12 +36,12 @@ public class GDMLTransformerSettings { public var lUnit: LUnit = LUnit.CM public var aUnit: AUnit = AUnit.RADIAN - public var solidAction: (GDMLSolid) -> Action = { Action.PROTOTYPE } - public var volumeAction: (GDMLGroup) -> Action = { Action.PROTOTYPE } + public var solidAction: (GdmlSolid) -> Action = { Action.PROTOTYPE } + public var volumeAction: (GdmlGroup) -> Action = { Action.PROTOTYPE } } -private class GDMLTransformer(val settings: GDMLTransformerSettings) { - //private val materialCache = HashMap() +private class GdmlTransformer(val settings: GdmlTransformerSettings) { + //private val materialCache = HashMap() private val random = Random(222) /** @@ -56,7 +56,7 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { private val referenceStore = HashMap>() - private fun proxySolid(root: GDML, group: SolidGroup, solid: GDMLSolid, name: String): SolidReferenceGroup { + private fun proxySolid(root: Gdml, group: SolidGroup, solid: GdmlSolid, name: String): SolidReferenceGroup { val templateName = solidsName + name if (proto[templateName] == null) { solids.addSolid(root, solid, name) @@ -66,7 +66,7 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { return ref } - private fun proxyVolume(root: GDML, group: SolidGroup, physVolume: GDMLPhysVolume, volume: GDMLGroup): SolidReferenceGroup { + private fun proxyVolume(root: Gdml, group: SolidGroup, physVolume: GdmlPhysVolume, volume: GdmlGroup): SolidReferenceGroup { val templateName = volumesName + volume.name.asName() if (proto[templateName] == null) { proto[templateName] = volume(root, volume) @@ -78,7 +78,7 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { private val styleCache = HashMap() - var solidConfiguration: Solid.(parent: GDMLVolume, solid: GDMLSolid) -> Unit = { parent, _ -> + var solidConfiguration: Solid.(parent: GdmlVolume, solid: GdmlSolid) -> Unit = { parent, _ -> if (parent.physVolumes.isNotEmpty()) { useStyle("opaque") { SolidMaterial.MATERIAL_OPACITY_KEY put 0.3 @@ -94,23 +94,23 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { useStyle(name) } - fun configureSolid(root: GDML, obj: Solid, parent: GDMLVolume, solid: GDMLSolid) { - val material = parent.materialref.resolve(root) ?: GDMLElement(parent.materialref.ref) + fun configureSolid(root: Gdml, obj: Solid, parent: GdmlVolume, solid: GdmlSolid) { + val material = parent.materialref.resolve(root) ?: GdmlElement(parent.materialref.ref) val styleName = "materials.${material.name}" obj.useStyle(styleName) { MATERIAL_COLOR_KEY put random.nextInt(16777216) - "gdml.material" put material.name + "Gdml.material" put material.name } obj.solidConfiguration(parent, solid) } fun T.withPosition( - newPos: GDMLPosition? = null, - newRotation: GDMLRotation? = null, - newScale: GDMLScale? = null, + newPos: GdmlPosition? = null, + newRotation: GdmlRotation? = null, + newScale: GdmlScale? = null, ): T = apply { newPos?.let { val point = Point3D(it.x(settings.lUnit), it.y(settings.lUnit), it.z(settings.lUnit)) @@ -134,23 +134,23 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { //TODO convert units if needed } - fun T.withPosition(root: GDML, physVolume: GDMLPhysVolume): T = withPosition( + fun T.withPosition(root: Gdml, physVolume: GdmlPhysVolume): T = withPosition( physVolume.resolvePosition(root), physVolume.resolveRotation(root), physVolume.resolveScale(root) ) fun SolidGroup.addSolid( - root: GDML, - solid: GDMLSolid, + root: Gdml, + solid: GdmlSolid, name: String = "", ): Solid { //context.solidAdded(solid) val lScale = solid.lscale(settings.lUnit) val aScale = solid.ascale() return when (solid) { - is GDMLBox -> box(solid.x * lScale, solid.y * lScale, solid.z * lScale, name) - is GDMLTube -> tube( + is GdmlBox -> box(solid.x * lScale, solid.y * lScale, solid.z * lScale, name) + is GdmlTube -> tube( solid.rmax * lScale, solid.z * lScale, solid.rmin * lScale, @@ -158,13 +158,13 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { solid.deltaphi * aScale, name ) - is GDMLCone -> cone(solid.rmax1, solid.z, solid.rmax2, name = name) { + is GdmlCone -> cone(solid.rmax1, solid.z, solid.rmax2, name = name) { require(solid.rmin1 == 0.0) { "Empty cones are not supported" } require(solid.rmin2 == 0.0) { "Empty cones are not supported" } startAngle = solid.startphi.toFloat() angle = solid.deltaphi.toFloat() } - is GDMLXtru -> extrude(name) { + is GdmlXtru -> extrude(name) { shape { solid.vertices.forEach { point(it.x * lScale, it.y * lScale) @@ -179,9 +179,9 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { ) } } - is GDMLScaledSolid -> { + is GdmlScaledSolid -> { //Add solid with modified scale - val innerSolid: GDMLSolid = solid.solidref.resolve(root) + val innerSolid: GdmlSolid = solid.solidref.resolve(root) ?: error("Solid with tag ${solid.solidref.ref} for scaled solid ${solid.name} not defined") addSolid(root, innerSolid, name).apply { @@ -190,12 +190,12 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { scaleZ = solid.scale.z.toFloat() } } - is GDMLSphere -> sphere(solid.rmax * lScale, solid.deltaphi * aScale, solid.deltatheta * aScale, name) { + is GdmlSphere -> sphere(solid.rmax * lScale, solid.deltaphi * aScale, solid.deltatheta * aScale, name) { phiStart = solid.startphi * aScale thetaStart = solid.starttheta * aScale } - is GDMLOrb -> sphere(solid.r * lScale, name = name) - is GDMLPolyhedra -> extrude(name) { + is GdmlOrb -> sphere(solid.r * lScale, name = name) + is GdmlPolyhedra -> extrude(name) { //getting the radius of first require(solid.planes.size > 1) { "The polyhedron geometry requires at least two planes" } val baseRadius = solid.planes.first().rmax * lScale @@ -210,13 +210,13 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { layer(plane.z * lScale, scale = plane.rmax * lScale / baseRadius) } } - is GDMLBoolSolid -> { - val first: GDMLSolid = solid.first.resolve(root) ?: error("") - val second: GDMLSolid = solid.second.resolve(root) ?: error("") + is GdmlBoolSolid -> { + val first: GdmlSolid = solid.first.resolve(root) ?: error("") + val second: GdmlSolid = solid.second.resolve(root) ?: error("") val type: CompositeType = when (solid) { - is GDMLUnion -> CompositeType.UNION - is GDMLSubtraction -> CompositeType.SUBTRACT - is GDMLIntersection -> CompositeType.INTERSECT + is GdmlUnion -> CompositeType.UNION + is GdmlSubtraction -> CompositeType.SUBTRACT + is GdmlIntersection -> CompositeType.INTERSECT } return composite(type, name) { @@ -234,30 +234,30 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { } } - is GDMLEllipsoid -> TODO("Renderer for $solid not supported yet") - is GDMLElTube -> TODO("Renderer for $solid not supported yet") - is GDMLElCone -> TODO("Renderer for $solid not supported yet") - is GDMLParaboloid -> TODO("Renderer for $solid not supported yet") - is GDMLParallelepiped -> TODO("Renderer for $solid not supported yet") - is GDMLTorus -> TODO("Renderer for $solid not supported yet") - is GDMLTrapezoid -> TODO("Renderer for $solid not supported yet") - is GDMLPolycone -> TODO("Renderer for $solid not supported yet") + is GdmlEllipsoid -> TODO("Renderer for $solid not supported yet") + is GdmlElTube -> TODO("Renderer for $solid not supported yet") + is GdmlElCone -> TODO("Renderer for $solid not supported yet") + is GdmlParaboloid -> TODO("Renderer for $solid not supported yet") + is GdmlParallelepiped -> TODO("Renderer for $solid not supported yet") + is GdmlTorus -> TODO("Renderer for $solid not supported yet") + is GdmlTrapezoid -> TODO("Renderer for $solid not supported yet") + is GdmlPolycone -> TODO("Renderer for $solid not supported yet") } } fun SolidGroup.addSolidWithCaching( - root: GDML, - solid: GDMLSolid, + root: Gdml, + solid: GdmlSolid, name: String = solid.name, ): Solid? { return when (settings.solidAction(solid)) { - GDMLTransformerSettings.Action.ADD -> { + GdmlTransformerSettings.Action.ADD -> { addSolid(root, solid, name) } - GDMLTransformerSettings.Action.PROTOTYPE -> { + GdmlTransformerSettings.Action.PROTOTYPE -> { proxySolid(root, this, solid, name) } - GDMLTransformerSettings.Action.REJECT -> { + GdmlTransformerSettings.Action.REJECT -> { //ignore null } @@ -265,14 +265,14 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { } fun SolidGroup.addPhysicalVolume( - root: GDML, - physVolume: GDMLPhysVolume, + root: Gdml, + physVolume: GdmlPhysVolume, ) { - val volume: GDMLGroup = physVolume.volumeref.resolve(root) + val volume: GdmlGroup = physVolume.volumeref.resolve(root) ?: error("Volume with ref ${physVolume.volumeref.ref} could not be resolved") // a special case for single solid volume - if (volume is GDMLVolume && volume.physVolumes.isEmpty() && volume.placement == null) { + if (volume is GdmlVolume && volume.physVolumes.isEmpty() && volume.placement == null) { val solid = volume.solidref.resolve(root) ?: error("Solid with tag ${volume.solidref.ref} for volume ${volume.name} not defined") addSolidWithCaching(root, solid, physVolume.name ?: "")?.apply { @@ -283,24 +283,24 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { } when (settings.volumeAction(volume)) { - GDMLTransformerSettings.Action.ADD -> { + GdmlTransformerSettings.Action.ADD -> { val group: SolidGroup = volume(root, volume) this[physVolume.name ?: ""] = group.withPosition(root, physVolume) } - GDMLTransformerSettings.Action.PROTOTYPE -> { + GdmlTransformerSettings.Action.PROTOTYPE -> { proxyVolume(root, this, physVolume, volume) } - GDMLTransformerSettings.Action.REJECT -> { + GdmlTransformerSettings.Action.REJECT -> { //ignore } } } fun SolidGroup.addDivisionVolume( - root: GDML, - divisionVolume: GDMLDivisionVolume, + root: Gdml, + divisionVolume: GdmlDivisionVolume, ) { - val volume: GDMLGroup = divisionVolume.volumeref.resolve(root) + val volume: GdmlGroup = divisionVolume.volumeref.resolve(root) ?: error("Volume with ref ${divisionVolume.volumeref.ref} could not be resolved") //TODO add divisions @@ -308,20 +308,20 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { } private fun volume( - root: GDML, - group: GDMLGroup, + root: Gdml, + group: GdmlGroup, ): SolidGroup = SolidGroup().apply { - if (group is GDMLVolume) { - val solid: GDMLSolid = group.solidref.resolve(root) + if (group is GdmlVolume) { + val solid: GdmlSolid = group.solidref.resolve(root) ?: error("Solid with tag ${group.solidref.ref} for volume ${group.name} not defined") addSolidWithCaching(root, solid)?.apply { configureSolid(root, this, group, solid) } - when (val vol: GDMLPlacement? = group.placement) { - is GDMLPhysVolume -> addPhysicalVolume(root, vol) - is GDMLDivisionVolume -> addDivisionVolume(root, vol) + when (val vol: GdmlPlacement? = group.placement) { + is GdmlPhysVolume -> addPhysicalVolume(root, vol) + is GdmlDivisionVolume -> addDivisionVolume(root, vol) } } @@ -332,7 +332,7 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { private fun finalize(final: SolidGroup): SolidGroup { //final.prototypes = proto - final.useStyle("GDML") { + final.useStyle("Gdml") { Solid.ROTATION_ORDER_KEY put RotationOrder.ZXY } @@ -364,19 +364,19 @@ private class GDMLTransformer(val settings: GDMLTransformerSettings) { return final } - fun transform(root: GDML): SolidGroup = finalize(volume(root, root.world)) + fun transform(root: Gdml): SolidGroup = finalize(volume(root, root.world)) } -public fun GDML.toVision(block: GDMLTransformerSettings.() -> Unit = {}): SolidGroup { - val context = GDMLTransformer(GDMLTransformerSettings().apply(block)) +public fun Gdml.toVision(block: GdmlTransformerSettings.() -> Unit = {}): SolidGroup { + val context = GdmlTransformer(GdmlTransformerSettings().apply(block)) return context.transform(this) } /** - * Append gdml node to the group + * Append Gdml node to the group */ -public fun SolidGroup.gdml(gdml: GDML, key: String = "", transformer: GDMLTransformerSettings.() -> Unit = {}) { +public fun SolidGroup.gdml(gdml: Gdml, key: String = "", transformer: GdmlTransformerSettings.() -> Unit = {}) { val visual = gdml.toVision(transformer) //println(Visual3DPlugin.json.stringify(VisualGroup3D.serializer(), visual)) set(key, visual) diff --git a/visionforge-gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/gdmlJVM.kt b/visionforge-gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/gdmlJVM.kt index 452bd0e1..14de5dcb 100644 --- a/visionforge-gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/gdmlJVM.kt +++ b/visionforge-gdml/src/jvmMain/kotlin/hep/dataforge/vision/gdml/gdmlJVM.kt @@ -1,20 +1,20 @@ package hep.dataforge.vision.gdml import hep.dataforge.vision.solid.SolidGroup -import kscience.gdml.GDML import nl.adaptivity.xmlutil.StAXReader +import space.kscience.gdml.Gdml import java.nio.file.Files import java.nio.file.Path import java.util.concurrent.atomic.AtomicInteger public actual typealias Counter = AtomicInteger -public fun GDML.Companion.readFile(file: Path): GDML { +public fun Gdml.Companion.readFile(file: Path): Gdml { val xmlReader = StAXReader(Files.newInputStream(file), "UTF-8") - return format.parse(GDML.serializer(), xmlReader) + return format.parse(Gdml.serializer(), xmlReader) } -public fun SolidGroup.gdml(file: Path, key: String = "", transformer: GDMLTransformerSettings.() -> Unit = {}) { - val gdml = GDML.readFile(file) +public fun SolidGroup.gdml(file: Path, key: String = "", transformer: GdmlTransformerSettings.() -> Unit = {}) { + val gdml = Gdml.readFile(file) gdml(gdml, key, transformer) } diff --git a/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt b/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt index 3f4df637..f5e22263 100644 --- a/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt +++ b/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/TestConvertor.kt @@ -1,7 +1,7 @@ package hep.dataforge.vision.gdml import hep.dataforge.vision.solid.SolidManager -import kscience.gdml.GDML +import space.kscience.gdml.Gdml import nl.adaptivity.xmlutil.StAXReader import org.junit.jupiter.api.Test @@ -11,7 +11,7 @@ class TestConvertor { fun testBMNGeometry() { val stream = javaClass.getResourceAsStream("/gdml/BM@N.gdml") val xmlReader = StAXReader(stream, "UTF-8") - val xml = GDML.format.parse(GDML.serializer(), xmlReader) + val xml = Gdml.format.parse(Gdml.serializer(), xmlReader) val vision = xml.toVision() println(SolidManager.encodeToString(vision)) } @@ -21,7 +21,7 @@ class TestConvertor { val stream = javaClass.getResourceAsStream("/gdml/cubes.gdml") val xmlReader = StAXReader(stream, "UTF-8") - val xml = GDML.format.parse(GDML.serializer(), xmlReader) + val xml = Gdml.format.parse(Gdml.serializer(), xmlReader) val visual = xml.toVision() // println(visual) } @@ -31,7 +31,7 @@ class TestConvertor { val stream = javaClass.getResourceAsStream("/gdml/simple1.gdml") val xmlReader = StAXReader(stream, "UTF-8") - val xml = GDML.format.parse(GDML.serializer(), xmlReader) + val xml = Gdml.format.parse(Gdml.serializer(), xmlReader) val vision = xml.toVision() println(SolidManager.encodeToString(vision)) } diff --git a/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/bmanStatistics.kt b/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/bmanStatistics.kt index c3e57a66..f5d42074 100644 --- a/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/bmanStatistics.kt +++ b/visionforge-gdml/src/jvmTest/kotlin/hep/dataforge/vision/gdml/bmanStatistics.kt @@ -5,7 +5,7 @@ import hep.dataforge.vision.visitor.countDistinct import hep.dataforge.vision.visitor.flowStatistics import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext -import kscience.gdml.GDML +import space.kscience.gdml.Gdml import nl.adaptivity.xmlutil.StAXReader import java.io.File import kotlin.reflect.KClass @@ -17,7 +17,7 @@ suspend fun main() { File("D:\\Work\\Projects\\dataforge-vis\\visionforge-gdml\\src\\jvmTest\\resources\\gdml\\BM@N.gdml").inputStream() val xmlReader = StAXReader(stream, "UTF-8") - val xml = GDML.format.parse(GDML.serializer(), xmlReader) + val xml = Gdml.format.parse(Gdml.serializer(), xmlReader) val vision = xml.toVision() diff --git a/visionforge-plotly/build.gradle.kts b/visionforge-plotly/build.gradle.kts index 1eec1565..3e197394 100644 --- a/visionforge-plotly/build.gradle.kts +++ b/visionforge-plotly/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") } val plotlyVersion = "0.3.1" diff --git a/visionforge-server/build.gradle.kts b/visionforge-server/build.gradle.kts index ff726eb5..8c98f498 100644 --- a/visionforge-server/build.gradle.kts +++ b/visionforge-server/build.gradle.kts @@ -1,7 +1,5 @@ -//import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation.Companion.MAIN_COMPILATION_NAME - plugins { - id("ru.mipt.npm.jvm") + id("ru.mipt.npm.gradle.jvm") } val ktorVersion: String by rootProject.extra diff --git a/visionforge-solid/build.gradle.kts b/visionforge-solid/build.gradle.kts index 843ae5dc..8b0b1dc2 100644 --- a/visionforge-solid/build.gradle.kts +++ b/visionforge-solid/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") } kscience{ @@ -7,7 +7,6 @@ kscience{ } kotlin { - sourceSets { commonMain { dependencies { diff --git a/visionforge-threejs/build.gradle.kts b/visionforge-threejs/build.gradle.kts index c2ce0570..c9f20e92 100644 --- a/visionforge-threejs/build.gradle.kts +++ b/visionforge-threejs/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.js") + id("ru.mipt.npm.gradle.js") } kotlin{ diff --git a/visionforge-threejs/visionforge-threejs-server/build.gradle.kts b/visionforge-threejs/visionforge-threejs-server/build.gradle.kts index ee0e74e9..696b30cf 100644 --- a/visionforge-threejs/visionforge-threejs-server/build.gradle.kts +++ b/visionforge-threejs/visionforge-threejs-server/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("ru.mipt.npm.mpp") + id("ru.mipt.npm.gradle.mpp") } val ktorVersion: String by rootProject.extra diff --git a/visionforge-threejs/visionforge-threejs-server/src/jvmMain/kotlin/hep/dataforge/vision/three/server/serverExtensions.kt b/visionforge-threejs/visionforge-threejs-server/src/jvmMain/kotlin/hep/dataforge/vision/three/server/serverExtensions.kt index 589ed03a..80948c67 100644 --- a/visionforge-threejs/visionforge-threejs-server/src/jvmMain/kotlin/hep/dataforge/vision/three/server/serverExtensions.kt +++ b/visionforge-threejs/visionforge-threejs-server/src/jvmMain/kotlin/hep/dataforge/vision/three/server/serverExtensions.kt @@ -4,9 +4,9 @@ import hep.dataforge.context.Context import hep.dataforge.misc.DFExperimental import hep.dataforge.vision.html.HtmlVisionFragment import hep.dataforge.vision.html.ResourceLocation +import hep.dataforge.vision.html.page import hep.dataforge.vision.html.scriptHeader import hep.dataforge.vision.makeFile -import hep.dataforge.vision.page import java.awt.Desktop import java.nio.file.Path