Skip to content

Commit 7a0c809

Browse files
authored
Merge pull request #82 from overpas/rework
Rework
2 parents 0a5057d + e71bb70 commit 7a0c809

File tree

141 files changed

+16312
-1295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+16312
-1295
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- rework
8+
pull_request:
9+
branches:
10+
- master
11+
- rework
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-java@v3
21+
with:
22+
distribution: 'zulu'
23+
java-version: '17'
24+
- name: Build
25+
run: ./gradlew build
26+
- name: Collect test coverage
27+
run: ./gradlew koverReport
28+
- name: Submit coverage report
29+
run: |
30+
curl -Os https://uploader.codecov.io/latest/linux/codecov
31+
chmod +x codecov
32+
./codecov -f "build/reports/kover/report.xml"

.github/workflows/publish.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,27 @@ jobs:
1111
steps:
1212
- name: Check out code
1313
uses: actions/checkout@v3
14-
- name: Set up JDK 11
15-
uses: actions/setup-java@v3
16-
with:
17-
distribution: adopt
18-
java-version: 11
19-
20-
# Builds the release artifacts of the library
21-
- name: Release build
22-
run: ./gradlew :treemap-core:assemble :treemap-compose-android:assembleRelease
23-
24-
# Generates other artifacts
25-
- name: Source jar
26-
run: ./gradlew androidSourcesJar javadocJar
27-
28-
# Runs upload, and then closes & releases the repository
29-
- name: Publish to MavenCentral
30-
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
31-
env:
32-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
33-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
34-
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
35-
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
36-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
37-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
14+
# - name: Set up JDK 11
15+
# uses: actions/setup-java@v3
16+
# with:
17+
# distribution: adopt
18+
# java-version: 11
19+
#
20+
# # Builds the release artifacts of the library
21+
# - name: Release build
22+
# run: ./gradlew :treemap-chart:assemble :treemap-compose-android:assembleRelease
23+
#
24+
# # Generates other artifacts
25+
# - name: Source jar
26+
# run: ./gradlew androidSourcesJar javadocJar
27+
#
28+
# # Runs upload, and then closes & releases the repository
29+
# - name: Publish to MavenCentral
30+
# run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
31+
# env:
32+
# OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
33+
# OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
34+
# SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
35+
# SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
36+
# SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
37+
# SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

.github/workflows/static-analysis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ name: Static analysis
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
- rework
68
pull_request:
7-
branches: [ master ]
9+
branches:
10+
- master
11+
- rework
812

913
workflow_dispatch:
1014

@@ -13,7 +17,11 @@ jobs:
1317
runs-on: ubuntu-latest
1418
steps:
1519
- uses: actions/checkout@v3
20+
- uses: actions/setup-java@v3
21+
with:
22+
distribution: 'zulu'
23+
java-version: '17'
1624
- name: Android Lint
1725
run: ./gradlew lintDebug
1826
- name: Detekt
19-
run: ./gradlew detekt
27+
run: ./gradlew detektAll

.github/workflows/test.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/ui-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: UI-Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- rework
8+
pull_request:
9+
branches:
10+
- master
11+
- rework
12+
13+
workflow_dispatch:
14+
15+
jobs:
16+
ui-test:
17+
runs-on: macos-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions/setup-java@v3
21+
with:
22+
distribution: 'zulu'
23+
java-version: '17'
24+
- name: UI tests + Macrobenchmark
25+
uses: reactivecircus/android-emulator-runner@v2
26+
with:
27+
api-level: 29
28+
script: ./gradlew :treemap-chart-compose:connectedCheck :sample:android:macrobenchmark:connectedBenchmarkAndroidTest

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
.idea
55
.DS_Store
66
/build
7+
build
78
/captures
89
.externalNativeBuild
910
.cxx
1011
local.properties
12+
xcuserdata
13+
Pods
14+
*.lock
15+
*.trace
16+
*.gpg

README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
# Compose Treemap Chart
2-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.overpas/treemap-compose-android/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.overpas/treemap-compose-android)
2+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.overpas/treemap-chart-compose/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.overpas/treemap-chart-compose)
33
[![Test](https://github.com/overpas/compose-treemap-chart/actions/workflows/test.yml/badge.svg)](https://github.com/overpas/compose-treemap-chart/actions/workflows/test.yml)
44
[![Static analysis](https://github.com/overpas/compose-treemap-chart/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/overpas/compose-treemap-chart/actions/workflows/static-analysis.yml)
55
[![codecov](https://codecov.io/gh/overpas/compose-treemap-chart/branch/master/graph/badge.svg?token=CHYdQiizEr)](https://codecov.io/gh/overpas/compose-treemap-chart)
6+
![Badge-Android](https://img.shields.io/badge/platform-android-blue)
7+
![Badge-JVM](https://img.shields.io/badge/platform-jvm-blue)
8+
![Badge-iOS](https://img.shields.io/badge/platform-ios-blue)
9+
![Badge-JS](https://img.shields.io/badge/platform-js-blue)
610

711
Jetpack compose [treemap](https://en.wikipedia.org/wiki/Treemapping) chart implementation
12+
<img src="https://raw.githubusercontent.com/overpas/compose-treemap-chart/master/img/sample_complex_chart.png" width="500">
813

914
## Usage
1015
### Adding to the project
1116
Add this to your `dependencies` gradle block:
1217
```gradle
13-
implementation "io.github.overpas:treemap-core:0.0.3"
14-
implementation "io.github.overpas:treemap-compose-android:0.0.3"
18+
implementation "io.github.overpas:treemap-chart:0.1.0"
19+
implementation "io.github.overpas:treemap-chart-compose:0.1.0"
1520
```
1621
### Sample code
1722
```kotlin
@@ -44,26 +49,15 @@ class MainActivity : ComponentActivity() {
4449
.fillMaxHeight()
4550
.fillMaxWidth(),
4651
) { item ->
47-
TreemapItem(item = item)
52+
SimpleTreemapItem(item = item.toString())
4853
}
4954
}
5055
}
5156
}
5257
}
5358
}
54-
55-
@Composable
56-
fun TreemapItem(item: Int, modifier: Modifier = Modifier) {
57-
Box(
58-
contentAlignment = Alignment.Center,
59-
modifier = modifier.border(1.dp, MaterialTheme.colors.onBackground),
60-
) {
61-
Text(
62-
text = item.toString(),
63-
textAlign = TextAlign.Center,
64-
)
65-
}
66-
}
6759
```
6860
The code above produces something like this:
6961
<img src="https://raw.githubusercontent.com/overpas/compose-treemap-chart/master/img/sample_treemap.png" width="750">
62+
63+
For more advanced Kotlin Multiplatform samples check out the /sample directory

build.gradle

Lines changed: 0 additions & 57 deletions
This file was deleted.

build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import io.gitlab.arturbosch.detekt.Detekt
2+
3+
plugins {
4+
alias(libs.plugins.kotlin.multiplatform).apply(false)
5+
alias(libs.plugins.kotlin.android).apply(false)
6+
alias(libs.plugins.android.lib).apply(false)
7+
alias(libs.plugins.android.app).apply(false)
8+
alias(libs.plugins.android.test).apply(false)
9+
alias(libs.plugins.compose.multiplatform).apply(false)
10+
alias(libs.plugins.detekt).apply(false)
11+
alias(libs.plugins.kotlinx.kover)
12+
}
13+
14+
tasks.register("cleanAll", Delete::class) {
15+
delete(rootProject.buildDir)
16+
}
17+
18+
tasks.register("detektAll") {
19+
allprojects {
20+
this@register.dependsOn(tasks.withType<Detekt>())
21+
}
22+
}

0 commit comments

Comments
 (0)