I hope it's ok to post this here - I published a C...
# compose-desktop
g
I hope it's ok to post this here - I published a Compose Multiplatform-based plotting library that, so far, targets Android, Desktop, and web-canvas. I call it Koala Plot and you can try out the web version of the samples served from GitHub pages here. I'm interested to receive any feedback, and in collaborating with others on it going forward. Slack Conversation
j
Trying koalaplot-samples and getting
Could not find io.github.koalaplot:koalaplot-core:0.1.0-SNAPSHO
...
ah, looks like need to build/publish locally for now?
Am following instructions in https://github.com/KoalaPlot/koalaplot-core and trying to run
./gradlew :library:publishToMavenLocal
but getting
Copy code
Project 'library' not found in root project 'koalaplot-core'.
g
Hi John, you can use
./gradlew publishToMavenLocal
instead. Thanks for letting me know about this, I've updated the readme to include the corrected command.
j
meant to say that I actually tried that as well but got some other error....let me double check what that was
ah, was issue with
sdk.dir
setting....fixed that and seems to be working now
looks really nice!
one piece of feedback is that it would be great to have a basic default implementation that worked like one that SwiftUI provides....this is what I used to create more or less same one (in iOS client) that's shown in that tweet
Copy code
Chart(playerHistory) {
    BarMark(
        x: .value("Season", $0.seasonName),
        y: .value("Points", $0.totalPoints)
    )
}
l
Would this library also support #compose-ios once it is stable as well?
g
Thanks @John O'Reilly I'll have to look into that. It shouldn't take much to put another layer on top of the existing API that chooses even more defaults - people can drop down to the lower layer API if they want to customize the details.
@Landry Norris Probably. I don't have any Apple devices so am unable to develop for ios. This is a great area for someone who wants to contribute. If it's anything like Android, it will just work - the Android-specific code for the samples is only 8 lines. I put as much as I can into the common code base.
j
@Greg Steckman when are you hoping to publish first version of library?
g
@John O'Reilly I didn't have a firm date in mind. I was hoping to get some additional feedback on the api, since once people get dependent on a library making big changes to the api/approach causes a lot of disruption. I could publish a "0.1.0-dev" version to Maven Central if having to build the library is keeping people from trying it out.
l
Jetbrains seems to use the 0.x.0 convention for their pre-release libraries. Maybe even use the experimental annotation.
g
I pushed an update that gets a basic bar chart down to about 8 lines. Not quite to the minimalist level of the SwiftUI, but better than it was. I think to go further, I'd have to introduce a DSL syntax to be able to capture parameters for analysis before generating Composables - or introduce overrides for very specific axis data type combinations which I think doesn't scale well and reduces flexibility too much.
j
nice!
@Greg Steckman one thing I wasn't clear on was what having
ChartLayout
around say
XYChart
does? If I just have
XYChart
for example it seems to look the same?
g
@John O'Reilly
ChartLayout
is optional and can be used to add a title and legend to go alongside the
XYChart
(or
PieChart
). You could use any other approach to layout those elements alongside the chart, if wanted, since the
XYChart
and
PieChart
are just regular Composable functions.
The default parameter values to
ChartLayout
do nothing, so unless you explicitly provide a title and/or legend, you won't see a difference.