Skip to content
This repository has been archived by the owner on Jun 25, 2020. 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 authored Apr 12, 2019
1 parent 3d25911 commit 69a405c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/superset-ui-preset-chart-xy/src/Line/Encoder.ts
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 69a405c

Please sign in to comment.