@ArcGIS/charts-components@5.0.18
The TypeScript type mapping for `ModelOfType<T>` excludes heat charts by mapping `ModelTypes.HeatChart` to `never`.
Because `createModel` returns `Promise<ModelOfType<T>>`, this causes incorrect typing for heat chart creation even though heat charts are supported and created at runtime.
import { createModel, ModelTypes } from "@arcgis/charts-components";
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
const layer = new FeatureLayer({ url: "..." });
const model = await createModel({
chartType: ModelTypes.HeatChart,
layer
});
// Expected: model inferred as BarChartModel | LineChartModel | ComboBarLineChartModel | BoxPlotModel | PieChartModel | ScatterplotModel | HistogramModel | GaugeModel | RadarChartModel | HeatChartModel
// Actual: model inferred as BarChartModel | LineChartModel | ComboBarLineChartModel | BoxPlotModel | PieChartModel | ScatterplotModel | HistogramModel | GaugeModel | RadarChartModelImpact
- Incorrect IntelliSense and type narrowing for heat chart workflows.
- Forces consumer-side assertions/workarounds for otherwise valid API usage.
Solved! Go to Solution.
Hi @DanRussell, thanks for letting us know about the typing issue here. We have looked into the issue and will be fixing for the upcoming release (version 5.1).
Additionally, HeatChartModel is not included here: @ArcGIS\charts-components\dist\model\index.d.ts
Hi @DanRussell, thanks for letting us know about the typing issue here. We have looked into the issue and will be fixing for the upcoming release (version 5.1).