Closed emeeks closed 7 years ago
What do you mean by “v4 version”?
@jasondavies He means the D3 v4 API
This library has a single dependency, d3-dispatch, so I don’t think anything needs to be done for D3 v4 compatibility. If you think something does need to be done, please reopen and provide details.
@jasondavies Maybe you should have a look at the v4 PR and voice your opinion?
It still works with D3 v4 :)
Most code examples online fails because of the error: d3.layout.cloud() is not a function
. I encountered the same error while using d3-cloud in my Vue app, but eventually solved it (inspired by the d3-cloud examples):
import * as cloud from 'd3-cloud'
// ...
// instead of using d3.layout.cloud()
var layout = cloud()
.size([width, height])
.words(words)
// ...
It still works with D3 v4 :) Most code examples online fails because of the error:
d3.layout.cloud() is not a function
. I encountered the same error while using d3-cloud in my Vue app, but eventually solved it (inspired by the d3-cloud examples):import * as cloud from 'd3-cloud' // ... // instead of using d3.layout.cloud() var layout = cloud() .size([width, height]) .words(words) // ...
How is this supposed to work?
Hey all, I have the same issue with creating a wordcloud in React using raw D3v4 by accessing an svg ref using a hook. Using the snippet previously mentioned yields
This expression is not callable.
Type '{ default: { (): Cloud<Word>; <T extends Word>(): Cloud<T>; }; }' has no call signatures. TS2349
Nevermind! Using import cloud from "d3-cloud";
instead works! import * as cloud from 'd3-cloud'
wouldn't.
I describe this layout in one of the chapters of my book and I'm updating that to the 2nd edition for d3v4 and I was wondering if there will be a v4 version of this chart forthcoming. If not, no worries, I can replace the word cloud section with something else.