feat: android charts#94
Open
DorianMazur wants to merge 2 commits intocallstackincubator:feat/chartsfrom
Open
Conversation
|
@DorianMazur is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
|
@DorianMazur : Great work, you can post videos of them in use on the home. When I run: In ✖ Prebuild failed
Error: [android.dangerous]: withAndroidDangerousBaseMod: Failed to prerender widget state for
chart_widget (./widgets/android-chart-widget-initial.tsx): Unsupported element type "undefined".
Report this as a bug in the Voltra project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Android Chart Implementation
Implements the Android counterpart to the iOS
Chartcomponent added infeat/charts. Supports bar, line, area, point, rule, and sector (pie/donut) mark types inside Glance widgets.Approach
Jetpack Glance has no charting API, so charts are rendered to a
Bitmapvia AndroidCanvasand displayed as a GlanceImageusingIcon.createWithBitmap().ChartBitmapRenderer.kt— core Canvas drawing engine for all 6 mark types, axes, grid lines, labels, and color paletteChartRenderers.kt— Glance composable that reads style/props, renders the bitmap, and outputs anImageChartParameters.kt— generated parameter modelChart dimensions come from the
styleprop. Bitmaps are capped at 600px to stay within RemoteViews parcel limits.TypeScript
VoltraAndroid.Chartand mark components (BarMark,LineMark,AreaMark,PointMark,RuleMark,SectorMark) in the Android namespaceVoltra.Chartfromfeat/chartsExample app
AndroidChartWidget.tsx— 4 widget variants (bar, line, area, pie)AndroidChartScreen.tsx— interactive preview with chart type and size selectorschart_widgetinapp.jsonwith initial state