Commit 2c86574b authored by Zack Galbreath's avatar Zack Galbreath
Browse files

use SetMaxDiscreteValues for categorical color map

Use the new function vtkAbstractArray::SetMaxDiscreteValues within
vtkTreeHeatmapItem.  This allows us to properly color categorical
datasets that contain more than 32 distinct values.

Within this commit, we also change the color set that we're using for
the categorical color map.  The accent set is pretty, but it only has
8 different values.  Instead we'll use qualitative set3 because it
has 12 values.

Finally, we fix a bug in vtkTreeHeatmapItem so that our NaN color
(grey) is used appropriately by our categorical lookup table.

Change-Id: I53bc9f13240be8c0c10b5dbc77bdcca1ea0fa2a1
parent 02ffb7ac
......@@ -534,6 +534,7 @@ void vtkTreeHeatmapItem::AccumulateProminentCategoricalDataValues(vtkIdType colu
// add each distinct value from this column to our master list
vtkNew<vtkVariantArray> distinctValues;
stringColumn->SetMaxDiscreteValues(stringColumn->GetNumberOfTuples() - 1);
stringColumn->GetProminentComponentValues(0, distinctValues.GetPointer());
for (int i = 0; i < distinctValues->GetNumberOfTuples(); ++i)
......@@ -549,8 +550,8 @@ void vtkTreeHeatmapItem::AccumulateProminentCategoricalDataValues(vtkIdType colu
void vtkTreeHeatmapItem::GenerateCategoricalDataLookupTable()
this->ContinuousDataLookupTable->SetNanColor(0.75, 0.75, 0.75, 1.0);
this->CategoricalDataLookupTable->SetNanColor(0.75, 0.75, 0.75, 1.0);
// make each distinct categorical value an index into our lookup table
for (int i = 0; i < this->CategoricalDataValues->GetNumberOfTuples(); ++i)
......@@ -561,7 +562,7 @@ void vtkTreeHeatmapItem::GenerateCategoricalDataLookupTable()
vtkNew<vtkColorSeries> colorSeries;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment