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

Commit

Permalink
feat: update line chart thumbnail and scale extraction (#61)
Browse files Browse the repository at this point in the history
* feat: update line chart thumbnail

* fix: lint
  • Loading branch information
kristw committed Apr 12, 2019
1 parent 47c6c19 commit 11ef47e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { EncodingFromChannelsAndOutputs } from '../encodeable/types/Channel';
// See more details from
// https://github.com/Microsoft/TypeScript/issues/20195
// https://github.com/Microsoft/TypeScript/pull/29510
const channelTypes = new class Channels {
const channelTypes = new (class Channels {
readonly x = 'X';
readonly y = 'Y';
readonly color = 'Color';
readonly fill = 'Category';
readonly strokeDasharray = 'Category';
}();
})();

export type ChannelTypes = typeof channelTypes;

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ export function deriveScaleTypeFromDataTypeAndChannelType(
return undefined;
} else if (dataType === 'nominal' || dataType === 'ordinal') {
switch (channelType) {
// For positional (x and y) ordinal and ordinal fields,
// "point" is the default scale type for all marks
// except bar and rect marks, which use "band" scales.
// https://vega.github.io/vega-lite/docs/scale.html
case 'XBand':
case 'YBand':
return ScaleType.POINT;
return ScaleType.BAND;
case 'X':
case 'Y':
case 'Numeric':
Expand Down

0 comments on commit 11ef47e

Please sign in to comment.