tessera_html 0.1.0
tessera_html: ^0.1.0 copied to clipboard
HTML export for the tessera pivot-table engine: writes a cube as a table with merged group headers, themed with CubeExportTheme. Pure Dart, no dependencies beyond tessera.
tessera_html #
HTML export for the tessera pivot-table engine.
HtmlCubeExporter writes a CubeLayout (the expanded rows and columns
exactly as shown) as a <table>: merged group headers in the "rotated L"
shape, one column per aggregate under each column entry, subtotals on the
group's own row, classes per cell kind and level, and a stylesheet from
the engine's CubeExportTheme — embedded in a <style>, inlined on the
cells (for e-mail), or left out so the page's CSS takes over. Labels and
numbers come from TesseraStrings, so the export is localized like the
widgets.
Pure Dart, no Flutter — servers, CLIs and apps alike.
import 'package:tessera_html/tessera_html.dart';
final html = HtmlCubeExporter(
strings: TesseraStrings.forLanguage('hu')!,
theme: CubeExportTheme.brand(primary: 0xFF00695C),
).export(cube.layout, title: 'Sales by region');
export returns the HTML as a String (a whole document, or a fragment
with standalone: false).
Example #
example/main.dart reads example/sales.csv, builds
a region/country × year/quarter cube with every region expanded and writes
it as sales_pivot.html:
dart run example/main.dart [input.csv] [output.html]
License #
MIT — see LICENSE. Author: László Zsolt Nagy.