Just wanted to point out that this isn't TypeScript specific, arrow
functions are part of ES2015.

On Thu, Mar 17, 2016 at 2:52 AM, Mallegriss <[email protected]> wrote:

> sorted out.
>
>
>
> .attr("d", d3.svg.symbol()
>
>                     .size(d => d.size))
>
>
>
> On Wednesday, March 16, 2016 at 10:42:51 PM UTC+13, Mallegriss wrote:
>>
>> Hi guys,
>>
>> I'd like to know how to translate below piece code into typescript:
>>
>> this.nodes = svg.selectAll(".node")
>>                         .data(this.forceLayout.nodes()) //<-- get all
>> nodes in data
>>                         .enter().append("path")
>>                         .attr("class", "node")
>>                         .attr("d", function (d) { return d3.svg.symbol()
>>                                                  .size(d.size); })
>>
>>
>> I tried this:
>>
>> .attr("d", (d) => { d3.svg.symbol()
>>
>>                     .size(d.size)})
>>
>>
>> it turned out to be below, which doesn't work.
>>                     .attr("d", function (d) {
>>                                 d3.svg.symbol()
>>                                     .size(d.size);})
>>
>>
>> Thanks,
>> M
>>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/8c129908-c89a-4dfd-8bc1-cbd503a96845%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/8c129908-c89a-4dfd-8bc1-cbd503a96845%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CAEKsHmC90pY8d8CxnDG7GxMSUgmz9D7YNyj_nqSgeOGRyT5sQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to