Expand description
Non-extractable data surface.
Paint tables, timeseries, scatter, and treemaps as glyphs on a bitmap so cell values never appear as Unicode in a host DOM. Framework-agnostic. Zero required dependencies.
Not DRM. Not OCR-proof. A human with a camera still wins. The crate
signs DOM scrape, copy/paste, and tooltip-JSON layers when the host obeys
the contract (see examples/host_contract.rs). Screen readers do not get
cell values in sealed mode; the accessible egress is a licensed API the
host already meters.
use sealed_surface::{
AccessTier, CellValue, Column, FrameRequest, Grid, LicenseLens, Row, Surface,
SurfaceMode, Viewport,
};
let grid = Grid::try_new(
vec![Column::new(0, "sku"), Column::new(1, "price")],
vec![Row::new(
0,
vec![CellValue::text("ACME-SKU-1"), CellValue::float(49.0, 2)],
)],
)?;
let mut surface = Surface::new(
SurfaceMode::Sealed,
LicenseLens::from_tier(AccessTier::Trial),
);
let frame = surface.render(&grid, &FrameRequest::full(Viewport::window(640, 240)))?;
assert!(frame.host.clipboard.is_none());
assert!(!frame.host.audit_text().contains("49.00"));
assert!(frame.png.starts_with(b"\x89PNG"));Structs§
- Appearance
- Full look. Default is compact 5×7 + dark high-readability theme.
- Chart
Style - Timeseries look. Independent of table metrics.
- Column
- Column schema. Header text is treated as schema, not a datum.
- Column
Id - Stable column identity (opaque to the host).
- Frame
- One painted frame plus the host leak surface.
- Frame
Request - Inputs for one frame.
- Grid
- Owned table.
- Hit
- Opaque hit. No values.
- HitMap
- Spatial index of the visible window only.
- Host
Projection - Leak surface. Contract tests serialize this, not the pixmap.
- Host
Text - One host-visible string. Must not be a cell datum in sealed mode.
- License
Lens - Row/column policy applied to a
Gridbefore raster. - Pixmap
- RGB888 pixmap.
- Pointer
- Pointer in pixmap (window) pixel space.
- Rgb
- RGB888 color.
- Row
- One data row.
- RowId
- Stable row identity (opaque to the host; not a grain id).
- Series
- Named polyline.
- Series
Id - Identifier for a series. Opaque to the host.
- Series
Layout - Timeseries or scatter. Same samples; paint encoding differs.
- Series
Point - One sample.
xis the independent axis (time or category index). - Surface
- Stateful renderer.
- Table
Metrics - Content size and column widths. Does not depend on the viewport.
- Theme
- Surface colors.
- TreeId
- Opaque tree-node id.
- Tree
Layout - Hierarchical area chart. Squarified layout (Bruls / van Wijk).
- Tree
Node - One node. Leaves carry area mass in
Self::value; branches use the sum of children. - Viewport
- Pixel viewport.
origin_*is the scroll;width/heightis the window.
Enums§
- Access
Tier - Product-agnostic entitlement bucket. Hosts map their plans onto this.
- Cell
Value - A single cell.
CellValue::Redactedmust not carry a hidden scalar. - Clipboard
Payload - Clipboard payload produced only in copyable mode.
- Error
- Recoverable failure from layout, lens, or encode.
- HitKind
- What a pixel hit.
- Marker
Style - Where to draw series markers.
- Redaction
Style - How redacted cells are painted (never with the original scalar).
- Surface
Mode - Whether the host may observe cell values as Unicode.
- Type
Scale - Glyph size and cell metrics.
Constants§
- MAX_
PIXMAP_ AXIS - Hard cap on one pixmap axis. Hosts that need more should tile.