macro_rules! roles {
($($variant:ident => $name:literal),+ $(,)?) => {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum DataRole {
$(#[doc = concat!("Authored `", $name, "` input.")] $variant,)+
}
impl DataRole {
pub const fn as_str(self) -> &'static str {
match self {
$(Self::$variant => $name,)+
}
}
#[doc(hidden)]
pub fn from_name(name: &str) -> Option<Self> {
match name {
$($name => Some(Self::$variant),)+
_ => None,
}
}
}
};
}
roles!(
X => "x",
Y => "y",
Z => "z",
Category => "category",
Value => "value",
Samples => "samples",
Estimate => "estimate",
Lower => "lower",
Upper => "upper",
Condition => "condition",
Term => "term",
Left => "left",
Right => "right",
Delta => "delta",
EstimateStatus => "estimate_status",
Group => "group",
Hue => "hue",
Series => "series",
FacetRow => "facet_row",
FacetColumn => "facet_column",
FacetWrap => "facet_wrap",
SamplingUnits => "sampling_units",
Weights => "weights",
CompareKey => "compare_key",
Split => "split",
Fill => "fill",
Color => "color",
AnnotationValues => "annotation_values",
DisplayMask => "display_mask",
HighlightCells => "highlight_cells",
Labels => "labels",
Text => "text",
Padding => "padding",
Position => "position",
Edges => "edges",
Height => "height",
Baseline => "baseline",
BarWidth => "bar_width",
BodyWidth => "body_width",
Gap => "gap",
Start => "start",
End => "end",
Duration => "duration",
First => "first",
Second => "second",
Where => "where",
Middle => "middle",
ErrorArms => "error_arms",
Density => "density",
Center => "center",
Count => "count",
Kde => "kde",
EvaluationGrid => "evaluation_grid",
Geometry => "geometry",
Summary => "summary",
Curves => "curves",
Variables => "variables",
Time => "time",
Lane => "lane",
LineOffsets => "line_offsets",
LineLengths => "line_lengths",
LaneLower => "lane_lower",
LaneHeight => "lane_height",
DecayTime => "decay_time",
Open => "open",
High => "high",
Low => "low",
Close => "close",
Signal => "signal",
Frequency => "frequency",
Other => "other",
Lag => "lag",
Field => "field",
Mesh => "mesh",
Pixels => "pixels",
Grid => "grid",
Sparsity => "sparsity",
RowColors => "row_colors",
ColumnColors => "column_colors",
RowOrder => "row_order",
ColumnOrder => "column_order",
Observed => "observed",
Theoretical => "theoretical",
PlottingPositions => "plotting_positions",
Reference => "reference",
Covariance => "covariance",
FitResult => "fit_result",
Fitted => "fitted",
Residual => "residual",
Successes => "successes",
Trials => "trials",
JointPredictor => "joint_predictor",
CovariateAdjustment => "covariate_adjustment",
PredictionGrid => "prediction_grid",
QuantileLevel => "quantile_level",
Offset => "offset",
Exposure => "exposure",
Scores => "scores",
Thresholds => "thresholds",
Fpr => "fpr",
Tpr => "tpr",
Recall => "recall",
Precision => "precision",
MeanProbability => "mean_probability",
FractionPositive => "fraction_positive",
Probability => "probability",
Event => "event",
Entry => "entry",
Censors => "censors",
RiskTable => "risk_table",
Effect => "effect",
PValues => "p_values",
AdjustedPValues => "adjusted_p_values",
NegativeLog10 => "negative_log10",
Mean => "mean",
Difference => "difference",
Bias => "bias",
DeltaValue => "delta_value",
Theta => "theta",
R => "r",
AngularWidth => "angular_width",
Explode => "explode",
Direction => "direction",
Speed => "speed",
AngularEdges => "angular_edges",
SpeedEdges => "speed_edges",
Mass => "mass",
CalmMass => "calm_mass",
SectorMass => "sector_mass",
WeibullScale => "weibull_scale",
WeibullShape => "weibull_shape",
Flags => "flags",
Full => "full",
Half => "half",
Composition => "composition",
Dimensions => "dimensions",
Stages => "stages",
Graph => "graph",
Tree => "tree",
Process => "process",
Port => "port",
Flow => "flow",
Connections => "connections",
Stage => "stage",
Features => "features",
Tiles => "tiles",
Lon => "lon",
Lat => "lat",
Radius => "radius",
LabelPositions => "label_positions",
Dx => "dx",
Dy => "dy",
Dz => "dz",
Vertices => "vertices",
VertexValues => "vertex_values",
FaceValues => "face_values",
Occupied => "occupied",
XEdges => "x_edges",
YEdges => "y_edges",
ZEdges => "z_edges",
XCorners => "x_corners",
YCorners => "y_corners",
ZCorners => "z_corners",
Seeds => "seeds",
Paths => "paths",
MeshMarker => "mesh_marker",
MarkerRotation => "marker_rotation",
MarkerScale => "marker_scale",
X0 => "x0",
Y0 => "y0",
X1 => "x1",
Y1 => "y1",
Stop => "stop",
Sweep => "sweep",
NotchLower => "notch_lower",
NotchUpper => "notch_upper",
NormalError => "normal_error",
Normals => "normals",
Measure => "measure",
PointColor => "point_color",
LineColor => "line_color",
FillColor => "fill_color",
EdgeColor => "edge_color",
TextColor => "text_color",
PointSize => "point_size",
PointShape => "point_shape",
LineWidth => "line_width",
LinePattern => "line_pattern",
FillPattern => "fill_pattern",
EdgeWidth => "edge_width",
FontSize => "font_size",
Rotation => "rotation",
HatchSpacing => "hatch_spacing",
VectorLength => "vector_length",
TubeRadius => "tube_radius",
FlowWidth => "flow_width",
PointAlpha => "point_alpha",
LineAlpha => "line_alpha",
FillAlpha => "fill_alpha",
EdgeAlpha => "edge_alpha",
TextAlpha => "text_alpha",
SetMembership => "set_membership",
SegmentRanges => "segment_ranges",
Sector => "sector",
CircularLinks => "circular_links",
StandardError => "standard_error",
Variance => "variance",
Intervals => "intervals",
QuantileProbabilities => "quantile_probabilities",
QuantileValues => "quantile_values",
StandardDeviation => "standard_deviation",
Correlation => "correlation",
CenteredRmse => "centered_rmse",
Loadings => "loadings",
SingularValues => "singular_values",
ExplainedVariance => "explained_variance",
Chromosome => "chromosome",
Response => "response",
TrueLabels => "true_labels",
PredictedLabels => "predicted_labels",
Individual => "individual",
RugValues => "rug_values",
EventCode => "event_code",
CumulativeHazard => "cumulative_hazard",
CumulativeIncidence => "cumulative_incidence",
);