<p>As a way to learn Go (besides going through a bunch of tutorials), I wrote GopherJS bindings for a pretty cool JS charts library (<a href="https://github.com/frappe/charts" rel="nofollow">https://github.com/frappe/charts</a>) that I wanted to share.</p>
<p>lib here: <a href="https://github.com/cnguy/gopherjs-frappe-charts" rel="nofollow">https://github.com/cnguy/gopherjs-frappe-charts</a></p>
<p>I'm still trying to learn the basics of Go. Clearly there is a lot of duplicate code, basically no tests (although it is purely a UI library), and I have on idea how to manage Go versions or whatever (I'm a JavaScript guy). I'm also having trouble with interface{} and GopherJS. I would definitely prefer it if the users can pass in float64[] array instead of interface{}, and then the library converts it under the hood. Is this a good idea? I also have another problem where the x-axis labels can be strings or numbers (like year numbers). I couldn't figure out how to allow both though besides doing interface{}.</p>
<p>Any feedback/suggestions would be appreciated.</p>
<hr/>**评论:**<br/><br/>jlaracil: <pre><p>I'm writing a GopherJS bindings for most popular Cordova plugins, adapting the asynchronous javascript api calls to Golang synchronous style.</p>
<p>Some documentation is missing, but it can serve as a reference to make idiomatic GopherJS bindings.</p>
<p><a href="https://github.com/jaracil/goco" rel="nofollow">https://github.com/jaracil/goco</a></p>
<p><a href="https://godoc.org/github.com/jaracil/goco" rel="nofollow">https://godoc.org/github.com/jaracil/goco</a></p></pre>csthrowaway25: <pre><p>thanks. im definitely missing some important things like error handling too - i'm just not sure what other errors i can check for yet (one i can think of is if the length of any of the values in datasets is not equal to the length of the labels. another is if the user doesn't pass in a reference to the html tag to initialize the chart in)</p></pre>TrueFurby: <pre><p>For the x-axis labels why not just use strings? Just convert numbers to strings.</p></pre>csthrowaway25: <pre><p>Mhmm, I decided to use string labels now while providing a helper to convert int arrays to str arrays for convenience.*</p></pre>
![](https://static.golangjob.cn/static/img/banner.png)