After importing D3 into my component, I encounter an issue when trying to assign a layout to the D3.layout
property. Strangely, although the layout property is present in the console output of my D3 object, it seems to be unknown when I attempt to call it. What could be causing this discrepancy?
import { adjacencyMatrixLayout } from './lib/d3-adjacency-matrix-layout';
import * as d3Lib from 'd3';
export class AdjacencyComponent implements OnInit {
public adjacencyData: any;
private _d3 = d3Lib;
constructor(private _dataService: DataService) {
console.log(this._d3); // <--- layout is there, I can see it in the console
this._d3.layout; // <---- Property 'layout' does not exist on type 'typeof ?? WHY?
}
}