pywwt
pywwt copied to clipboard
Color-coding of points in layers
Similar to #137, it would be nice to be able to be able to define the color-coding of points in layers by specifying a column (currently colorMapColumn) but also colorMapMin and colorMapMax such that:
colorFloat = (parseFloat(row[this.colorMapColumn]) - this.colorMapMin) / (this.colorMapMax - this.colorMapMin);
and then colorFloat would get mapped to a colormap. Until this is present in the JS, we will need to do this in Python and then update the data every time colorMapMin and colorMapMax are changed.
Just for the record, this is how WWT currently handles layer colors:
switch (this.get__colorMap()) {
case 0:
pointColor = colorLocal;
break;
case 3:
if (this.get_colorMapColumn() > -1) {
pointColor = this._parseColor$1(row[this.get_colorMapColumn()], colorLocal);
}
else {
pointColor = colorLocal;
}
break;
default:
break;
}
So for now we need to include a column with the list of colors (one for each point).