sgratzl / chartjs-chart-geo

Chart.js Choropleth and Bubble Maps
https://www.sgratzl.com/chartjs-chart-geo/
MIT License
347 stars 36 forks source link

TS Error on import of library #187

Closed contis2908 closed 1 year ago

contis2908 commented 1 year ago

When I try to import chartjs-chart-geo to my project I am receiving the following error:

node_modules/chartjs-chart-geo/build/index.d.ts:130:15 - error TS2420: Class 'GeoFeature' incorrectly implements interface 'VisualElement'.
  Type 'Element<IGeoFeatureProps, IGeoFeatureOptions>' is missing the following properties from type 'VisualElement': draw, inRange, inXRange, inYRange, getCenterPoint

130 declare class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> implements VisualElement {
                  ~~~~~~~~~~

node_modules/chartjs-chart-geo/build/index.d.ts:176:72 - error TS2344: Type 'GeoFeature' does not satisfy the constraint 'Element<AnyObject, AnyObject> & VisualElement'.
  Type 'Element<IGeoFeatureProps, IGeoFeatureOptions>' is missing the following properties from type 'VisualElement': draw, inRange, inXRange, inYRange, getCenterPoint

176 declare class ChoroplethController extends GeoController<'choropleth', GeoFeature> {
                                                                           ~~~~~~~~~~

Found 2 errors in the same file, starting at: node_modules/chartjs-chart-geo/build/index.d.ts:130

Context

Additional context

The documentation does not really show what to import from the library. Is it ChartGeo or GeoFeature ?

sgratzl commented 1 year ago

should be fixed with the latest release