Skip to content

Commit

Permalink
Use humanized formatting in TDD when formatting not defined (#6217)
Browse files Browse the repository at this point in the history
  • Loading branch information
djbarnwal authored Dec 5, 2024
1 parent fbda995 commit d8ae537
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@
/** Formatter for the time axis in the table*/
export let timeFormatter: (date: Date) => string;
/***
* In case there is no format defined, use the big num context
* so that the values are within bounds of the column. This is
* naive solution which should be removed later once we move to pivot
* UI.
*/
$: hasNoFormatting = !measure.formatD3 && measure.formatPreset === "";
$: formatter = createMeasureValueFormatter<null | undefined>(
measure,
hasNoFormatting ? "big-number" : "table",
);
const dispatch = createEventDispatcher();
let pivot;
Expand Down Expand Up @@ -373,8 +386,6 @@
$: cssVarStyles = `--cursor: ${
comparing === "dimension" ? "pointer" : "default"
}`;
$: formatter = createMeasureValueFormatter<null | undefined>(measure);
</script>

<div
Expand Down

1 comment on commit d8ae537

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.