Skip to content
Snippets Groups Projects
user avatar
adam-james authored
* Column settings correct keys. Show Axes labels logic defaults 'true'

These are two small changes related to static viz column formatting.

The show axes labels logic change fixes a faulty assumption from an earlier PR where it was assumed that if
:labels_enabled key was NOT present, then it was 'false'. The default however, is 'true', so the check had to change
to reflect the frontend.

Column settings have to be formatted so that the js code running in the backend looks in the right places. For
example, `:number-format` must become `:number_format`. I move the function that does that change up so that it can be
rolled up into `settings-from-column` to reduce the number of call sites for `update-col-for-js`.

* Adjust number format fn to consider :decimal_digits of currencies

* Simpler date-separator fix

* Prevent non-temporal labels from being passed to datetime formatter

* Table Temporal format columns are improved

The column headers will now be properly looked up, the key format was incorrect before, causing the `:column_title`
lookup to return nil, which ignores when a user changes the column name.

Table columns with temporal formatting settings come in with `:unit` `:default`, so that case was added to the
datetime formatter. Additionally, a helper function was added to pull the correct column viz settings to pass to the datetime.

* Change some table rendering to look for '_' keys instead of '-'

And also allow the field-id to take the form `[:field-id 10 nil]` OR `[:field-id 10]`

* Added test utils for static-viz rendering. Docstrings for details.

A big set of functions to enable cleaner static-viz rendering tests.

Next push will be thorough table tests, and some other static viz cleanup

* Add some viz-scenarios to help with table testing

* Lint

* Wrong map here

* Currently unused bindings

* Writing tests with render-test utils now, and catching new bugs

* Use column's field ref to maybe get the column settings

* Adjustments so that column-settings are properly grabbed

* Number formatter no longer assumes decimal places

The frontend will only display decimal places when strictly necessary OR when the column formatting dictates the
number of decimal places to show.

The number formatter on the backend made different assumptions about decimal places, so precision may be lost OR
needlessly displayed.

The formatter now checks the actual value passed in and adjusts the format string according to the decimal places
present in the value, not just via column-settings, though the column settings will still take priority.

* Shame on me. inline def is not needed here :/

* Adjust number format tests to assert that now we match FE behavior

* Really trying to get formatting buttoned up.

* Matching frontend's default format behavior for numbers

* Some tests failed because they assumed two decimal places always

* Values less than one still round after 2 sig-figs

* Column formatting on tables follows expected default behavior

* Getting public-settings included in number and datetime formatters

* Test for custom formatting public settings

* Removed unused require.

* address some PR feedback

* Try to clarify the logic in the number formatter

* Add some clarifying comments

* Use the existing viz tools to help create field-refs properly

* Cleaned up column-name impl. to use normed field-refs. Much nicer!

* Remove some unnecessary tests, and add a negative scientific num

* Simplify table columns test

* Simplify and add more format settings to column-formatting test

* Unused require

* Another one

* Fix format of column refs in test

* Remove unused thread
d1c61272
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..
src
test/dev