Skip to content

Commit

Permalink
Merge pull request #432 from deneb-viz/bugfix/tooltip-casting-error
Browse files Browse the repository at this point in the history
fix: numeric test error when evaluating tooltip fields (#429)
  • Loading branch information
dm-p authored Apr 30, 2024
2 parents fe3b7b0 + 35a5fd9 commit 9d34bf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/features/interactivity/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ const getDeepRedactedTooltipItem = (object: object) => {
*/
const getFieldsEligibleForAutoFormat = (tooltip: object) =>
pickBy(tooltip, (v, k) => {
const ttKeys = keys(tooltip),
mdKeys = keys(getDatasetFieldsBySelectionKeys(ttKeys));
return indexOf(mdKeys, k) > -1 && toNumber(tooltip[k]);
const ttKeys = keys(tooltip);
const fields = getDatasetFieldsBySelectionKeys(ttKeys);
const mdKeys = keys(fields);
const isNumeric = fields[k]?.type?.numeric || false;
return indexOf(mdKeys, k) > -1 && isNumeric;
});

/**
Expand Down

0 comments on commit 9d34bf5

Please sign in to comment.