Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add component api #593

Merged
merged 1 commit into from
Jul 24, 2024
Merged

feat: add component api #593

merged 1 commit into from
Jul 24, 2024

Conversation

longxiaofei
Copy link
Member

We're excited to announce an experimental new feature in pygwalker:

The component chaining API that enables intuitive, step-by-step chart construction. This feature currently supports rendering to static HTML.

Key Points:

  • Introduces a chainable API for creating visualizations
  • Allows for more intuitive and readable code
  • Currently an experimental feature
  • Limited to static HTML output at this time

Example usage:

import pygwalker as pyg
import pandas as pd

df = pd.read_csv("xxx")

(
pyg.component(df)
    .rect()
    .encode(x='bin("feeling_temp", 6)', y='bin("temperature", 6)', color="MEAN(humidity)")
    .layout(height=400, width=460)
)

For more examples, please refer to the pygwalker/examples directory in our repository.

Upcoming Improvements:

  1. Optimize the size of pure chart HTML output
  2. Implement two-way communication for Jupyter and Streamlit environments

We welcome feedback from our community as we continue to develop and refine this feature.

Please note that as an experimental feature, syntax and functionality may change in future releases

@longxiaofei longxiaofei merged commit 3c896c9 into Kanaries:main Jul 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant