Skip to content

TypeError when using library inside Angular application #3

@GerbenBergman

Description

@GerbenBergman

Hi!

When I try to use this library (added with npm) inside an Angular application I get an error saying:
TypeError: Cannot set property 'Rectangle' of undefined.

This error is resolved when I change the getTreemap function inside the index.js to an arrow function.

I try to import the module inside my component as follows:
import * as getTreemap from 'treemap-squarify'; declare var require: any; const { getTreemap } = require('treemap-squarify');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions