Currently, vis.js - graph3d only supports one color scheme for color map: blue (lowest value) to red (highest value). It would be nice if various color schemes are natively supported, or -- even better -- if a custom (user-defined) color palette could be supported. For example, Matlab provides native support for a set of colormaps: https://www.mathworks.com/help/matlab/ref/colormap.html
Just in case anyone who might be interested in flipping the color bar to represent values using the opposite notation (i.e., blue being the highest value, red being the lowest value), here is a quick hack to do it (applicable to 'dot-color' or 'bar-color' style charts):
In vis.js,
Around Line 10552, look for Graph3d.prototype._redrawLegend = function() {. Around Line 10590, inside for (y = ymin; y < max; y++) under if (isSizeLegend == false), change var hue = f * 240; to var hue = 240 * (1 - f);
Around Line 11179, look for Graph3d.prototype._getColorsColor = function (point) {. Around Line 11187, change var hue = (1 - (point.point.value ... to var hue = 240 - (1 - (point.point.value ....
Not very clean way, but working solution for me without digging too much into the core code of visjs.
Currently, vis.js - graph3d only supports one color scheme for color map: blue (lowest value) to red (highest value). It would be nice if various color schemes are natively supported, or -- even better -- if a custom (user-defined) color palette could be supported. For example, Matlab provides native support for a set of colormaps: https://www.mathworks.com/help/matlab/ref/colormap.html
Just in case anyone who might be interested in flipping the color bar to represent values using the opposite notation (i.e., blue being the highest value, red being the lowest value), here is a quick hack to do it (applicable to 'dot-color' or 'bar-color' style charts):
In
vis.js
,Graph3d.prototype._redrawLegend = function() {
. Around Line 10590, insidefor (y = ymin; y < max; y++)
underif (isSizeLegend == false)
, changevar hue = f * 240;
tovar hue = 240 * (1 - f);
Graph3d.prototype._getColorsColor = function (point) {
. Around Line 11187, changevar hue = (1 - (point.point.value ...
tovar hue = 240 - (1 - (point.point.value ...
.Not very clean way, but working solution for me without digging too much into the core code of visjs.