Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
fix: disable lazy import for line chart and box plot (#82)
Browse files Browse the repository at this point in the history
* fix: disable lazy import

* fix: lint
  • Loading branch information
kristw authored May 8, 2019
1 parent 067f29b commit 5161e5e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/superset-ui-preset-chart-xy/src/BoxPlot/BoxPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { createSelector } from 'reselect';
import createTooltip from './createTooltip';
import XYChartLayout from '../utils/XYChartLayout';
import WithLegend from '../components/WithLegend';
import ChartLegend from '../components/ChartLegend';
import ChartLegend from '../components/legend/ChartLegend';
import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder';
import { Dataset, PlainObject } from '../encodeable/types/Data';

Expand All @@ -52,6 +52,9 @@ type Props = {
export default class BoxPlot extends React.PureComponent<Props> {
static defaultProps = defaultProps;

encoder: Encoder;
private createEncoder: () => void;

constructor(props: Props) {
super(props);

Expand All @@ -68,9 +71,6 @@ export default class BoxPlot extends React.PureComponent<Props> {
this.renderChart = this.renderChart.bind(this);
}

encoder: Encoder;
private createEncoder: () => void;

renderChart(dim: Dimension) {
const { width, height } = dim;
const { data, encoding, margin, theme } = this.props;
Expand Down
3 changes: 2 additions & 1 deletion packages/superset-ui-preset-chart-xy/src/BoxPlot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import { ChartPlugin } from '@superset-ui/chart';
import createMetadata from './createMetadata';
import transformProps from './transformProps';
import Chart from './BoxPlot';

export default class BoxPlotChartPlugin extends ChartPlugin {
constructor() {
super({
loadChart: () => import('./BoxPlot'),
Chart,
metadata: createMetadata(),
transformProps,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import { ChartPlugin } from '@superset-ui/chart';
import createMetadata from '../createMetadata';
import transformProps from './transformProps';
import Chart from '../BoxPlot';

export default class BoxPlotChartPlugin extends ChartPlugin {
constructor() {
super({
loadChart: () => import('../BoxPlot'),
Chart,
metadata: createMetadata(true),
transformProps,
});
Expand Down
3 changes: 2 additions & 1 deletion packages/superset-ui-preset-chart-xy/src/Line/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import transformProps from './transformProps';
import createMetadata from './createMetadata';
import buildQuery from './buildQuery';
import ChartFormData from './ChartFormData';
import Chart from './Line';

export default class LineChartPlugin extends ChartPlugin<ChartFormData> {
constructor() {
super({
buildQuery,
loadChart: () => import('./Line'),
Chart,
metadata: createMetadata(),
transformProps,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ChartPlugin } from '@superset-ui/chart';
import transformProps from './transformProps';
import createMetadata from '../createMetadata';
import Chart from '../Line';

export default class LineChartPlugin extends ChartPlugin {
constructor() {
super({
loadChart: () => import('../Line'),
Chart,
metadata: createMetadata(true),
transformProps,
});
Expand Down

0 comments on commit 5161e5e

Please sign in to comment.