DataSourceObject

DataSourceObject describes how to connect to your data source and which mapping should be applied to the data.

Properties

Property/TypeDescription
idStringoptionalThe unique identifier of the data source. If not specified, the id is autogenerated.
typeStringoptionalThe type of the data source. Possible values: "csv", "json", "flexmonster". If not specified, the type will be autodetected.
parserConfigParserConfigObjectoptional Describes how to parse your JSON or CSV data.
dataObject[] | [][]optional Inline JSON data.
urlStringoptional The URL to the Flexmonster server, or to a file or a server-side script with JSON or CSV data.
nameStringoptional The name of a data source from the Flexmonster server.
mappingMappingObjectoptional The mapping configuration for the data source.
requestHeadersObjectContains request headers that will be added to the request sent when data is loaded via the url.

Example

const dataSource = {
  url: "ws://localhost:9501/",
  name: "sales"
};

const dataset = {
  id: "dataset-0",
  dataSource: dataSource
};

const state = {
  id: "state-0",
  dataset: dataset
};

const flexmonster = fm3.Controls.Flexmonster("#pivot-container", {
  state: state
});