mozilla / looker-ci-line-chart

Mozilla Public License 2.0
1 stars 4 forks source link

Validate X axis field type #11

Closed mikewilli closed 2 years ago

mikewilli commented 2 years ago

We should be able to grab the type from the field object and check if it is date before assuming the X axis field is a date field.

mikewilli commented 2 years ago

I originally was thinking we should allow non-date types for the X axis, but not sure if that is a valid concern. Either way, we should validate the type of the field before just assuming it is a date and converting it to JS Date object.

If we want to allow generic (numeric) fields for the X axis we should be able to do that pretty easily along with this check.