Published
Edited
Jan 8, 2021
1 fork
Importers
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
weightsSize(text, weights, width, "black", "magenta", sizeOptions.scale)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
attentionVisualization = (text, weight, mode, options) => {
const defaultOptions = {
width: width,
fontColor: "black",
focusColor: "magenta",
scale: "lineal"
};
options = Object.assign(defaultOptions, options);
if (mode.toLowerCase() == "circle"){
return weightsCircle(text, weight, options.width, options.fontColor, options.focusColor)
}
else if (mode.toLowerCase() == "size"){
return weightsSize(text, weight, options.width, options.fontColor, options.focusColor, options.scale)
}
else if (mode.toLowerCase() == "luminance"){
return weightsLuminance(text, weight, options.width, options.fontColor, options.focusColor)
}
else if (mode.toLowerCase() == "horizontalbar"){
return weightsHorizontalBar(text, weight, options.width, options.fontColor, options.focusColor)
}
else if (mode.toLowerCase() == "backgroundcolor"){
return weightsBackgroundColor(text, weight, options.width, options.fontColor, options.focusColor)
}
return 'Mode must be "circle", "size", "luminance", "horizontalbar" or "backgroundcolor"'

}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more