0.3.0 #23

Open
altavir wants to merge 40 commits from dev into main
48 changed files with 155 additions and 245 deletions
Showing only changes of commit 7ca4bba1b7 - Show all commits

View File

@ -5,7 +5,6 @@
### Added ### Added
### Changed ### Changed
- Package changed to `space.kscience`
### Deprecated ### Deprecated
@ -14,3 +13,14 @@
### Fixed ### Fixed
### Security ### Security
## 0.3.0 - 2024-06-04
### Changed
- Package changed to `space.kscience`
- Kotlin 2.0
### Fixed
- Use of generated resources for Wasm

View File

@ -9,7 +9,6 @@ This repository is a work-in-progress implementation of Map-with-markers compone
### [demo](demo) ### [demo](demo)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [maps-kt-compose](maps-kt-compose) ### [maps-kt-compose](maps-kt-compose)
@ -34,17 +33,14 @@ This repository is a work-in-progress implementation of Map-with-markers compone
### [maps-kt-features](maps-kt-features) ### [maps-kt-features](maps-kt-features)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [maps-kt-geojson](maps-kt-geojson) ### [maps-kt-geojson](maps-kt-geojson)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [maps-kt-scheme](maps-kt-scheme) ### [maps-kt-scheme](maps-kt-scheme)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [trajectory-kt](trajectory-kt) ### [trajectory-kt](trajectory-kt)
@ -54,20 +50,20 @@ This repository is a work-in-progress implementation of Map-with-markers compone
### [demo/maps](demo/maps) ### [demo/maps](demo/maps)
> >
> **Maturity**: EXPERIMENTAL
### [demo/maps-wasm](demo/maps-wasm)
> >
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [demo/polygon-editor](demo/polygon-editor) ### [demo/polygon-editor](demo/polygon-editor)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [demo/scheme](demo/scheme) ### [demo/scheme](demo/scheme)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL
### [demo/trajectory-playground](demo/trajectory-playground) ### [demo/trajectory-playground](demo/trajectory-playground)
> >
>
> **Maturity**: EXPERIMENTAL > **Maturity**: EXPERIMENTAL

View File

@ -9,7 +9,7 @@ val kmathVersion: String by extra("0.4.0")
allprojects { allprojects {
group = "space.kscience" group = "space.kscience"
version = "0.3.0-dev-2" version = "0.3.0"
repositories { repositories {
mavenLocal() mavenLocal()

View File

@ -2,7 +2,8 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
} }
//val ktorVersion: String by rootProject.extra //val ktorVersion: String by rootProject.extra
@ -14,17 +15,23 @@ kotlin {
binaries.executable() binaries.executable()
} }
sourceSets { sourceSets {
val wasmJsMain by getting { commonMain {
dependencies {
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
api(compose.components.resources)
}
}
wasmJsMain {
dependencies { dependencies {
implementation(projects.mapsKtScheme) implementation(projects.mapsKtScheme)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) api(compose.components.resources)
} }
} }
} }
} }
compose { compose {
experimental.web{ web {
application{}
} }
} }

View File

@ -4,18 +4,19 @@ import androidx.compose.runtime.*
import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.window.CanvasBasedWindow import androidx.compose.ui.window.CanvasBasedWindow
import center.sciprog.maps.features.FeatureGroup
import center.sciprog.maps.features.ViewConfig
import center.sciprog.maps.features.ViewPoint
import center.sciprog.maps.features.color
import center.sciprog.maps.scheme.*
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.painterResource
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.maps.features.FeatureGroup
import space.kscience.maps.features.ViewConfig
import space.kscience.maps.features.ViewPoint
import space.kscience.maps.features.color
import space.kscience.maps.scheme.*
import space.kscience.maps_wasm.generated.resources.Res
import space.kscience.maps_wasm.generated.resources.middle_earth
@Composable @Composable
@ -25,7 +26,9 @@ fun App() {
val features: FeatureGroup<XY> = FeatureGroup.remember(XYCoordinateSpace) { val features: FeatureGroup<XY> = FeatureGroup.remember(XYCoordinateSpace) {
background(1600f, 1200f) { painterResource(DrawableResource("middle-earth.jpg")) } background(1600f, 1200f) {
painterResource(Res.drawable.middle_earth)
}
circle(410.52737 to 868.7676).color(Color.Blue) circle(410.52737 to 868.7676).color(Color.Blue)
text(410.52737 to 868.7676, "Shire").color(Color.Blue) text(410.52737 to 868.7676, "Shire").color(Color.Blue)
circle(1132.0881 to 394.99127).color(Color.Red) circle(1132.0881 to 394.99127).color(Color.Red)

View File

@ -2,7 +2,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
} }
val ktorVersion: String by rootProject.extra val ktorVersion: String by rootProject.extra

View File

@ -13,9 +13,6 @@ import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import center.sciprog.maps.compose.*
import center.sciprog.maps.features.*
import center.sciprog.maps.geojson.geoJson
import io.ktor.client.HttpClient import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO import io.ktor.client.engine.cio.CIO
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@ -29,9 +26,12 @@ import space.kscience.attributes.Attributes
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.degrees import space.kscience.kmath.geometry.degrees
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import space.kscience.maps.compose.*
import space.kscience.maps.coordinates.GeodeticMapCoordinates import space.kscience.maps.coordinates.GeodeticMapCoordinates
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.kilometers import space.kscience.maps.coordinates.kilometers
import space.kscience.maps.features.*
import space.kscience.maps.geojson.geoJson
import java.nio.file.Path import java.nio.file.Path
import kotlin.math.PI import kotlin.math.PI
import kotlin.random.Random import kotlin.random.Random

View File

@ -2,7 +2,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
} }
val ktorVersion: String by rootProject.extra val ktorVersion: String by rootProject.extra

View File

@ -9,11 +9,11 @@ import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.compose.ui.input.pointer.isSecondaryPressed import androidx.compose.ui.input.pointer.isSecondaryPressed
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import center.sciprog.maps.features.* import space.kscience.maps.features.*
import center.sciprog.maps.scheme.SchemeView import space.kscience.maps.scheme.SchemeView
import center.sciprog.maps.scheme.XY import space.kscience.maps.scheme.XY
import center.sciprog.maps.scheme.XYCoordinateSpace import space.kscience.maps.scheme.XYCanvasState
import center.sciprog.maps.scheme.XYCanvasState import space.kscience.maps.scheme.XYCoordinateSpace
@Composable @Composable
@Preview @Preview

View File

@ -2,7 +2,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
} }
val ktorVersion: String by rootProject.extra val ktorVersion: String by rootProject.extra

View File

@ -8,18 +8,18 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import center.sciprog.maps.features.FeatureGroup
import center.sciprog.maps.features.ViewConfig
import center.sciprog.maps.features.ViewPoint
import center.sciprog.maps.features.color
import center.sciprog.maps.scheme.*
import center.sciprog.maps.svg.FeatureStateSnapshot
import center.sciprog.maps.svg.exportToSvg
import center.sciprog.maps.svg.snapshot
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.maps.features.FeatureGroup
import space.kscience.maps.features.ViewConfig
import space.kscience.maps.features.ViewPoint
import space.kscience.maps.features.color
import space.kscience.maps.scheme.*
import space.kscience.maps.svg.FeatureStateSnapshot
import space.kscience.maps.svg.exportToSvg
import space.kscience.maps.svg.snapshot
import java.awt.Desktop import java.awt.Desktop
import java.nio.file.Files import java.nio.file.Files

View File

@ -5,9 +5,9 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import center.sciprog.maps.features.* import space.kscience.maps.features.*
import center.sciprog.maps.scheme.* import space.kscience.maps.scheme.*
import center.sciprog.maps.scheme.XYCoordinateSpace.Rectangle import space.kscience.maps.scheme.XYCoordinateSpace.Rectangle
fun main() = application { fun main() = application {

View File

@ -1,6 +1,7 @@
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
} }
val ktorVersion: String by rootProject.extra val ktorVersion: String by rootProject.extra

View File

@ -8,13 +8,13 @@ import androidx.compose.runtime.*
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import center.sciprog.maps.features.*
import center.sciprog.maps.scheme.SchemeView
import center.sciprog.maps.scheme.XY
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.Vector2D import space.kscience.kmath.geometry.Vector2D
import space.kscience.kmath.geometry.euclidean2d.Circle2D import space.kscience.kmath.geometry.euclidean2d.Circle2D
import space.kscience.kmath.geometry.euclidean2d.Float64Space2D import space.kscience.kmath.geometry.euclidean2d.Float64Space2D
import space.kscience.maps.features.*
import space.kscience.maps.scheme.SchemeView
import space.kscience.maps.scheme.XY
import space.kscience.trajectory.* import space.kscience.trajectory.*
import kotlin.random.Random import kotlin.random.Random

View File

@ -1,13 +1,5 @@
kotlin.code.style=official kotlin.code.style=official
compose.version=1.6.0-rc02
org.jetbrains.compose.experimental.wasm.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
agp.version=8.1.0
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx4096m org.gradle.jvmargs=-Xmx4096m
toolsVersion=0.15.2-kotlin-1.9.22 toolsVersion=0.15.4-kotlin-2.0.0

View File

@ -7,19 +7,8 @@ The core interfaces of KMath.
## Artifact: ## Artifact:
The Maven coordinates of this project are `center.sciprog:maps-kt-compose:0.2.2`. The Maven coordinates of this project are `space.kscience:maps-kt-compose:0.3.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'center.sciprog:maps-kt-compose:0.2.2'
}
```
**Gradle Kotlin DSL:** **Gradle Kotlin DSL:**
```kotlin ```kotlin
repositories { repositories {
@ -28,6 +17,6 @@ repositories {
} }
dependencies { dependencies {
implementation("center.sciprog:maps-kt-compose:0.2.2") implementation("space.kscience:maps-kt-compose:0.3.0")
} }
``` ```

View File

@ -1,6 +1,7 @@
plugins { plugins {
id("space.kscience.gradle.mpp") id("space.kscience.gradle.mpp")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
// id("com.android.library") // id("com.android.library")
`maven-publish` `maven-publish`
} }
@ -10,41 +11,23 @@ kscience {
wasm() wasm()
useCoroutines() useCoroutines()
}
kotlin { commonMain{
sourceSets {
commonMain {
dependencies {
api(projects.mapsKtCore) api(projects.mapsKtCore)
api(projects.mapsKtFeatures) api(projects.mapsKtFeatures)
api(compose.foundation) api(compose.foundation)
api(project.dependencies.platform(spclibs.ktor.bom)) api(project.dependencies.platform(spclibs.ktor.bom))
} }
} jvmMain{
getByName("jvmMain"){
dependencies {
api("io.ktor:ktor-client-cio") api("io.ktor:ktor-client-cio")
} }
} jvmTest{
//
// getByName("jsMain"){
// dependencies {
// api("io.ktor:ktor-client-js")
// }
// }
getByName("jvmTest") {
dependencies {
implementation("io.ktor:ktor-client-cio") implementation("io.ktor:ktor-client-cio")
implementation(compose.desktop.currentOs) implementation(compose.desktop.currentOs)
implementation(spclibs.kotlinx.coroutines.test) implementation(spclibs.kotlinx.coroutines.test)
implementation(spclibs.logback.classic) implementation(spclibs.logback.classic)
} }
}
}
} }
readme { readme {

View File

@ -1,10 +1,10 @@
package space.kscience.maps.compose package space.kscience.maps.compose
import center.sciprog.maps.features.Rectangle
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.abs import space.kscience.kmath.geometry.abs
import space.kscience.maps.coordinates.GeodeticMapCoordinates import space.kscience.maps.coordinates.GeodeticMapCoordinates
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.features.Rectangle
internal fun Angle.isBetween(a: Angle, b: Angle) = this in a..b || this in b..a internal fun Angle.isBetween(a: Angle, b: Angle) = this in a..b || this in b..a

View File

@ -6,12 +6,12 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpRect import androidx.compose.ui.unit.DpRect
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.*
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.MercatorProjection import space.kscience.maps.coordinates.MercatorProjection
import space.kscience.maps.coordinates.WebMercatorCoordinates import space.kscience.maps.coordinates.WebMercatorCoordinates
import space.kscience.maps.coordinates.WebMercatorProjection import space.kscience.maps.coordinates.WebMercatorProjection
import space.kscience.maps.features.*
import kotlin.math.* import kotlin.math.*

View File

@ -11,13 +11,13 @@ import androidx.compose.ui.graphics.toComposeImageBitmap
import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.*
import io.github.oshai.kotlinlogging.KotlinLogging import io.github.oshai.kotlinlogging.KotlinLogging
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.supervisorScope import kotlinx.coroutines.supervisorScope
import org.jetbrains.skia.Image import org.jetbrains.skia.Image
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.features.*
import kotlin.math.ceil import kotlin.math.ceil
import kotlin.math.pow import kotlin.math.pow

View File

@ -1,9 +1,9 @@
package space.kscience.maps.compose package space.kscience.maps.compose
import center.sciprog.maps.features.ViewPoint
import space.kscience.maps.coordinates.GeodeticMapCoordinates import space.kscience.maps.coordinates.GeodeticMapCoordinates
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.WebMercatorProjection import space.kscience.maps.coordinates.WebMercatorProjection
import space.kscience.maps.features.ViewPoint
/** /**
* Observable position on the map. Includes observation coordinate and [zoom] factor * Observable position on the map. Includes observation coordinate and [zoom] factor

View File

@ -3,13 +3,12 @@ package space.kscience.maps.compose
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.coordinates.*
import center.sciprog.maps.features.CoordinateSpace
import center.sciprog.maps.features.Rectangle
import center.sciprog.maps.features.ViewPoint
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.kmath.geometry.radians import space.kscience.kmath.geometry.radians
import space.kscience.maps.coordinates.* import space.kscience.maps.coordinates.*
import space.kscience.maps.features.CoordinateSpace
import space.kscience.maps.features.Rectangle
import space.kscience.maps.features.ViewPoint
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.floor import kotlin.math.floor
import kotlin.math.pow import kotlin.math.pow

View File

@ -6,11 +6,10 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.coordinates.*
import center.sciprog.maps.features.*
import org.jetbrains.skia.Font import org.jetbrains.skia.Font
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.maps.coordinates.* import space.kscience.maps.coordinates.*
import space.kscience.maps.features.*
import kotlin.math.ceil import kotlin.math.ceil

View File

@ -9,19 +9,8 @@ The core interfaces of KMath.
## Artifact: ## Artifact:
The Maven coordinates of this project are `center.sciprog:maps-kt-core:0.2.2`. The Maven coordinates of this project are `space.kscience:maps-kt-core:0.3.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'center.sciprog:maps-kt-core:0.2.2'
}
```
**Gradle Kotlin DSL:** **Gradle Kotlin DSL:**
```kotlin ```kotlin
repositories { repositories {
@ -30,6 +19,6 @@ repositories {
} }
dependencies { dependencies {
implementation("center.sciprog:maps-kt-core:0.2.2") implementation("space.kscience:maps-kt-core:0.3.0")
} }
``` ```

View File

@ -6,19 +6,8 @@
## Artifact: ## Artifact:
The Maven coordinates of this project are `center.sciprog:maps-kt-features:0.2.2`. The Maven coordinates of this project are `space.kscience:maps-kt-features:0.3.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'center.sciprog:maps-kt-features:0.2.2'
}
```
**Gradle Kotlin DSL:** **Gradle Kotlin DSL:**
```kotlin ```kotlin
repositories { repositories {
@ -27,6 +16,6 @@ repositories {
} }
dependencies { dependencies {
implementation("center.sciprog:maps-kt-features:0.2.2") implementation("space.kscience:maps-kt-features:0.3.0")
} }
``` ```

View File

@ -1,6 +1,7 @@
plugins { plugins {
id("space.kscience.gradle.mpp") id("space.kscience.gradle.mpp")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
`maven-publish` `maven-publish`
} }
@ -26,12 +27,8 @@ kscience {
useSerialization(sourceSet = space.kscience.gradle.DependencySourceSet.TEST) { useSerialization(sourceSet = space.kscience.gradle.DependencySourceSet.TEST) {
protobuf() protobuf()
} }
}
kotlin { commonMain{
sourceSets {
commonMain {
dependencies {
api(projects.trajectoryKt) api(projects.trajectoryKt)
api(compose.runtime) api(compose.runtime)
api(compose.foundation) api(compose.foundation)
@ -39,6 +36,4 @@ kotlin {
api(compose.ui) api(compose.ui)
api("io.github.oshai:kotlin-logging:6.0.3") api("io.github.oshai:kotlin-logging:6.0.3")
} }
}
}
} }

View File

@ -7,7 +7,7 @@ import androidx.compose.ui.input.pointer.*
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpRect import androidx.compose.ui.unit.DpRect
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.* import space.kscience.maps.features.*
import kotlin.math.max import kotlin.math.max
import kotlin.math.min import kotlin.math.min

View File

@ -20,7 +20,7 @@ public fun <T : Any> FeatureGroup<T>.draggableLine(
bId.resolve().center, bId.resolve().center,
Attributes<FeatureGroup<T>> { Attributes<FeatureGroup<T>> {
ZAttribute(-10f) ZAttribute(-10f)
lineId?.attributes?.let { from(it) } lineId?.attributes?.let { putAll(it) }
} }
) )
) )
@ -53,7 +53,7 @@ public fun <T : Any> FeatureGroup<T>.draggableMultiLine(
points.map { it.resolve().center }, points.map { it.resolve().center },
Attributes<FeatureGroup<T>>{ Attributes<FeatureGroup<T>>{
ZAttribute(-10f) ZAttribute(-10f)
polygonId?.attributes?.let { from(it) } polygonId?.attributes?.let { putAll(it) }
} }
) )
) )

View File

@ -52,7 +52,7 @@ public fun <T : Any, F : Feature<T>> FeatureRef<T, F>.modifyAttributes(
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
parent.feature( parent.feature(
id, id,
resolve().withAttributes { modify(modification) } as F resolve().withAttributes { modified(modification) } as F
) )
return this return this
} }

View File

@ -12,7 +12,6 @@ import space.kscience.AttributesSerializer
import space.kscience.NameAttribute import space.kscience.NameAttribute
import space.kscience.SerializableAttribute import space.kscience.SerializableAttribute
import space.kscience.attributes.Attributes import space.kscience.attributes.Attributes
import space.kscience.equals
import kotlin.test.Ignore import kotlin.test.Ignore
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals

View File

@ -6,19 +6,8 @@
## Artifact: ## Artifact:
The Maven coordinates of this project are `center.sciprog:maps-kt-geojson:0.2.2`. The Maven coordinates of this project are `space.kscience:maps-kt-geojson:0.3.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'center.sciprog:maps-kt-geojson:0.2.2'
}
```
**Gradle Kotlin DSL:** **Gradle Kotlin DSL:**
```kotlin ```kotlin
repositories { repositories {
@ -27,6 +16,6 @@ repositories {
} }
dependencies { dependencies {
implementation("center.sciprog:maps-kt-geojson:0.2.2") implementation("space.kscience:maps-kt-geojson:0.3.0")
} }
``` ```

View File

@ -1,10 +1,10 @@
package space.kscience.maps.geojson package space.kscience.maps.geojson
import center.sciprog.maps.geojson.GeoJson.Companion.PROPERTIES_KEY
import center.sciprog.maps.geojson.GeoJson.Companion.TYPE_KEY
import center.sciprog.maps.geojson.GeoJsonFeatureCollection.Companion.FEATURES_KEY
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.json.* import kotlinx.serialization.json.*
import space.kscience.maps.geojson.GeoJson.Companion.PROPERTIES_KEY
import space.kscience.maps.geojson.GeoJson.Companion.TYPE_KEY
import space.kscience.maps.geojson.GeoJsonFeatureCollection.Companion.FEATURES_KEY
import kotlin.jvm.JvmInline import kotlin.jvm.JvmInline
/** /**

View File

@ -1,9 +1,9 @@
package space.kscience.maps.geojson package space.kscience.maps.geojson
import center.sciprog.maps.geojson.GeoJsonGeometry.Companion.COORDINATES_KEY
import kotlinx.serialization.json.* import kotlinx.serialization.json.*
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.coordinates.meters import space.kscience.maps.coordinates.meters
import space.kscience.maps.geojson.GeoJsonGeometry.Companion.COORDINATES_KEY
import kotlin.jvm.JvmInline import kotlin.jvm.JvmInline
public sealed interface GeoJsonGeometry : GeoJson { public sealed interface GeoJsonGeometry : GeoJson {

View File

@ -1,12 +1,12 @@
package space.kscience.maps.geojson package space.kscience.maps.geojson
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import center.sciprog.maps.features.*
import kotlinx.serialization.json.contentOrNull import kotlinx.serialization.json.contentOrNull
import kotlinx.serialization.json.intOrNull import kotlinx.serialization.json.intOrNull
import kotlinx.serialization.json.jsonPrimitive import kotlinx.serialization.json.jsonPrimitive
import space.kscience.NameAttribute import space.kscience.NameAttribute
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.features.*
/** /**

View File

@ -1,11 +1,11 @@
package space.kscience.maps.geojson package space.kscience.maps.geojson
import center.sciprog.maps.features.Feature
import center.sciprog.maps.features.FeatureGroup
import center.sciprog.maps.features.FeatureRef
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonObject
import space.kscience.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import space.kscience.maps.features.Feature
import space.kscience.maps.features.FeatureGroup
import space.kscience.maps.features.FeatureRef
import java.net.URL import java.net.URL
/** /**

View File

@ -1,9 +1,9 @@
package center.sciprog.maps.geotiff package center.sciprog.maps.geotiff
import center.sciprog.maps.coordinates.Gmc import space.kscience.maps.coordinates.Gmc
import center.sciprog.maps.features.Feature import space.kscience.maps.features.Feature
import center.sciprog.maps.features.FeatureGroup import space.kscience.maps.features.FeatureGroup
import center.sciprog.maps.features.FeatureRef import space.kscience.maps.features.FeatureRef
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonObject
import org.geotools.gce.geotiff.GeoTiffReader import org.geotools.gce.geotiff.GeoTiffReader

View File

@ -6,19 +6,8 @@
## Artifact: ## Artifact:
The Maven coordinates of this project are `center.sciprog:maps-kt-scheme:0.2.2`. The Maven coordinates of this project are `space.kscience:maps-kt-scheme:0.3.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'center.sciprog:maps-kt-scheme:0.2.2'
}
```
**Gradle Kotlin DSL:** **Gradle Kotlin DSL:**
```kotlin ```kotlin
repositories { repositories {
@ -27,6 +16,6 @@ repositories {
} }
dependencies { dependencies {
implementation("center.sciprog:maps-kt-scheme:0.2.2") implementation("space.kscience:maps-kt-scheme:0.3.0")
} }
``` ```

View File

@ -1,6 +1,7 @@
plugins { plugins {
id("space.kscience.gradle.mpp") id("space.kscience.gradle.mpp")
id("org.jetbrains.compose") alias(spclibs.plugins.compose.compiler)
alias(spclibs.plugins.compose.jb)
`maven-publish` `maven-publish`
} }
@ -8,24 +9,17 @@ kscience{
jvm() jvm()
// js() // js()
wasm() wasm()
}
kotlin { commonMain{
sourceSets {
commonMain {
dependencies {
api(projects.mapsKtFeatures) api(projects.mapsKtFeatures)
} }
} jvmMain{
getByName("jvmMain"){
dependencies {
implementation("org.jfree:org.jfree.svg:5.0.4") implementation("org.jfree:org.jfree.svg:5.0.4")
api(compose.desktop.currentOs) api(compose.desktop.currentOs)
} }
}
}
} }
//java { //java {
// targetCompatibility = JVM_TARGET // targetCompatibility = JVM_TARGET
//} //}

View File

@ -4,9 +4,9 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import center.sciprog.maps.compose.canvasControls
import center.sciprog.maps.features.*
import io.github.oshai.kotlinlogging.KotlinLogging import io.github.oshai.kotlinlogging.KotlinLogging
import space.kscience.maps.compose.canvasControls
import space.kscience.maps.features.*
import kotlin.math.min import kotlin.math.min

View File

@ -2,10 +2,10 @@ package space.kscience.maps.scheme
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.CoordinateSpace
import center.sciprog.maps.features.Rectangle
import center.sciprog.maps.features.ViewPoint
import space.kscience.kmath.geometry.Vector2D import space.kscience.kmath.geometry.Vector2D
import space.kscience.maps.features.CoordinateSpace
import space.kscience.maps.features.Rectangle
import space.kscience.maps.features.ViewPoint
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.max import kotlin.math.max
import kotlin.math.min import kotlin.math.min

View File

@ -1,11 +1,12 @@
package space.kscience.maps.scheme package space.kscience.maps.scheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpRect import androidx.compose.ui.unit.DpRect
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.* import space.kscience.maps.features.*
import kotlin.math.min import kotlin.math.min
public class XYCanvasState( public class XYCanvasState(

View File

@ -3,9 +3,9 @@ package space.kscience.maps.scheme
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.CoordinateSpace import space.kscience.maps.features.CoordinateSpace
import center.sciprog.maps.features.Rectangle import space.kscience.maps.features.Rectangle
import center.sciprog.maps.features.ViewPoint import space.kscience.maps.features.ViewPoint
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.pow import kotlin.math.pow

View File

@ -8,9 +8,9 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.*
import space.kscience.attributes.Attributes import space.kscience.attributes.Attributes
import space.kscience.kmath.geometry.Angle import space.kscience.kmath.geometry.Angle
import space.kscience.maps.features.*
import kotlin.math.ceil import kotlin.math.ceil
internal fun Pair<Number, Number>.toCoordinates(): XY = XY(first.toFloat(), second.toFloat()) internal fun Pair<Number, Number>.toCoordinates(): XY = XY(first.toFloat(), second.toFloat())

View File

@ -12,10 +12,10 @@ import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.LayoutDirection
import center.sciprog.maps.features.*
import center.sciprog.maps.scheme.XY
import org.jfree.svg.SVGGraphics2D import org.jfree.svg.SVGGraphics2D
import space.kscience.attributes.Attributes import space.kscience.attributes.Attributes
import space.kscience.maps.features.*
import space.kscience.maps.scheme.XY
import java.awt.BasicStroke import java.awt.BasicStroke
import java.awt.geom.* import java.awt.geom.*
import java.awt.image.AffineTransformOp import java.awt.image.AffineTransformOp

View File

@ -4,11 +4,11 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import center.sciprog.maps.features.*
import center.sciprog.maps.scheme.XY
import center.sciprog.maps.scheme.XYCanvasState
import org.jfree.svg.SVGGraphics2D import org.jfree.svg.SVGGraphics2D
import org.jfree.svg.SVGUtils import org.jfree.svg.SVGUtils
import space.kscience.maps.features.*
import space.kscience.maps.scheme.XY
import space.kscience.maps.scheme.XYCanvasState
public class FeatureStateSnapshot<T : Any>( public class FeatureStateSnapshot<T : Any>(

View File

@ -5,8 +5,6 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
pluginManagement { pluginManagement {
val toolsVersion: String by extra val toolsVersion: String by extra
val composeVersion = extra["compose.version"] as String
val agpVersion = extra["agp.version"] as String
repositories { repositories {
mavenLocal() mavenLocal()
@ -20,13 +18,9 @@ pluginManagement {
plugins { plugins {
// id("com.android.application").version(extra["agp.version"] as String) // id("com.android.application").version(extra["agp.version"] as String)
// id("com.android.library").version(extra["agp.version"] as String) // id("com.android.library").version(extra["agp.version"] as String)
id("org.jetbrains.compose") version composeVersion
id("space.kscience.gradle.project") version toolsVersion id("space.kscience.gradle.project") version toolsVersion
id("space.kscience.gradle.mpp") version toolsVersion id("space.kscience.gradle.mpp") version toolsVersion
id("space.kscience.gradle.jvm") version toolsVersion id("space.kscience.gradle.jvm") version toolsVersion
id("space.kscience.gradle.js") version toolsVersion
id("com.android.application") version agpVersion
id("com.android.library") version agpVersion
} }
} }

View File

@ -5,19 +5,8 @@
## Artifact: ## Artifact:
The Maven coordinates of this project are `space.kscience:trajectory-kt:0.2.2`. The Maven coordinates of this project are `space.kscience:trajectory-kt:0.3.0`.
**Gradle Groovy:**
```groovy
repositories {
maven { url 'https://repo.kotlin.link' }
mavenCentral()
}
dependencies {
implementation 'space.kscience:trajectory-kt:0.2.2'
}
```
**Gradle Kotlin DSL:** **Gradle Kotlin DSL:**
```kotlin ```kotlin
repositories { repositories {
@ -26,7 +15,7 @@ repositories {
} }
dependencies { dependencies {
implementation("space.kscience:trajectory-kt:0.2.2") implementation("space.kscience:trajectory-kt:0.3.0")
} }
``` ```