{"action":"created","issue":{"url":"https://api.github.com/repos/spaced/scala-js-d3/issues/17","labels_url":"https://api.github.com/repos/spaced/scala-js-d3/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/spaced/scala-js-d3/issues/17/comments","events_url":"https://api.github.com/repos/spaced/scala-js-d3/issues/17/events","html_url":"https://github.com/spaced/scala-js-d3/issues/17","id":127089336,"number":17,"title":"Usage of DatumFunction","user":{"login":"littler00t","id":16478205,"avatar_url":"https://avatars.githubusercontent.com/u/16478205?v=3","gravatar_id":"","url":"https://api.github.com/users/littler00t","html_url":"https://github.com/littler00t","followers_url":"https://api.github.com/users/littler00t/followers","following_url":"https://api.github.com/users/littler00t/following{/other_user}","gists_url":"https://api.github.com/users/littler00t/gists{/gist_id}","starred_url":"https://api.github.com/users/littler00t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littler00t/subscriptions","organizations_url":"https://api.github.com/users/littler00t/orgs","repos_url":"https://api.github.com/users/littler00t/repos","events_url":"https://api.github.com/users/littler00t/events{/privacy}","received_events_url":"https://api.github.com/users/littler00t/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-17T11:25:53Z","updated_at":"2016-01-17T17:17:03Z","closed_at":null,"body":"Hello,\r\n\r\nI am trying to \"port\" this Scatterplot example (http://bl.ocks.org/weiglemc/6185069) to scala-js-d3\r\n\r\nUnfortunately, I am having some trouble understanding the proper use of DatumFunction. Please see my code, which I just added to your example project:\r\n\r\nhttps://gist.github.com/littler00t/943b1cd79c7922229dff\r\n\r\nSee lines 121ff : I understand the return type of DatumFunction should be String and the \"Datum\" type is also String. \r\n\r\nNevertheless, I get compilation error:\r\n\r\n```\r\n[error] ... scala-js-d3-example-app/src/main/scala/example/ScalaJSExample.scala:121: type mismatch;\r\n[error]  found   : (String, Int, Int) => String\r\n[error]  required: legend.DatumFunction[org.singlespaced.d3js.d3.Primitive]\r\n[error]     (which expands to)  scala.scalajs.js.Function3[String,Int,Int,scala.scalajs.js.|[scala.scalajs.js.|[Double,String],Boolean]]\r\n[error]     val transformLegend: legend.DatumFunction[d3.Primitive] = { (d: String, x: Int, y: Int) => \"translate(0,\" + x * 20 + \")\" }\r\n[error]                                                                                             ^\r\n[error] ... scala-js-d3-example-app/src/main/scala/example/ScalaJSExample.scala:124: type mismatch;\r\n[error]  found   : (String, Int, Int) => String\r\n[error]  required: scala.scalajs.js.Function3[String,Int,Int,org.singlespaced.d3js.d3.Primitive]\r\n[error]     (which expands to)  scala.scalajs.js.Function3[String,Int,Int,scala.scalajs.js.|[scala.scalajs.js.|[Double,String],Boolean]]\r\n[error]     val transformLegend2: scala.scalajs.js.Function3[String, Int, Int, d3.Primitive] = { (d: String, x: Int, y: Int) => \"translate(0,\" + x * 20 + \")\" }\r\n[error]                                                                                                                      ^\r\n[error] two errors found\r\n[error] (compile:compileIncremental) Compilation failed\r\n```\r\n\r\nWould 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.\r\n\r\nThanks "},"comment":{"url":"https://api.github.com/repos/spaced/scala-js-d3/issues/comments/172354320","html_url":"https://github.com/spaced/scala-js-d3/issues/17#issuecomment-172354320","issue_url":"https://api.github.com/repos/spaced/scala-js-d3/issues/17","id":172354320,"user":{"login":"littler00t","id":16478205,"avatar_url":"https://avatars.githubusercontent.com/u/16478205?v=3","gravatar_id":"","url":"https://api.github.com/users/littler00t","html_url":"https://github.com/littler00t","followers_url":"https://api.github.com/users/littler00t/followers","following_url":"https://api.github.com/users/littler00t/following{/other_user}","gists_url":"https://api.github.com/users/littler00t/gists{/gist_id}","starred_url":"https://api.github.com/users/littler00t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littler00t/subscriptions","organizations_url":"https://api.github.com/users/littler00t/orgs","repos_url":"https://api.github.com/users/littler00t/repos","events_url":"https://api.github.com/users/littler00t/events{/privacy}","received_events_url":"https://api.github.com/users/littler00t/received_events","type":"User","site_admin":false},"created_at":"2016-01-17T17:17:03Z","updated_at":"2016-01-17T17:17:03Z","body":"Thanks, that worked!"}}