Vì vậy, tôi đang sử dụng d3
và d3-hexbin
như thư viện toàn cầu:'d3 và 'd3-hexbin' trong nguyên cảo như thư viện toàn cầu
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/d3-hexbin.v0.2.min.js"></script>
... và tham khảo chúng trong .ts
như:
/// <reference types="d3" />
/// <reference types="d3-hexbin" />
... sử dụng định nghĩa DefinitelyTyped. Tuy nhiên, mặc dù công trình này:
const svg = d3.select('#hitmap').append('svg')
... này:
const hexbin = d3.hexbin().radius(binsize + 1)
... không thành công với một:
Property 'hexbin' does not exist on type
'typeof "/Users/bytter/node_modules/@types/d3/index"'
Suy nghĩ?
Related: https://github.com/Microsoft/TypeScript/issues/7125 –