Open aappling-usgs opened 7 years ago
Created two not robust functions that do this: locate_css_class
and locate_css_class_detail
Example use:
css <- readLines("example.css")
state_css <- locate_css_class(css, ".county-polygon")
state_color <- locate_css_class_detail(state_css, "fill")
state_color
[1] "#d1d6d8"
Would be nice to be able to share information between CSS and R plots. One way to do this is to read the CSS into R plotting functions, then use the style info there. Saves us the (arduous?) step of creating a third location for that shared info, especially because we want to be able to experiment quickly with CSS changes.
This feature was proposed by @lindsaycarr during Irma viz. @jread-usgs responded, "the interns created a really amazing way to do that :point_up: which we couldn't get dialed up for this in time, but might be a priority for later"