The family's entry point: a document is a chart if it matches exactly one of
the leaf schemas, selected by its type.
Arguments
- classes
List: ChartConfig subclasses.
- id
Character: The dispatcher's
$idURL.- leaf_ids
Character:
$idof each leaf schema, in the same order asclasses.- title
Character: Human-readable schema title.
- description
Character: What the family is.
Value
Named list: The JSON Schema, ready for jsonlite::toJSON().
Examples
schema <- chart_dispatcher_schema(
classes = list(ScatterConfig, BarConfig),
id = "https://schemas.rtemis.org/draw/chart.schema.json",
leaf_ids = c(
"https://schemas.rtemis.org/draw/scatter.schema.json",
"https://schemas.rtemis.org/draw/bar.schema.json"
),
title = "Chart",
description = "Any rtemis.draw chart."
)
schema[["properties"]][["type"]][["enum"]]#> [1] "scatter" "bar"