I'm trying to import a d3-lasso
package to use on angular (v10)
and d3 (v5)
.
I installed d3-lasso
using npm
.
import { Component, OnInit, AfterViewInit, AfterContentInit, OnDestroy, ViewChild, ElementRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import * as d3 from 'd3';
import * as d3lasso from 'd3-lasso'; <-- this is how I'm importing the library
When using this in regular javascript
, we'd use this as d3.lasso()
and it'd work fine. But since I'm using angular, I get the following error.
Property 'lasso' does not exist on type 'typeof' import("..../@types/d3/index")'
so, I tried a couple of things:
d3.d3lasso.lasso()
d3lasso.lasso()
but they all keep error out with similar errors as above. How do I call this lasso
function so that I can use it in the component?