Struct vega_lite_4::DataFormatBuilder
source · pub struct DataFormatBuilder { /* private fields */ }
Expand description
Builder for DataFormat
.
Implementations§
source§impl DataFormatBuilder
impl DataFormatBuilder
sourcepub fn parse<VALUE: Into<RemovableValue<HashMap<String, Option<String>>>>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn parse<VALUE: Into<RemovableValue<HashMap<String, Option<String>>>>>( &mut self, value: VALUE ) -> &mut Self
If set to null
, disable type inference based on the spec and only use type inference
based on the data. Alternatively, a parsing directive object can be provided for explicit
data types. Each property of the object corresponds to a field name, and the value to the
desired data type (one of "number"
, "boolean"
, "date"
, or null (do not parse the
field)). For example, "parse": {"modified_on": "date"}
parses the modified_on
field
in each input record a Date value.
For "date"
, we parse data based using Javascript’s
Date.parse()
.
For Specific date formats can be provided (e.g., {foo: "date:'%m%d%Y'"}
), using the
d3-time-format syntax. UTC date
format parsing is supported similarly (e.g., {foo: "utc:'%m%d%Y'"}
). See more about
UTC time
sourcepub fn data_format_type<VALUE: Into<DataFormatType>>(
&mut self,
value: VALUE
) -> &mut Self
pub fn data_format_type<VALUE: Into<DataFormatType>>( &mut self, value: VALUE ) -> &mut Self
Type of input data: "json"
, "csv"
, "tsv"
, "dsv"
.
Default value: The default format type is determined by the extension of the file
URL. If no extension is detected, "json"
will be used by default.
sourcepub fn delimiter<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn delimiter<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.
sourcepub fn property<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn property<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The JSON property containing the desired data. This parameter can be used when the loaded
JSON file may have surrounding structure or meta-data. For example "property": "values.features"
is equivalent to retrieving json.values.features
from the loaded
JSON object.
sourcepub fn feature<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn feature<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The name of the TopoJSON object set to convert to a GeoJSON feature collection. For
example, in a map of the world, there may be an object set named "countries"
. Using the
feature property, we can extract this set and generate a GeoJSON feature object for each
country.
sourcepub fn mesh<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn mesh<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The name of the TopoJSON object set to convert to mesh. Similar to the feature
option,
mesh
extracts a named TopoJSON object set. Unlike the feature
option, the
corresponding geo data is returned as a single, unified mesh instance, not as individual
GeoJSON features. Extracting a mesh is useful for more efficiently drawing borders or
other geographic elements that you do not need to associate with specific regions such as
individual countries, states or counties.
sourcepub fn build(&self) -> Result<DataFormat, DataFormatBuilderError>
pub fn build(&self) -> Result<DataFormat, DataFormatBuilderError>
Trait Implementations§
source§impl Clone for DataFormatBuilder
impl Clone for DataFormatBuilder
source§fn clone(&self) -> DataFormatBuilder
fn clone(&self) -> DataFormatBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more