-
Notifications
You must be signed in to change notification settings - Fork 28
Usage of DatumFunction #17
Comments
I had the same problem when converting the force directed graph example. I solved it by casting the function result type to Primitive. Like this: node.style("fill", (d: Node, a: Int, b: Int) => colorStr: Primitive) |
Thanks, that worked! |
thats true, using all parameters uses the wrong implicit. But in your case, using only two parameter function works as expected:
|
Hi, I have the same problem with this code:
I don't understand how to get it works. I have tried a lot of things and impossible to have the good implicit conversion... |
I guess you can |
Finally, it was not the implicit conversion but the returned values and the parameters. This worked:
|
Hello,
I am trying to "port" this Scatterplot example (http://bl.ocks.org/weiglemc/6185069) to scala-js-d3
Unfortunately, I am having some trouble understanding the proper use of DatumFunction. Please see my code, which I just added to your example project:
https://gist.github.com/littler00t/943b1cd79c7922229dff
See lines 121ff : I understand the return type of DatumFunction should be String and the "Datum" type is also String.
Nevertheless, I get compilation error:
Would be great if you could help. It's probably just a minor issue coming from my lack of understanding so any help is greatly appreciated :-) If I finish the scatterplot, maybe it can serve as an example on how to handle this kind of stuff.
Thanks
The text was updated successfully, but these errors were encountered: