#Unbelievable clickme d3 straight from R
I deserve no credit for this. Go to clickme for the guy that deserves all the credit. I just simply put it in Gist form for it to show up on bl.ocks.org
#Unbelievable clickme d3 straight from R
I deserve no credit for this. Go to clickme for the guy that deserves all the credit. I just simply put it in Gist form for it to show up on bl.ocks.org
#' Finds the local maxima (peaks) in the given vector after smoothing the data | |
#' with a kernel density estimator. | |
#' | |
#' First, we smooth the data using kernel density estimation (KDE) with the | |
#' \code{\link{density}} function. Then, we find all the local maxima such that | |
#' the density is concave (downward). | |
#' | |
#' Effectively, we find the local maxima with a discrete analogue to a second | |
#' derivative applied to the KDE. For details, see this StackOverflow post: | |
#' \url{http://bit.ly/Zbl7LV}. |
# We first start by creating a way of escaping the characters that have special | |
# meaning for html, while making sure we don't end up double-escaping at any | |
# point. The easiest way to do this is to create an S3 class that allows us to | |
# distinguish between regular text (that needs escaping) and html (that | |
# doesn't). | |
# | |
# We then write an escape method that leaves html unchanged and escapes the | |
# special characters (&, <, >) in ordinary text. We also add a method for lists | |
# for convenience |
[diff "word"] | |
binary = true | |
textconv = docx-to-txt.rb -t |
var Stars = function (props) { | |
var rating = props.rating || 0; // rating from 0 to 5, inclusive, in increments of 0.5 | |
var label = props.label || null; // a label to describe the contents (for accessibility) | |
var src = "./img/stars_" + rating + ".svg"; | |
return <img src={src} width="78" height="13" aria-label={label} data-tooltip={label}/>; | |
}; | |
module.exports = Stars; |