Comments (10)
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
from treemap.
Isn't this already implemented in the argument legend.format
, or do you still miss certain functionalities?
from treemap.
I was having tmap in mind, sorry:)
Indeed, it's not in treemap yet. Please feel free to push a request.
from treemap.
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).
from treemap.
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.
from treemap.
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.
from treemap.
@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.
from treemap.
@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
from treemap.
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
).
from treemap.
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!
from treemap.
Related Issues (20)
- Color for NA
- data.table warning when `vColor = "color", type = "color"` HOT 1
- warning message when type="color" HOT 2
- Treemap doesn't try hard enough to fit text into the last box.
- Enhancement: add strip algorithm HOT 1
- crosstalk?
- click url - tooltip
- fontsize.labels inconsistent
- Bug for legend HOT 1
- Hover treemap in a shinyapp not showing the right values
- treemaps in RStudio / macOS seem to fail
- Warning message when using type="color", not solved in version 2.4-2 HOT 1
- Dynamically Click TreeMap Point
- Legend Reverse Order HOT 1
- Can't install development version HOT 2
- update CRAN package HOT 2
- Is there a way to automatically save my treemap as a simple png in my code? HOT 1
- Installation impossible HOT 1
- CRAN version throws error on color usage HOT 1
- Caption Argument HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from treemap.