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
{{ message }}
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.
Also, the documentation does not mention that the 'd' argument could be undefined.
Perhaps a plain js.Function2[Datum, Int, String] would be better here? It would certainly be easier to use. Supplying a function with the current signature is a pain.
The text was updated successfully, but these errors were encountered:
Rereading the d3 documentation (and testing), it seems undefined can be supplied to the key function. So a signature of js.Function2[js.UndefOr[NewDatum], Int, String] would be needed.
Based on all that, my issue boils down to: why Datum|NewDatum in the signature of the key function, s.ThisFunction2[Datum|NewDatum,js.UndefOr[NewDatum], Int, String] ?
As per d3 documentation, the 'this' argument is either a js.Node or js.Array[Datum]. (In the example Datum=Int.)
So the signature can be js.ThisFunction2[dom.Node|js.Array[Datum], js.UndefOr[NewDatum], Int, String] or js.Function2[js.UndefOr[NewDatum], Int, String] if we don't care about 'this'.
The BaseSelection#data method's key argument has type js.ThisFunction2[Datum|NewDatum,js.UndefOr[NewDatum], Int, String]
But the 'this' argument of the key function would be a DOM node or an Array according to d3 documentation here:
https://github.com/mbostock/d3/wiki/Selections#data
Also, the documentation does not mention that the 'd' argument could be undefined.
Perhaps a plain js.Function2[Datum, Int, String] would be better here? It would certainly be easier to use. Supplying a function with the current signature is a pain.
The text was updated successfully, but these errors were encountered: