Hi Tristan, Thanks again for your helpful feedback. Based on your observations, here's what I've done so far:
This would be more useful as a package than a single program. You could > move main into an example/ folder and keep the rest of the content in the > top level as a package. Move the explanatory comment up as a Package > comment. I have now moved main to an example folder and left the rest as a package. I then defined an interface `TreeMapper` that represents any type that can be drawn by the treemap's DrawTreemap function. The standard library includes color handling, check the image package. I haven't yet figured this out. I'd look more carefully into the image package. The strconv wrapper is probably a bit excessive for the sake of the cast > (you might not need it if you use color.Color anyway) I removed the strconv wrapper, it really seemed excessive. I'm still yet to implement the use of color. The orientation might be better off as a tyoed parameter, look for docs on > typed constants. I read this article <https://blog.golang.org/constants> on the subject and found it really great! I have updated to code to reflect that. Any further advice would be greatly appreciated. The link still remains https://github.com/willpoint/treemap Thanks, Uzondu On Wed, Oct 3, 2018, 09:13 Uzondu Enudeme <willpo...@gmail.com> wrote: > Thanks a lot Tristan, > > The points you mentioned are really all very important ones. > > I'm currently following all your suggestions and would repost the link to > the updated code in case I missed some points. > > > On Wed, Oct 3, 2018, 06:52 Tristan Colgate <tcolg...@gmail.com> wrote: > >> A couple of quick observations. >> >> This would be more useful as a package than a single program. You could >> move main into an example/ folder and keep the rest of the content in the >> top level as a package. Move the explanatory comment up as a Package >> comment. >> >> The standard library includes color handling, check the image package. >> >> The strconv wrapper is probably a bit excessive for the sake of the cast >> (you might not need it if you use color.Color anyway) >> >> The orientation might be better off as a tyoed parameter, look for docs >> on typed constants. >> >> >> >> >> >> On Tue, 2 Oct 2018, 23:06 Uzondu Enudeme, <willpo...@gmail.com> wrote: >> >>> Hi everyone, >>> >>> I've been following the golang-nuts' email threads for a while now and >>> I'm amazed at how much I've learnt seeing ways solutions are profferred. >>> >>> I implemented a treemap for data visualization, and wrote a process.md >>> file giving some sort of background and detail. >>> >>> I want to use this opportunity to learn what I could have done better by >>> asking that the code be reviewed, it's in a single main.go file at >>> github.com/willpoint/treemap >>> >>> Thanks in advance for the time that would be spent and any advice given. >>> >>> >>> Uzondu >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "golang-nuts" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to golang-nuts+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.