Skip to content

Latest commit

 

History

History
159 lines (148 loc) · 31.8 KB

Charts.md

File metadata and controls

159 lines (148 loc) · 31.8 KB

Charts

Symbols: 81.2% of Apple's iOS API (475 of 585, exact) · Rows: 21: 20 ✅ 1 ❌ · iOS: 16.0+

Area: SwiftUI & Charts · Apple: Charts · Issues: area:swiftui

How isim implements it

  • Adapted: built on isim's SwiftUI (isim/swift/overlays/Charts). Chart3D is projected and painted in a Canvas.

API

API / feature Status iOS Notes
Chart view (Chart { }, Chart(data) { }, ForEach of marks, if/else content), import Charts ✅ ≤17 isim's own implementation on its SwiftUI (swift/overlays/Charts; if/else content unverified); tested by HelloCharts (tests/ui/test_charts.py, measured in the screenshot)
BarMark (vertical, horizontal, ranges, date bins with unit:, width/height) ✅ ≤17
Bar stacking (.standard), grouping (position(by:)) ✅ ≤17 .normalized/.center stacking unverified
LineMark (series:, interpolationMethod), PointMark ✅ ≤17 linear and catmullRom drawn in the test; step/cardinal/monotone unverified
symbol(_:), symbol(by:), symbolSize, symbolSize(by:), chartSymbolScale, chartSymbolSizeScale ✅ ≤17 basic shapes (circle, square, triangle, diamond, pentagon, plus, cross, asterisk), custom ChartSymbolShapes, symbol { view } (centered on the point), symbol(by:) (default shape sequence or the symbol scale), sizes as areas in square points, symbolSize(by:) mapped onto the size scale's range (default 20...200). Tested: HelloCharts -more (test_charts_more)
AreaMark (stacked series, yStart/yEnd) ✅ ≤17 stacking of several series unverified
RuleMark, RectangleMark ✅ ≤17
SectorMark (pie, donut innerRadius, outerRadius, angularInset) ✅ ≤17 angularInset unverified; corner radius ignored
PlottableValue.value(_:_:), Plottable (numbers, strings, dates, RawRepresentable enums) ✅ ≤17
foregroundStyle(by:) with the default palette and a legend, chartForegroundStyleScale, chartLegend ✅ ≤17 chartLegend(position: .top) and custom legend content unverified
Axes: chartXAxis/chartYAxis (.hidden, AxisMarks position and values, AxisGridLine, AxisTick, AxisValueLabel with custom content), date axes, AnyAxisContent ✅ ≤17 AxisValueLabel: Apple's initializers (text, LocalizedStringKey / LocalizedStringResource, content, format: with any FormatStyle of the value), AxisValueLabelCollisionResolution (adapted: automatic / greedy skip a label that would touch the last one placed, minimumSpacing apart; truncate shortens labels to the room before the next tick; disabled draws all; priority is accepted), AxisValueLabelOrientation (vertical / verticalReversed: turned a quarter, the axis makes room), horizontalSpacing / verticalSpacing (the gap to the plot); multiLabelAlignment and offsetsMarks are accepted. AnyAxisContent(_:) / (erasing:). The pre-0.10 initializers stay (disfavored). Tested (HelloCharts -axes); AxisTick unverified
Scales: chartXScale/chartYScale (domain: ranges, category lists, .automatic(includesZero:reversed:); range:; type:), ScaleType, PositionScaleRange / PlotDimensionScaleRange ✅ ≤17 ScaleType: log (base 10; an automatic domain covers whole decades, ticks at the powers of ten, also 2 and 5 within two decades), squareRoot, power(exponent:), symmetricLog / symmetricLog(slopeAtZero:) (sign · log1p(slope · |v|)) transform positions; category makes the axis categorical; date and linear as before. range: (adapted): .plotDimension(padding:) / (startPadding:endPadding:) inset the domain's ends from the plot's, a ClosedRange<CGFloat> places them in points from the plot's leading edge (x) or bottom (y). All four overloads (domain:range:type:, domain:type:, range:type:, type:); the pre-0.10 range: ClosedRange<CGFloat> overload stays (disfavored). Tested (HelloCharts -axes)
lineStyle(by:), chartLineStyleScale (mapping, domain, domain + range, range, domain + mapping, mapping) ✅ 16.0 series lines get the scale's stroke styles, else solid, dashed, dotted, dash-dot, ... in order of appearance; tested (HelloCharts -styling)
Mark modifiers: offset (point and range forms), zIndex, clipShape, mask(content:), shadow, blur ✅ 16.0 offset moves the drawn mark in points (the range forms move a bar's or rectangle's edges, screen coordinates); zIndex orders drawing (declared order among equals); clipShape clips to the shape fitted to the plot; mask(content:) draws the marks only where the mask's marks (laid out on the same scales) draw; shadow / blur through the Canvas filters. Tested (HelloCharts -styling)
NumberBins (floating-point and integer values), DateBins, ChartBinRange ✅ 16.0 thresholds by size, count, desired count (nice steps, a minimum stride) or data; date bins by calendar unit, time interval, desired count or data; index(for:) (the last bin includes its upper bound); collections of ChartBinRange. Tested (HelloCharts -styling)
annotation(position:alignment:spacing:), annotation(…overflowResolution:…), AnnotationOverflowResolution ✅ ≤17 laid out at their own size beside the mark, alignment along the side (.overlay: inside it). AnnotationOverflowResolution (adapted): fit / fit(to: .plot / .chart) per axis moves the annotation inside the plot or the chart, disabled lets it overflow; automatic places it beside its mark without fitting (as isim did before); padScale fits to the chart. Tested (HelloCharts -styling)
chartXAxisLabel, chartYAxisLabel (text or view content, position, alignment, spacing) ✅ ≤17 x title below the plot (or .top), aligned along the axis; y title above the plot on the axis' side, or vertical beside it with .leading / .trailing. Tested: HelloCharts -more (bottom-trailing x, leading y)
chartOverlay/chartBackground (ChartProxy), selection (chartXSelection), scrolling (chartScrollableAxes) ✅ ≤17 ChartProxy: plotFrame (an anchor for the overlay's GeometryReader), plotSize, position(forX:/forY:/for:), positionRange, value(atX:/atY:/at:), xDomain/yDomain, foregroundStyle(for:) / lineStyle(for:) / symbol(for:) / symbolSize(for:) and their domains (the scales' values in order), angle(at:) (around the plot's centre, from 12 o'clock clockwise; tested, HelloCharts -styling), selectXValue/selectXRange/selectAngleValue; chartGesture. Selection: chartXSelection / chartYSelection (value: set while a finger is on the plot, cleared when it lifts; range: by dragging, kept), chartAngleSelection (pies). Scrolling: chartScrollableAxes with chartX/YVisibleDomain(length:) (numbers, dates, category counts), chartScrollPosition(x:/y:/initialX:/initialY:), chartScrollTargetBehavior(.valueAligned(unit:/matching:) / .paging); marks outside the window are clipped. Tested: HelloCharts -more (overlay + background placed with the proxy, value lookups, held selection, drag scroll snapped to 5); range, y and angle selection, date scrolling unverified
chartPlotStyle, vectorized plots (BarPlot, LinePlot, iOS 18), Chart3D ✅ 18.0 chartPlotStyle: the plot area as a view (background, border, overlay; adapted: size modifiers do not resize the plot). iOS 18: BarPlot, LinePlot (data, series, y = f(x), parametric (x, y) = f(t)), AreaPlot (data, ranges, functions), PointPlot, RulePlot, RectanglePlot, SectorPlot with PlottableProjection key paths and the key-path modifiers (foregroundStyle(by:), symbol(by:), symbolSize(by:), opacity(by:)); functions sampled over their domain or the x scale. iOS 26: Chart3D with PointMark/RuleMark/RectangleMark(x:y:z:) and SurfacePlot (.heightBased, .normalBased, shape styles), chart3DPose (a binding follows drags), chart3DCameraProjection, chartZScale; adapted: drawn in a Canvas (projected cube, painted back to front, simple shading, low/middle/high tick labels); Angle2D from isim's Spatial overlay. Tested: HelloCharts -more (plot style, BarPlot/PointPlot, sin LinePlot, band AreaPlot, SectorPlot; Chart3D on iOS 26)
Chart3D symbols, axes and selection (iOS 26): Chart3DSymbolShape / BasicChart3DSymbolShape (sphere, cube, cylinder, cone), Chart3DContent's symbol(_:), symbolSize(_:), symbolRotation(_:) (Spatial's Rotation3D), foregroundStyle(_:) / foregroundStyle(by:), metalness(_:), roughness(_:); chartZAxis(_:) / chartZAxis(content:), chartZAxisLabel, chartZSelection(value:) / chartZSelection(range:), chartZScale(range:type:); x / y axis visibility, values and titles in 3D ✅ 26.0 adapted: point marks are drawn as shaded solids in the projected data cube (faces lit by a fixed light; a sphere's highlight follows metalness / roughness; no other lighting model); axis marks' values (explicit, stride, desired count) are the tick labels along the cube's edges, titles sit beyond the edges' middles; a tap selects the nearest point mark (within 30 pt) and sets the x / y / z selections (a range selection: that value); chartZScale(range:) is accepted (the cube's depth is fixed). Tested (HelloCharts -3d: test_charts_3d)
Types not yet in isim (iOS 17 and earlier) ❌ ≤17 not implemented, found by the 2026-10 sweep: AnnotationContext, AnyAxisMark, ChartAxisContent, ChartScrollTargetBehaviorContext, Plot, ScaleRange (6 types; with their members under "Not yet in isim")

Not yet in isim

110 symbols Apple documents for iOS that isim does not have (exact; Apple snapshot 2026-10-14). Each links to Apple's documentation.

List