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

Commit

Permalink
fix: broken build due to vega type (#96)
Browse files Browse the repository at this point in the history
* fix: broken build due to vega type

* fix: remove unused

* fix: type

* fix: margin
  • Loading branch information
kristw committed May 14, 2019
1 parent 1ffeb77 commit 1bcaa7f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable no-magic-numbers */
import { CSSProperties } from 'react';
import { Value } from 'vega-lite/build/src/channeldef';
import { getTextDimension } from '@superset-ui/dimension';
import { getTextDimension, Margin } from '@superset-ui/dimension';
import { CategoricalColorScale } from '@superset-ui/color';
import { extractFormatFromTypeAndFormat } from './parsers/extractFormat';
import { CoreAxis, LabelOverlapStrategy } from './types/Axis';
import { CoreAxis, LabelOverlapStrategy, AxisOrient } from './types/Axis';
import { PositionFieldDef, ChannelDef } from './types/ChannelDef';
import ChannelEncoder from './ChannelEncoder';
import { DEFAULT_LABEL_ANGLE } from '../utils/constants';
Expand Down Expand Up @@ -108,7 +108,14 @@ export default class AxisAgent<Def extends ChannelDef<Output>, Output extends Va
labelAngle?: number;
tickLength: number;
tickTextStyle: CSSProperties;
}) {
}): {
labelAngle: number;
labelOffset: number;
labelOverlap: 'flat' | 'rotate';
minMargin: Partial<Margin>;
orient: AxisOrient;
tickTextAnchor?: string;
} {
const tickLabels = this.getTickLabels();

const labelDimensions = tickLabels.map((text: string) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DateTime } from 'vega-lite/build/src/datetime';
import { AxisOrient } from 'vega';

export type AxisOrient = 'top' | 'bottom' | 'left' | 'right';

export type LabelOverlapStrategy = 'auto' | 'flat' | 'rotate';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import collectScalesFromProps from '@data-ui/xy-chart/esm/utils/collectScalesFro
import { XAxis, YAxis } from '@data-ui/xy-chart';
import { ChartTheme } from '@data-ui/theme';
import { Margin, mergeMargin } from '@superset-ui/dimension';
import { AxisOrient } from 'vega';
import createTickComponent from './createTickComponent';
import ChartFrame from '../components/ChartFrame';
import ChannelEncoder from '../encodeable/ChannelEncoder';
import { AxisOrient } from '../encodeable/types/Axis';
import { XFieldDef, YFieldDef } from '../encodeable/types/ChannelDef';
import { PlainObject } from '../encodeable/types/Data';
import { DEFAULT_LABEL_ANGLE } from './constants';
Expand Down

0 comments on commit 1bcaa7f

Please sign in to comment.