You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is closed, but just wanted to chime in with an odd issue I experienced related to this. I tried passing a string to the symbol.type() and got the same error as above. To debug, I swapped out d3.min.js with d3.js to step through what was happening, realized I couldn't pass a string and used one of the built in symbols instead. But I still got the same error.
Turned out that while d3 was unminimized during my debugging that an included lodash.js library was grab scope of the type variable within symbol, which would end up showing the same error as before since it wasn't a valid object with draw(). Changing the type variable within symbol to something like symtype worked and of course going back to using d3.min.js also worked. Not sure why lodash was stealing scope of that variable but it was.
TLDR: For those who don't use the minified version of d3 you might want to change the name of the type variable to avoid scope conflicts.
I just noticed that passing a string to specify a symbol type doesn't work anymore in d3 v4.
Results in the following error:
Was this intentional? If so, it'd be great if the docs for v4 stated so. :-)
I can workaround this by passing in the appropriate symbol object from the symbols folder (https://github.com/d3/d3-shape/tree/master/src/symbol)
But having some kind of string mapping like in the old code would be great! (https://github.com/mbostock/d3/blob/master/src/svg/symbol.js)
I love the work you're doing on d3 v4 by the way, I'm finding it really easy to use without selections in a React app I'm building.
The text was updated successfully, but these errors were encountered: