pub struct RenderSpec {
pub kind: RenderKind,
pub columns: Option<Vec<String>>,
pub labels: Option<BTreeMap<String, String>>,
pub value: Option<String>,
pub label: Option<String>,
pub limit: Option<u32>,
pub donut: Option<bool>,
pub num: Option<String>,
pub den: Option<String>,
}Expand description
How a SqlWidget’s SQL result columns map onto a visual. A kind names
the chart; the channel fields (value, label, columns, …) name which
result columns feed it. Only the channels a kind uses are read; the
backend validates the named columns exist in the result. New chart types
are “one renderer + the same mapping”, so this stays a flat, additive shape.
Fields§
§kind: RenderKindWhich visual to render the result as.
columns: Option<Vec<String>>table only: the columns to show, in order. Absent ⇒ every result
column (the universal default).
labels: Option<BTreeMap<String, String>>table only: optional per-column header relabelling (result column →
display name). Columns not listed keep their SQL name.
value: Option<String>stat / bar / pie / gauge: the result column holding the numeric
value (stat/gauge read the first row; bar/pie read every row).
label: Option<String>bar / pie: the result column holding each row’s category label.
limit: Option<u32>bar / pie: keep only the top-N rows (by value). Absent ⇒ all rows.
donut: Option<bool>pie only: render as a donut (a hole with the total in the centre).
num: Option<String>gauge only: the numerator column (paired with den). Alternative to
a precomputed value ratio.
den: Option<String>gauge only: the denominator column (paired with num).
Trait Implementations§
Source§impl Clone for RenderSpec
impl Clone for RenderSpec
Source§fn clone(&self) -> RenderSpec
fn clone(&self) -> RenderSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderSpec
impl Debug for RenderSpec
Source§impl<'de> Deserialize<'de> for RenderSpec
impl<'de> Deserialize<'de> for RenderSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for RenderSpec
impl Hash for RenderSpec
Source§impl JsonSchema for RenderSpec
impl JsonSchema for RenderSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more