8000 @types/d3-hexbin and @types/d3 coexistence as global libraries · Issue #19402 · DefinitelyTyped/DefinitelyTyped · GitHub
[go: up one dir, main page]

Skip to content
@types/d3-hexbin and @types/d3 coexistence as global libraries #19402
@hugoferreira

Description

@hugoferreira

So, I'm using d3 and d3-hexbin as global libraries:

<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-hexbin.v0.2.min.js"></script>

... and referencing them in .ts as:

/// <reference types="d3" />
/// <reference types="d3-hexbin" />

However, although this works:

const svg = d3.select('#hitmap')

... this:

const hexbin = d3.hexbin()

... fails with a :

Property 'hexbin' does not exist on type 
  'typeof "/Users/bytter/node_modules/@types/d3/index"'

By looking at the tests, I can see that:

import * as d3Hexbin from 'd3-hexbin';

Would export the hexbin() function directly into the d3Hexbin namespace, but I'm unable to figure out how to conciliate this with d3-hexbin as a global library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0