GithubHelp home page GithubHelp logo

wbgviz's Issues

wbgdata fails to install on Linux distributions

Something goes wrong when wbgdata is installed on Linux distributions:

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘wbgdata’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Warning in get_wbcache() :
  Countries/series cache is stale - use refresh_wbcache() to update.
Error: package or namespace load failed for ‘wbgdata’:
 .onLoad failed in loadNamespace() for 'wbgdata', details:
  call: NULL
  error: Can't subset columns that don't exist.
✖ Column `regionID` doesn't exist.
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/site-library/wbgdata’

wbgdata does not load, 'cannot subset columns that don't exist'

With R 4.2.2 on 28 February 2023, I see:

Error: package or namespace load failed for 'wbgdata':
 .onLoad failed in loadNamespace() for 'wbgdata', details:
  call: select(., iso3c, region_iso3c = regionID)
  error: Can't subset columns that don't exist.Column `regionID` doesn't exist.
Error: loading failed

wbggeo load fails, 'could not find function "iso.alpha"'

When I try to install with devtools::install_github("worldbank/wbgviz", subdir = "wbggeo"), I see this, which stops it installing or loading:

Error: package or namespace load failed for 'wbggeo':
 .onLoad failed in loadNamespace() for 'wbggeo', details:
  call: iso.alpha(unique(world$region), 3)
  error: could not find function "iso.alpha"

pseudo-CMYK colors in style

CMYK colors work at the moment by specifying the color as cmyk(...) which transforms internally to an rgb color (all R can understand). Then the pdf(colormodel="cmyk") device transforms these rgbs back to cmyk.

This process is a bit lossy as cmyk colors are overspecified (ie. two different cmyk colors can map to the same rgb), but that's not usually a big deal and the resulting PDF looks fine, at least on screen.

A bigger problem is that the rgb colors representing cmyk colors look totally different as rgb colors, for instance if outputting a png. For that reason we have to switch between style_atlas and style_atlas_cmyk as appropriate.

A slightly bigger problem, again, is that the relative luminance and related functions do not work properly for these pseudo-rgb colors, so contrasting text colors are poorly chosen (e.g. white when it should be black, etc). I added the biases parameter to contrasting_colors() to hack around this, but it doesn't really work.

A proper solution would be to have a colormodel parameter in contrast_colors() and co, and calculate it differently (however that is) for pseudo-cmyk colors.

This needs some proper thought though.

Update wbgref$all_geo$labels with accented country names

Some country names in wbgref$all_geo$labels are different than the ones in wbgref$countries$labels, is there are reason why they are different? If not, it would be great to have the updated names in all_geo, especially since it contains economies as well.

list(
CIV = "Côte d\u2019Ivoire",
FRO = "Faeroe Islands",
STP = "São Tomé and Príncipe"
))

wraptextGrob incorrect on single word strings

As a consequence titles, subtitles, etc are affected. This a bug inherited from RGraphics:

RGraphics::splitString("word")
# [1] "word NA word"

The solution is to find / write an entirely new version of this function. Also a good idea since its very slow now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.