Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit b801005

Browse files
Christine Chamberskristw
authored andcommitted
Update and simplify d3-cloud typing as the fix we've been waiting was merged.
1 parent f587482 commit b801005

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/superset-ui-plugin-chart-word-cloud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@superset-ui/core": "^0.7.0",
3030
"@superset-ui/translation": "^0.7.0",
3131
"@types/d3-array": "^1.2.4",
32-
"@types/d3-cloud": "^1.2.0",
32+
"@types/d3-cloud": "^1.2.1",
3333
"@types/d3-scale": "^2.0.2",
3434
"@types/d3-selection": "^1.3.4",
3535
"d3-array": "^2.0.2",

packages/superset-ui-plugin-chart-word-cloud/src/WordCloud.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ function WordCloud(element: Element, props: Props) {
3737
.range(sizeRange)
3838
.domain(d3Extent(data, d => d.size) as [number, number]);
3939

40-
// TODO: Remove the type casting once the following PR is merged
41-
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30479
42-
const layout = (cloudLayout as () => d3.layout.Cloud<Datum>)()
40+
const layout = cloudLayout<Datum>()
4341
.size(size)
4442
.words(data)
4543
/* eslint-disable-next-line no-magic-numbers */

0 commit comments

Comments
 (0)