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

Commit

Permalink
Update and simplify d3-cloud typing as the fix we've been waiting was…
Browse files Browse the repository at this point in the history
… merged.
  • Loading branch information
xtinec authored and kristw committed Jan 25, 2019
1 parent 1abacf0 commit 62071f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/superset-ui-plugin-chart-word-cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@superset-ui/core": "^0.7.0",
"@superset-ui/translation": "^0.7.0",
"@types/d3-array": "^1.2.4",
"@types/d3-cloud": "^1.2.0",
"@types/d3-cloud": "^1.2.1",
"@types/d3-scale": "^2.0.2",
"@types/d3-selection": "^1.3.4",
"d3-array": "^2.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ function WordCloud(element: Element, props: Props) {
.range(sizeRange)
.domain(d3Extent(data, d => d.size) as [number, number]);

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

0 comments on commit 62071f3

Please sign in to comment.