Skip to content
ESM
import { convertConfigFieldsToChartRenderer, convertInlineDataToLayerDefinition, convertInlineConfigToLayerConfig } from "@arcgis/charts-components/utils/layer/inline-conversion/index.js";

Functions

convertConfigFieldsToChartRenderer

Function

Creates a chart renderer based on the provided config fields and inline data.

Signature
convertConfigFieldsToChartRenderer (props: { categoryField: string; numericFields: string[]; configFields?: WebChartConfigFields; inlineData: WebChartDataTypes; }): WebChart["chartRenderer"]
Parameters
ParameterTypeDescriptionRequired
props
{ categoryField: string; numericFields: string[]; configFields?: WebChartConfigFields; inlineData: WebChartDataTypes; }

The category field, the numeric fields, the config fields and the data to convert.

Returns
WebChart["chartRenderer"]

convertInlineDataToLayerDefinition

Function

Converts an array of inline data to a feature set and returns an IFeatureLayer.

Signature
convertInlineDataToLayerDefinition (props: { categoryField: string; categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset"; numericFields: string[]; inlineData: WebChartDataTypes; }): IFeatureLayer | undefined
Parameters
ParameterTypeDescriptionRequired
props
{ categoryField: string; categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset"; numericFields: string[]; inlineData: WebChartDataTypes; }

The category field, the category type, the numeric fields and the inline data to convert.

Returns
IFeatureLayer | undefined

convertInlineConfigToLayerConfig

Function

Converts an array of inline data into a feature collection. Also returns a chartRenderer if the configFields are provided.

Signature
convertInlineConfigToLayerConfig (props: { categoryField: string; categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset"; numericFields: string[]; configFields?: WebChartConfigFields; inlineData: WebChartDataTypes; }): Promise<{ chartRenderer?: WebChart["chartRenderer"]; iLayer?: IFeatureLayer; layer?: FeatureLayer; }>
Parameters
ParameterTypeDescriptionRequired
props
{ categoryField: string; categoryType: "date" | "dateOnly" | "number" | "string" | "timeStampOffset"; numericFields: string[]; configFields?: WebChartConfigFields; inlineData: WebChartDataTypes; }

The category field, the category type, the numeric fields, the config fields and the inline data to convert.

Returns
Promise<{ chartRenderer?: WebChart["chartRenderer"]; iLayer?: IFeatureLayer; layer?: FeatureLayer; }>