Skip to content

Commit

Permalink
refactor: use composition package (#104)
Browse files Browse the repository at this point in the history
* refactor: use composition package

* refactor: remove WithLegend and ChartFrame
  • Loading branch information
kristw authored and zhaoyongjie committed Nov 26, 2021
1 parent de4c481 commit 9add9b8
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 263 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@superset-ui/build-config": "^0.0.9",
"@superset-ui/commit-config": "^0.0.9",
"@superset-ui/chart": "^0.11.6",
"@superset-ui/chart-composition": "^0.11.5",
"@superset-ui/color": "^0.11.3",
"@superset-ui/connection": "^0.11.0",
"@superset-ui/core": "^0.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"peerDependencies": {
"@superset-ui/chart": "^0.11.6",
"@superset-ui/chart-composition": "^0.11.5",
"@superset-ui/color": "^0.11.0",
"@superset-ui/connection": "^0.11.0",
"@superset-ui/time-format": "^0.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
},
"peerDependencies": {
"@superset-ui/chart": "^0.11.6",
"@superset-ui/color": "^0.10.0 || ^0.11.0",
"@superset-ui/core": "^0.10.0 || ^0.11.0",
"@superset-ui/dimension": "^0.10.4 || ^0.11.0",
"@superset-ui/number-format": "^0.10.0 || ^0.11.0",
"@superset-ui/time-format": "^0.10.0 || ^0.11.0",
"@superset-ui/translation": "^0.10.0 || ^0.11.0",
"@superset-ui/chart-composition": "^0.11.5",
"@superset-ui/color": "^0.11.0",
"@superset-ui/core": "^0.11.0",
"@superset-ui/dimension": "^0.11.0",
"@superset-ui/number-format": "^0.11.0",
"@superset-ui/time-format": "^0.11.0",
"@superset-ui/translation": "^0.11.0",
"react": "^16.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React from 'react';
import { BoxPlotSeries, XYChart } from '@data-ui/xy-chart';
import { chartTheme, ChartTheme } from '@data-ui/theme';
import { Margin, Dimension } from '@superset-ui/dimension';
import { WithLegend } from '@superset-ui/chart-composition';
import { createSelector } from 'reselect';
import createTooltip from './createTooltip';
import XYChartLayout from '../utils/XYChartLayout';
import WithLegend from '../components/WithLegend';
import ChartLegend from '../components/legend/ChartLegend';
import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder';
import { Dataset, PlainObject } from '../encodeable/types/Data';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isDefined } from '@superset-ui/core';
import React from 'react';
import TooltipFrame from '../components/tooltip/TooltipFrame';
import TooltipTable from '../components/tooltip/TooltipTable';
import { isDefined } from '@superset-ui/core';
import { TooltipFrame, TooltipTable } from '@superset-ui/chart-composition';
import Encoder from './Encoder';
import { BoxPlotDataRow } from './types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-magic-numbers */

import React from 'react';
import { TooltipFrame, TooltipTable } from '@superset-ui/chart-composition';
import { chartTheme } from '@data-ui/theme';
import TooltipFrame from '../components/tooltip/TooltipFrame';
import TooltipTable from '../components/tooltip/TooltipTable';
import { TooltipInput } from './Line';

const MARK_STYLE = { marginRight: 4 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import {
} from '@data-ui/xy-chart';
import { chartTheme } from '@data-ui/theme';
import { Margin, Dimension } from '@superset-ui/dimension';

import { WithLegend } from '@superset-ui/chart-composition';
import { createSelector } from 'reselect';
import XYChartLayout from '../utils/XYChartLayout';
import WithLegend from '../components/WithLegend';
import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder';
import { Dataset, PlainObject } from '../encodeable/types/Data';
import ChartLegend, { Hooks as LegendHooks } from '../components/legend/ChartLegend';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import React, { PureComponent } from 'react';
import { XYChart, PointSeries } from '@data-ui/xy-chart';
import { chartTheme, ChartTheme } from '@data-ui/theme';
import { Margin, Dimension } from '@superset-ui/dimension';
import { WithLegend } from '@superset-ui/chart-composition';
import { extent as d3Extent } from 'd3-array';
import { createSelector } from 'reselect';
import createTooltip from './createTooltip';
import XYChartLayout from '../utils/XYChartLayout';
import WithLegend from '../components/WithLegend';
import Encoder, { ChannelTypes, Encoding, Outputs } from './Encoder';
import { Dataset, PlainObject } from '../encodeable/types/Data';
import ChartLegend from '../components/legend/ChartLegend';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable no-magic-numbers */

import React from 'react';
import TooltipFrame from '../components/tooltip/TooltipFrame';
import TooltipTable from '../components/tooltip/TooltipTable';
import { TooltipFrame, TooltipTable } from '@superset-ui/chart-composition';
import Encoder from './Encoder';
import { isFieldDef } from '../encodeable/types/ChannelDef';
import { EncodedPoint } from './ScatterPlot';
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ 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 { ChartFrame } from '@superset-ui/chart-composition';
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';
Expand Down

0 comments on commit 9add9b8

Please sign in to comment.