Exploring Kandy: An Open-Source Plotting Library for Kotlin
Are you looking for a powerful and flexible plotting library for Kotlin? Look no further than Kandy. Built with the aim of simplifying chart creation and visualization in Kotlin, Kandy offers a range of features and compatibility options. In this article, we will dive into the features, benefits, and integration possibilities of Kandy, as well as showcase its distinct advantages over other plotting libraries.
Overview
Kandy is an open-source plotting library for Kotlin that provides a powerful and flexible DSL (Domain Specific Language) for creating graphs. Compatible with various platforms, including IntelliJ IDEA, Datalore, Jupyter, and standard Kotlin projects, Kandy ensures cross-platform compatibility without any hassle. Moreover, Kandy also offers Swing rendering for outputs in the Kotlin Notebook plugin, allowing for a seamless chart viewing experience.
Features and Benefits
One of the key highlights of Kandy is its interactive chart features. Kandy supports interactive tooltips for charts rendered in HTML and Swing, making it easier for users to analyze data directly from the charts. Additionally, Kandy lets users save charts in various formats like SVG, PNG, HTML, JPG/JPEG, and TIFF, providing flexibility for their use in different contexts.
Kandy seamlessly integrates with Kotlin collections and Kotlin DataFrame, allowing users to leverage the power of Kotlin’s native data structures in their chart creation process. This integration is especially useful for hierarchical dataframes and enables smooth data transition from processing to visualization.
Compatibility and Integration
Kandy supports multiple engines for chart creation, giving users the freedom to choose the engine that suits their visualization needs. Two prominent engines supported by Kandy are Lets-Plot and ECharts.
Lets-Plot is an implementation of Leland Wilkinson’s work on “The Grammar of Graphics”. It is a powerful tool for creating visualizations and offers a comprehensive set of features for chart customization. Kandy’s integration with Lets-Plot enables users to leverage the full potential of this library while benefiting from the simplicity of Kandy’s DSL.
ECharts, on the other hand, is a widely-used tool for creating interactive visualizations. With Kandy’s integration with ECharts, users can create highly interactive charts with ease, making data exploration and analysis a breeze.
Getting Started with Kandy
To get started with Kandy, you can include the necessary dependencies in your project. For Gradle users, this can be done by adding the following dependency:
dependencies {
implementation("org.jetbrains.kotlinx:kandy-lets-plot:$kandy_version")
}
Ensure that you have the mavenCentral()
repository included in your project’s repositories.
If you prefer using Kotlin Notebook, Datalore, or Kotlin Jupyter Notebook, you can use Kandy directly in these environments. Using the %use kandy
line magic command, you can include all necessary dependencies and imports without any hassle. This makes it incredibly convenient to use Kandy in your notebook-based projects.
Conclusion
Kandy is a feature-rich and versatile plotting library for Kotlin, designed to make chart creation and visualization effortless. With its compatibility with various engines and smooth integration with Kotlin DataFrame, Kandy offers users a range of options for creating stunning visualizations. Whether you prefer using Lets-Plot or ECharts, Kandy has got you covered.
So, why wait? Explore the power and flexibility of Kandy today and unlock the true potential of your data visualization projects.
Sources:
– Kotlin Kandy Repository
– Kandy Documentation
Leave a Reply