andreaferretti / paths-js

Generate SVG paths for geometric shapes :bar_chart:
http://andreaferretti.github.io/paths-js-react-demo/
Apache License 2.0
1.71k stars 84 forks source link

StockCurve[A].item returns a collection of items #23

Closed stewSquared closed 9 years ago

stewSquared commented 9 years ago

So, according to the documentation, Stock.curves returns a collection of curves, "each having the properties line, area, item and index. [...] Under item one finds the original element in the data."

The problem is that this implies that each curve is associated with a singular item, despite the fact that the curve is dependent on a series of items. This is formalized in the explicitly typed scala.js documentation. Where the type of StockCurve[A].item is A rather than Array[A]

This is inspite of the fact the .item actually returns an array, leading to a runtime error when treating item like an A.

andreaferretti commented 9 years ago

Thank you, I have fixed the documentation and accepted your PR on paths-scala-js

stewSquared commented 9 years ago

Thanks! I'm loving this library, by the way. The level of control I have over the final output is great, yet my code remains small and clean.