Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

feat(encodable): implement axis functions for ChannelEncoder #247

Merged
merged 8 commits into from
Nov 15, 2019

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Nov 13, 2019

🏆 Enhancements

  • Add function for getting axis title, tick labels.

@kristw kristw requested a review from a team as a code owner November 13, 2019 01:38
@codecov
Copy link

codecov bot commented Nov 13, 2019

Codecov Report

Merging #247 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #247   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files         147    148    +1     
  Lines        1619   1636   +17     
  Branches      427    434    +7     
=====================================
+ Hits         1619   1636   +17
Impacted Files Coverage Δ
...i-encodable/src/parsers/parseDateTimeIfPossible.ts 100% <ø> (ø) ⬆️
...et-ui-encodable/src/encoders/ChannelEncoderAxis.ts 100% <100%> (ø)
...perset-ui-encodable/src/encoders/ChannelEncoder.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6eb0b52...b647bab. Read the comment docs.

@netlify
Copy link

netlify bot commented Nov 13, 2019

Deploy preview for superset-ui ready!

Built with commit b647bab

https://deploy-preview-247--superset-ui.netlify.com

import { ChannelType, ChannelInput } from '../types/Channel';
import { PlainObject, Dataset } from '../types/Data';
import { ChannelDef } from '../types/ChannelDef';
import { Value } from '../types/VegaLite';
Copy link
Contributor Author

@kristw kristw Nov 13, 2019

Choose a reason for hiding this comment

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

Just change the imports order

@kristw kristw changed the title feat: implement axis functions for ChannelEncoder feat(encodable): implement axis functions for ChannelEncoder Nov 13, 2019
Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

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

nice! couple small thoughts 🙌

}

hasTitle() {
return this.config.title !== '';
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't quite tell from the PR, can title be undefined or null? could do !!this.config.title

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is CompleteAxisConfig which guarantees title will be string.


if (typeof values !== 'undefined') {
return (values as (
| number
Copy link
Contributor

Choose a reason for hiding this comment

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

could make a separate type (or re-use the config.values type?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to use util inferElementTypeFromUnionOfArrayTypes

@kristw kristw merged commit 2cf401b into master Nov 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the kristw--axis branch November 15, 2019 00:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants