Skip to content
Merged

V0.9 #127

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Release build artifacts to Maven Central
on:
release:
types: [created]
workflow_dispatch:

jobs:
publish:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.1]

### Fixed

- PieChart hole content padding being calculated incorrectly

## [0.9.0]

### Added
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Maven Central](https://img.shields.io/maven-central/v/io.github.koalaplot/koalaplot-core?color=278ec7)](https://central.sonatype.com/artifact/io.github.koalaplot/koalaplot-core)
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.0-278ec7.svg?logo=kotlin)](http://kotlinlang.org)
[![Dokka docs](https://img.shields.io/badge/docs-dokka-278ec7)](https://koalaplot.github.io/koalaplot-core/api/0.9.0/)
[![Dokka docs](https://img.shields.io/badge/docs-dokka-278ec7)](https://koalaplot.github.io/koalaplot-core/api/0.9.1/)
[![License MIT](https://img.shields.io/badge/license-MIT-278ec7.svg)](https://github.com/KoalaPlot/koalaplot-core/tree/main/LICENSE.txt)

# Koala Plot
Expand Down Expand Up @@ -75,7 +75,7 @@ repositories {

```kotlin
dependencies {
implementation("io.github.koalaplot:koalaplot-core:0.9.0")
implementation("io.github.koalaplot:koalaplot-core:0.9.1")
}
```

Expand Down Expand Up @@ -106,8 +106,8 @@ BulletGraphs {

# Documentation

- [Latest build](https://koalaplot.github.io/koalaplot-core/api/0.9.0)
- [Release 0.9.0](https://koalaplot.github.io/koalaplot-core/api/0.9.0)
- [Latest build](https://koalaplot.github.io/koalaplot-core/api/0.9.1)
- [Release 0.9.1](https://koalaplot.github.io/koalaplot-core/api/0.9.1)

Also see the [sample repository](https://github.com/KoalaPlot/koalaplot-samples) for code examples.

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
}

group = "io.github.koalaplot"
version = "0.9.0"
version = "0.9.1"

kotlin {
explicitApi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ publishing {
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
stagingProfileId.set(getExtraString("sonatypeStagingProfileId"))
username.set(getExtraString("ossrhUsername"))
password.set(getExtraString("ossrhPassword"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@ public fun PieChart(

val labelConnectorTranslations = pieMeasurePolicy.computeLabelConnectorScopes(labelPositions, pieDiameter)

val holeDiameter = pieDiameter * holeSize.toDouble()
val holeDiameter = (pieDiameter * holeSize)
val holeSafeEdgeLength = circumscribedSquareSize(holeDiameter)
val holePlaceable = subcompose("hole") {
Box(modifier = Modifier.clip(CircleShape)) {
holeContent(PaddingValues((holeDiameter - holeSafeEdgeLength).toInt().dp))
holeContent(PaddingValues(((holeDiameter - holeSafeEdgeLength) / 2.0f).toDp()))
}
}[0].measure(Constraints.fixed(holeDiameter.toInt(), holeDiameter.toInt()))

Expand Down Expand Up @@ -455,8 +455,7 @@ public fun PieChart(
minPieDiameter = minPieDiameter,
maxPieDiameter = maxPieDiameter,
forceCenteredPie = forceCenteredPie,
startAnimationUseCase =
StartAnimationUseCase(
startAnimationUseCase = StartAnimationUseCase(
executionType = StartAnimationUseCase.ExecutionType.Default,
pieAnimationSpec,
labelAnimationSpec,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ internal fun y2theta(y: Float, radius: Float): Pair<Float, Float> {
/**
* Returns the edge-length of a square circumscribed by a circle with the provided [diameter].
*/
internal fun circumscribedSquareSize(diameter: Double): Double {
return diameter / sqrt(2.0)
internal fun circumscribedSquareSize(diameter: Float): Float {
return diameter / sqrt(2.0f)
}

internal fun Path.moveTo(offset: Offset) {
Expand Down
Loading