Skip to content

Commit

Permalink
Show the right implicit empty values in tooltip
Browse files Browse the repository at this point in the history
If you set a nominal or ordinal variable in a scale VariablesList, a tooltip tells you how the values are transformed into scale.
It gives also a list of 'implicit' empty values: that is the not empty values that could not be converted into a double value. This list was not correct, it gave all the convertable values.
  • Loading branch information
boutinb committed Nov 28, 2024
1 parent e3d0b16 commit e96b9e8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions CommonData/column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2372,20 +2372,27 @@ stringvec Column::previewTransform(columnType transformType)
}

{
std::stringstream someEmptyValues;
std::stringstream someImplicitEmptyValues;

if(transformType == columnType::scale && labelsTempCount() > _labelsTempNumerics)
{
int count = 0;

for(Label * label : _labels)
if(!label->isEmptyValue() && count < showThisMany)
someEmptyValues << (count++ > 0 ? ", " : "") << '"' << label->originalValueAsString() << '"';
else if(!label->isEmptyValue() && count++ == showThisMany)
someEmptyValues << ", ...";
{
if(!label->isEmptyValue() && !ColumnUtils::isDoubleValue(label->label()))
{
if(count < showThisMany)
someImplicitEmptyValues << (count++ > 0 ? ", " : "") << '"' << label->originalValueAsString() << '"';
else if(count++ == showThisMany)
someImplicitEmptyValues << ", ...";
else
break; // Do not need to loop further over the labels.
}
}
}

out.push_back(someEmptyValues.str());
out.push_back(someImplicitEmptyValues.str());
}

return out;
Expand Down

0 comments on commit e96b9e8

Please sign in to comment.