From 1b4d9117a8b202af9bb21140f9543a2d4c75ea61 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Mon, 1 Apr 2019 15:42:17 -0700 Subject: [PATCH] fix: broken build due to file rename in vega-lite (#37) * fix: change references to vega-lite that broke build * refactor: rename fielddef to channeldef --- .../packages/superset-ui-preset-chart-xy/package.json | 2 +- .../src/components/ChartLegend.tsx | 2 +- .../src/encodeable/AbstractEncoder.ts | 4 ++-- .../superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts | 4 ++-- .../src/encodeable/ChannelEncoder.ts | 4 ++-- .../src/encodeable/parsers/extractFormat.ts | 2 +- .../src/encodeable/parsers/extractGetter.ts | 2 +- .../src/encodeable/parsers/extractScale.ts | 4 ++-- .../src/encodeable/types/Channel.ts | 4 ++-- .../src/encodeable/types/{FieldDef.ts => ChannelDef.ts} | 2 +- .../superset-ui-preset-chart-xy/src/encodeable/types/Scale.ts | 2 +- .../superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) rename superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/{FieldDef.ts => ChannelDef.ts} (97%) diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/package.json b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/package.json index 0abed41b5c6fa..88c60209f33cb 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/package.json +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/package.json @@ -43,7 +43,7 @@ "prop-types": "^15.6.2", "reselect": "^4.0.0", "vega": "^5.2.0", - "vega-lite": "^3.0.0-rc15" + "vega-lite": "^3.1.0" }, "peerDependencies": { "@superset-ui/chart": "^0.10.2", diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/components/ChartLegend.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/components/ChartLegend.tsx index 0658a76850e1c..fb288ce83215d 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/components/ChartLegend.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/components/ChartLegend.tsx @@ -1,7 +1,7 @@ import React, { CSSProperties, PureComponent } from 'react'; import { scaleOrdinal } from '@vx/scale'; import { LegendOrdinal, LegendItem, LegendLabel } from '@vx/legend'; -import { Value } from 'vega-lite/build/src/fielddef'; +import { Value } from 'vega-lite/build/src/channeldef'; import AbstractEncoder from '../encodeable/AbstractEncoder'; import { Dataset } from '../encodeable/types/Data'; import { ObjectWithKeysFromAndValueType } from '../encodeable/types/Base'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts index 4be464c0097b8..c30451c13bb6e 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AbstractEncoder.ts @@ -1,8 +1,8 @@ -import { Value } from 'vega-lite/build/src/fielddef'; +import { Value } from 'vega-lite/build/src/channeldef'; import { ObjectWithKeysFromAndValueType } from './types/Base'; import { ChannelOptions, EncodingFromChannelsAndOutputs, ChannelType } from './types/Channel'; import { FullSpec, BaseOptions, PartialSpec } from './types/Specification'; -import { isFieldDef } from './types/FieldDef'; +import { isFieldDef } from './types/ChannelDef'; import ChannelEncoder from './ChannelEncoder'; export default abstract class AbstractEncoder< diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts index 0c60aeef71a61..5610e44df621c 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/AxisAgent.ts @@ -1,11 +1,11 @@ /* eslint-disable no-magic-numbers */ import { CSSProperties } from 'react'; -import { Value } from 'vega-lite/build/src/fielddef'; +import { Value } from 'vega-lite/build/src/channeldef'; import { getTextDimension } from '@superset-ui/dimension'; import { CategoricalColorScale } from '@superset-ui/color'; import { extractFormatFromTypeAndFormat } from './parsers/extractFormat'; import { CoreAxis, LabelOverlapStrategy } from './types/Axis'; -import { PositionFieldDef, ChannelDef } from './types/FieldDef'; +import { PositionFieldDef, ChannelDef } from './types/ChannelDef'; import ChannelEncoder from './ChannelEncoder'; import { DEFAULT_LABEL_ANGLE } from '../utils/constants'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/ChannelEncoder.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/ChannelEncoder.ts index b2fbb95482a38..e20254d24e43a 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/ChannelEncoder.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/ChannelEncoder.ts @@ -1,4 +1,4 @@ -import { Value } from 'vega-lite/build/src/fielddef'; +import { Value } from 'vega-lite/build/src/channeldef'; import { extractFormatFromChannelDef } from './parsers/extractFormat'; import extractScale, { ScaleAgent } from './parsers/extractScale'; import extractGetter from './parsers/extractGetter'; @@ -11,7 +11,7 @@ import { isValueDef, isFieldDef, isNonValueDef, -} from './types/FieldDef'; +} from './types/ChannelDef'; import isEnabled from './utils/isEnabled'; import isDisabled from './utils/isDisabled'; import identity from './utils/identity'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractFormat.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractFormat.ts index 996bd281d1f1f..ac00a0ef3d8c5 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractFormat.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractFormat.ts @@ -1,7 +1,7 @@ import { getNumberFormatter } from '@superset-ui/number-format'; import { getTimeFormatter } from '@superset-ui/time-format'; import { Type } from 'vega-lite/build/src/type'; -import { isTypedFieldDef, ChannelDef } from '../types/FieldDef'; +import { isTypedFieldDef, ChannelDef } from '../types/ChannelDef'; const fallbackFormatter = (v: any) => `${v}`; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractGetter.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractGetter.ts index a4393327614c9..4690cf7a5b03a 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractGetter.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractGetter.ts @@ -1,5 +1,5 @@ import { get } from 'lodash/fp'; -import { isValueDef, ChannelDef } from '../types/FieldDef'; +import { isValueDef, ChannelDef } from '../types/ChannelDef'; import identity from '../utils/identity'; export default function extractGetter(definition: ChannelDef) { diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractScale.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractScale.ts index 9de493a7e5123..ae342bccee8fe 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractScale.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/parsers/extractScale.ts @@ -23,10 +23,10 @@ import { scalePoint, scaleBand, } from 'd3-scale'; -import { Value } from 'vega-lite/build/src/fielddef'; +import { Value } from 'vega-lite/build/src/channeldef'; import { Type } from 'vega-lite/build/src/type'; import { ScaleType } from 'vega-lite/build/src/scale'; -import { isNonValueDef, ChannelDef } from '../types/FieldDef'; +import { isNonValueDef, ChannelDef } from '../types/ChannelDef'; import isDisabled from '../utils/isDisabled'; import { ChannelType } from '../types/Channel'; import { Scale } from '../types/Scale'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Channel.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Channel.ts index a680d7bb7c476..1c5d79d3f0b9f 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Channel.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Channel.ts @@ -1,5 +1,5 @@ -import { Value } from 'vega-lite/build/src/fielddef'; -import { XFieldDef, YFieldDef, ChannelDef, MarkPropChannelDef, TextChannelDef } from './FieldDef'; +import { Value } from 'vega-lite/build/src/channeldef'; +import { XFieldDef, YFieldDef, ChannelDef, MarkPropChannelDef, TextChannelDef } from './ChannelDef'; import { ObjectWithKeysFromAndValueType } from './Base'; // eslint-disable-next-line import/prefer-default-export diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/FieldDef.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/ChannelDef.ts similarity index 97% rename from superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/FieldDef.ts rename to superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/ChannelDef.ts index 6992f11218a0f..700b67d1a8c47 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/FieldDef.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/ChannelDef.ts @@ -1,5 +1,5 @@ // eslint-disable no-unused-vars -import { ValueDef, Value } from 'vega-lite/build/src/fielddef'; +import { ValueDef, Value } from 'vega-lite/build/src/channeldef'; import { Type } from 'vega-lite/build/src/type'; import { TimeFormatter } from '@superset-ui/time-format'; import { NumberFormatter } from '@superset-ui/number-format'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Scale.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Scale.ts index 6be38497673fb..2f8e58a6b52fa 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Scale.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/encodeable/types/Scale.ts @@ -1,4 +1,4 @@ -import { Value } from 'vega-lite/build/src/fielddef'; +import { Value } from 'vega-lite/build/src/channeldef'; import { DateTime } from 'vega-lite/build/src/datetime'; import { SchemeParams, ScaleType } from 'vega-lite/build/src/scale'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx index fd3f188c4328d..ad89c83bb783a 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/superset-ui-plugins/packages/superset-ui-preset-chart-xy/src/utils/XYChartLayout.tsx @@ -9,7 +9,7 @@ import { AxisOrient } from 'vega'; import createTickComponent from './createTickComponent'; import ChartFrame from '../components/ChartFrame'; import ChannelEncoder from '../encodeable/ChannelEncoder'; -import { XFieldDef, YFieldDef } from '../encodeable/types/FieldDef'; +import { XFieldDef, YFieldDef } from '../encodeable/types/ChannelDef'; import { PlainObject } from '../encodeable/types/Data'; import { DEFAULT_LABEL_ANGLE } from './constants';