Skip to main content

facett

facett's Rust UI components, compiled to WebAssembly and drawn on WebGPU — graphs to 100 000 nodes, maps (2-D and 3-D OSM), tables, charts, timelines, a docs viewer, a 3-D model viewer and a simulation view — shipped as a Python package with a host-agnostic loader page. Every pixel is drawn by the Rust components; there is no JavaScript renderer and no Python renderer.

Install

pip install facett               # the components + loader, no dependencies
pip install 'facett[streamlit]'  # + Streamlit support (facett.streamlit)

import facett never imports Streamlit; only facett.streamlit does, and it says which extra to install when Streamlit is missing.

Streamlit

import streamlit as st
from facett.streamlit import facett_component, is_data_driven

st.title("facett in Streamlit")
facett_component("table", data={
    "columns": ["repo", "lang", "crates"],
    "rows": [["facett", "rust", "71"], ["korp", "rust", "12"]],
})
# graph components generate their data INSIDE the wasm — 100 000 nodes never cross
# from Python:
facett_component("graphpan", data={"generate": {"source": "sbm", "size": 100_000, "seed": 1}})

facett_component(name, *, data=None, height=520, key=None, dev=False, nav="labels") mounts one component in an iframe served from the installed package. A full app built on it is the facett-demo package (pip install facett-demo, then run facett-demo).

Any other host

import facett

facett.assets_dir()   # directory holding index.html + every bundle's wasm, JS glue, manifest
facett.manifest()     # [{name, description, group, title, data_driven, bundle, generate}, ...]
facett.bundles()      # the routing table: which bundle (core/docs/model3d/sim) holds which component
facett.build_info()   # identity of the INSTALLED artifact: version, wasm size, component count

Serve assets_dir() and load index.html:

  • index.html?component=table&data=<url-encoded JSON>, or post {type: "facet:render", args: {component, data, height}} to the frame;
  • index.html?component=<name>&events=<SSE url> — a live feed: every event's data is one payload; {"done": true} ends it and keeps the last frame up, {"error": "<why>"} shows the host's own words.

When no host has named a component the loader WAITS and draws nothing — it never shows a fixture where a caller's data was expected.

Requirements

  • A browser with WebGPU, in a secure context (localhost or https — and every ancestor frame must be one too). Chrome/Edge on Linux need --enable-unsafe-webgpu --enable-features=Vulkan.
  • The wasm runs each component's CPU preparation on one thread (wasm32 has no threads here); rendering is on the GPU.

Versions

0.2.0 is the first release under this name. It was facet-wrapped-web (0.1.x); the old import name facet_wrapped_web still works in 0.2.x as an alias that warns, and is removed in 0.3.0.

License

MIT OR Apache-2.0.

Metadata

Release files for facett 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for facett 0.2.0
File Interpreter ABI Platform Actions
facett-0.2.0-py3-none-any.whl Python 3 none any Details for facett-0.2.0-py3-none-any.whl

Release files / facett-0.2.0-py3-none-any.whl

Download URL facett-0.2.0-py3-none-any.whl
Size 12.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9fec3f1e1b3b042886f3a13cbe8825ab8737256a66da6ece4b9e7730f5d79163
BLAKE2b-256 checksum
How to use checksums
683cb0b53066d2732b6d0106a417e3716e191e4875a9b01aa88a4e111946e860
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via facett-ops/0.1.19 (publish-pypi)

Security for facett 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page