Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control legend format? #31

Open
ellisp opened this issue Oct 9, 2016 · 10 comments
Open

control legend format? #31

ellisp opened this issue Oct 9, 2016 · 10 comments
Assignees

Comments

@ellisp
Copy link
Collaborator

ellisp commented Oct 9, 2016

would you consider a pull request that let the user control the legend format? eg pass through arguments to format so it can have big.marks, etc. I could have a go but won't put the effort in if you've already thought it through and decided there's enough customisation and long argument lists already.

@mtennekes
Copy link
Owner

Isn't this already implemented in the argument legend.format, or do you still miss certain functionalities?

@mtennekes
Copy link
Owner

I was having tmap in mind, sorry:)
Indeed, it's not in treemap yet. Please feel free to push a request.

@ellisp ellisp self-assigned this Oct 11, 2016
@ellisp
Copy link
Collaborator Author

ellisp commented Oct 11, 2016

I've lodged #32 to address this. I see I have rights to merge it myself (I think this dates from years ago when you gave me those rights for additions re fonts), but I've refrained from doing this until I have @mtennekes views on the naming, and whether it's right to pass it only to dens2col and val2col legends (nearly all my treemaps are type "value" so I'm a bit hazy on the best treatment of the other types).

@mtennekes
Copy link
Owner

mtennekes commented Oct 12, 2016

Many thanks @ellisp ! The implementation seems correct to me. The value, density and manual treemaps are indeed the ones that could use formatting. As for the other ones: comparison does not need it since it contain percentages, and the others do not have numeric values.

I have updated the https://github.com/mtennekes/treemap/blob/a67993a8b154b0de525fb89b9969de376e54ef86/pkg/DESCRIPTION file. Is you email address correct? Do you want me to release it soon? Normally, I wait under there are at least a couple of changes.

@ellisp
Copy link
Collaborator Author

ellisp commented Oct 12, 2016

Great, thanks. I changed the email address to my personal one; sometimes difficult to tell which hat I'm wearing, but this one was done at home in my time so probably best to put it like that (although we need it at work). No rush to put it into production at CRAN, put out a release when it makes sense.

@ellisp ellisp closed this as completed Oct 12, 2016
@Atan1988
Copy link

Is it possible to format the number as percentages? I generally use sprintf for stuff like that, and I am not aware how to do it using format().

Thanks,
Allen

@ellisp
Copy link
Collaborator Author

ellisp commented Oct 13, 2016

@Atan1988 I don't think it will let you do that. That would be another feature to add I think; either to replace format with `sprintf`` (which would not be backwards compatible with #32 so if it's going to happen should ideally be soon) or additional arguments "suffix.legend" and "prefix.legend". As a user I'd find the latter slightly easier to understand but it comes with extra arguments and loss of flexibility.

@Atan1988
Copy link

@ellisp Peter, thank you for the response and the great work in implementing the format function. I know R fairly well, but I haven't learned how to use git yet. Would you have time to implement the sprinf function? If not, would you be willing to help with the pull/commit side of the things, if I take a shot at modifying the code? Thanks a lot! Allen

@mtennekes
Copy link
Owner

It's really confusing, all those formatting functions: format, sprintf, formatC, prettyNum :-s

As @ellisp suggested, we can add suffix and prefix to the input list of format.legend (while the other arguments are passed on to format). Additionally, we can add another list argument, called FUN, which determines to which formatting function is used (by default format).

@mtennekes mtennekes reopened this Nov 3, 2016
@benjaminrobinson
Copy link

Was looking through the issue statement and the percentage issue is something that would be really helpful for me...just my two cents. Thanks for creating the package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants