Files
plot/tests/band_chart_hosted_provider.zi
T
waozi 2e06dfe503 Portable bundles draw band charts through their host
A bundle that shows values against a good range could not draw a band
chart, because the chart measures and paints with Kryon's native modules.
The chart's records move to band_chart_props, a bundle built with
KRYON_HOSTED_UI submits the chart as BandChartHostedHost, and a host answers
it with BandChartHostCall from band_chart_host, which decodes the records
with a codec generated on top of Kryon's widget codec. The check builds the
bundles as ZX, which the toolchain now runs.
2026-10-24 20:17:44 -03:00

15 lines
577 B
Ziran

// The host side of the hosted band chart test: it checks what the bundle
// sent and answers with the second point.
#import "kryon/session"
#import "band_chart_props"
#program_export "BandChartHostedHost"
HostedBandChart :: (session: Session, props: BandChartProps, points: []BandChartPoint,
bands: []BandChartBand) -> BandChartResult {
if session.slot != 4 || props.slots != 7 || points.count != 2 ||
points[0].label != "One" || bands.count != 1 || !bands[0].has_low {
return BandChartResult.{.shown = -1}
}
return BandChartResult.{.shown = 1}
}