pub enum NodeKind {
Show 19 variants
Page {
config: PageConfig,
},
View,
Text {
content: String,
href: Option<String>,
runs: Vec<TextRun>,
},
Image {
src: String,
width: Option<f64>,
height: Option<f64>,
},
Table {
columns: Vec<ColumnDef>,
},
TableRow {
is_header: bool,
},
TableCell {
col_span: u32,
row_span: u32,
},
Fixed {
position: FixedPosition,
},
PageBreak,
Svg {
width: f64,
height: f64,
view_box: Option<String>,
content: String,
},
Canvas {
width: f64,
height: f64,
operations: Vec<CanvasOp>,
},
Barcode {
data: String,
format: BarcodeFormat,
width: Option<f64>,
height: f64,
},
QrCode {
data: String,
size: Option<f64>,
},
BarChart {
data: Vec<ChartDataPoint>,
width: f64,
height: f64,
color: Option<String>,
show_labels: bool,
show_values: bool,
show_grid: bool,
title: Option<String>,
},
LineChart {
series: Vec<ChartSeries>,
labels: Vec<String>,
width: f64,
height: f64,
show_points: bool,
show_grid: bool,
title: Option<String>,
},
PieChart {
data: Vec<ChartDataPoint>,
width: f64,
height: f64,
donut: bool,
show_legend: bool,
title: Option<String>,
},
AreaChart {
series: Vec<ChartSeries>,
labels: Vec<String>,
width: f64,
height: f64,
show_grid: bool,
title: Option<String>,
},
DotPlot {
groups: Vec<DotPlotGroup>,
width: f64,
height: f64,
x_min: Option<f64>,
x_max: Option<f64>,
y_min: Option<f64>,
y_max: Option<f64>,
x_label: Option<String>,
y_label: Option<String>,
show_legend: bool,
dot_size: f64,
},
Watermark {
text: String,
font_size: f64,
angle: f64,
},
}Expand description
The different kinds of nodes in the document tree.
Variants§
Page
A page boundary. Content inside flows according to page config.
Fields
config: PageConfigView
A generic container, analogous to a
Text
A text node with string content.
Fields
Image
An image node.
Fields
Table
A table container. Children should be TableRow nodes.
TableRow
A row inside a Table.
Fields
TableCell
A cell inside a TableRow.
Fixed
A fixed element that repeats on every page (headers, footers, page numbers).
Fields
position: FixedPositionWhere to place this element on the page.
PageBreak
An explicit page break.
Svg
An SVG element rendered as vector graphics.
Fields
Canvas
A canvas drawing primitive with arbitrary vector operations.
Fields
Barcode
A 1D barcode rendered as vector rectangles.
Fields
format: BarcodeFormatBarcode format (Code128, Code39, EAN13, EAN8, Codabar). Default: Code128.
QrCode
A QR code rendered as vector rectangles.
Fields
BarChart
A bar chart rendered as native vector graphics.
Fields
data: Vec<ChartDataPoint>Data points with labels and values.
LineChart
A line chart rendered as native vector graphics.
Fields
series: Vec<ChartSeries>Data series (each with name, data points, optional color).
PieChart
A pie chart rendered as native vector graphics.
Fields
data: Vec<ChartDataPoint>Data points with labels, values, and optional colors.
AreaChart
An area chart rendered as native vector graphics.
Fields
series: Vec<ChartSeries>Data series (each with name, data points, optional color).
DotPlot
A dot plot (scatter plot) rendered as native vector graphics.
Fields
groups: Vec<DotPlotGroup>Groups of data points.
Watermark
A watermark rendered as rotated text behind page content.