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

Commit

Permalink
refactor: move superset-ui/dimension to core
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Aug 11, 2020
1 parent 0332c35 commit 87fec32
Show file tree
Hide file tree
Showing 50 changed files with 17 additions and 134 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Current master: https://superset-ui.now.sh/
| [@superset-ui/chart-composition](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-chart-composition) | [![Version](https://img.shields.io/npm/v/@superset-ui/chart-composition.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/chart-composition.svg?style=flat-square) |
| [@superset-ui/color](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-color) | [![Version](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/color.svg?style=flat-square) |
| [@superset-ui/core](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-core) | [![Version](https://img.shields.io/npm/v/@superset-ui/core.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/core.svg?style=flat-square) |
| [@superset-ui/dimension](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-dimension) | [![Version](https://img.shields.io/npm/v/@superset-ui/dimension.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/dimension.svg?style=flat-square) |
| [@superset-ui/generator-superset](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-generator-superset) | [![Version](https://img.shields.io/npm/v/@superset-ui/generator-superset.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/generator-superset.svg?style=flat-square) |
| [@superset-ui/number-format](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-number-format) | [![Version](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/number-format.svg?style=flat-square) |
| [@superset-ui/style](https://github.com/apache-superset/superset-ui/tree/master/packages/superset-ui-style) | [![Version](https://img.shields.io/npm/v/@superset-ui/style.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/style.svg?style=flat-square) |
Expand Down
1 change: 0 additions & 1 deletion packages/superset-ui-chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@types/react-loadable": "^5.4.2",
"@vx/responsive": "^0.0.197",
"@superset-ui/core": "^0.15.0",
"@superset-ui/dimension": "^0.14.0",
"prop-types": "^15.6.2",
"react-error-boundary": "^1.2.5",
"react-loadable": "^5.5.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/superset-ui-chart/src/components/SuperChart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode } from 'react';
import ErrorBoundary, { ErrorBoundaryProps, FallbackProps } from 'react-error-boundary';
import { parseLength, Dimension } from '@superset-ui/dimension';
import { parseLength, Dimension } from '@superset-ui/core';
import { ParentSize } from '@vx/responsive';
import { createSelector } from 'reselect';
import SuperChartCore, { Props as SuperChartCoreProps } from './SuperChartCore';
Expand Down Expand Up @@ -127,7 +127,6 @@ export default class SuperChart extends React.PureComponent<Props, {}> {
if (
queryData == null ||
queryData.data === null ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
(Array.isArray(queryData.data) && queryData.data.length === 0)
) {
chart = <NoResultsComponent id={id} className={className} height={height} width={width} />;
Expand Down
3 changes: 0 additions & 3 deletions packages/superset-ui-chart/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"references": [
{
"path": "../superset-ui-core"
},
{
"path": "../superset-ui-dimension"
}
]
}
1 change: 1 addition & 0 deletions packages/superset-ui-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ export * from './connection';
export * from './query';
export * from './number-format';
export * from './time-format';
export * from './dimension';
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { promiseTimeout } from '@superset-ui/core';
import { getTextDimension } from '../src';
import { promiseTimeout, getTextDimension } from '@superset-ui/core/src';
import { addDummyFill, removeDummyFill, SAMPLE_TEXT } from './getBBoxDummyFill';

describe('getTextDimension(input)', () => {
Expand Down
23 changes: 0 additions & 23 deletions packages/superset-ui-dimension/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions packages/superset-ui-dimension/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions packages/superset-ui-dimension/test/tsconfig.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/superset-ui-dimension/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion plugins/legacy-plugin-chart-time-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@superset-ui/chart-controls": "^0.14.3",
"@superset-ui/color": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/dimension": "^0.14.0",
"@superset-ui/style": "^0.14.0",
"@superset-ui/validator": "^0.14.0",
"@types/d3-scale": "^2.0.2",
Expand Down
4 changes: 1 addition & 3 deletions plugins/legacy-plugin-chart-time-table/src/SparklineCell.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/forbid-prop-types */
/* eslint-disable class-methods-use-this */
/**
* Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -27,8 +26,7 @@ import {
VerticalReferenceLine,
WithTooltip,
} from '@data-ui/sparkline';
import { formatNumber } from '@superset-ui/core';
import { getTextDimension } from '@superset-ui/dimension';
import { getTextDimension, formatNumber } from '@superset-ui/core';

interface Props {
ariaLabel: string;
Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-plugin-chart-time-table/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-dimension"
},
{
"path": "../../packages/superset-ui-style"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/legacy-preset-chart-big-number/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/color": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/dimension": "^0.14.0",
"@superset-ui/style": "^0.14.0",
"@types/d3-color": "^1.2.2",
"@types/shortid": "^0.0.29",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import {
NumberFormatter,
smartDateVerboseFormatter,
TimeFormatter,
computeMaxFontSize,
} from '@superset-ui/core';
import { XYChart, AreaSeries, CrossHair, LinearGradient } from '@data-ui/xy-chart';
import { BRAND_COLOR } from '@superset-ui/color';
import { computeMaxFontSize } from '@superset-ui/dimension';

import styled from '@superset-ui/style';

Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-preset-chart-big-number/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-dimension"
},
{
"path": "../../packages/superset-ui-style"
}
Expand Down
1 change: 0 additions & 1 deletion plugins/legacy-preset-chart-nvd3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/color": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/dimension": "^0.14.0",
"@superset-ui/validator": "^0.14.0",
"d3": "^3.5.17",
"d3-tip": "^0.9.1",
Expand Down
3 changes: 0 additions & 3 deletions plugins/legacy-preset-chart-nvd3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-dimension"
},
{
"path": "../../packages/superset-ui-validator"
}
Expand Down
2 changes: 1 addition & 1 deletion temporary-plugins/preset-chart-xy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/color": "^0.14.0",
"@superset-ui/core": "^0.15.0",
"@superset-ui/dimension": "^0.14.0",
"@superset-ui/core": "^0.14.0",
"@data-ui/theme": "^0.0.84",
"@data-ui/xy-chart": "^0.0.84",
"@vx/axis": "^0.0.198",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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 { Margin, Dimension } from '@superset-ui/core';
import { WithLegend } from '@superset-ui/chart-composition';
import { Dataset, PlainObject, isFieldDef } from 'encodable';
import DefaultTooltipRenderer from './DefaultTooltipRenderer';
Expand Down Expand Up @@ -85,9 +85,9 @@ export default class BoxPlot extends React.PureComponent<Props> {
<TooltipRenderer datum={datum} color={color} encoder={encoder} />
)}
theme={theme}
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)}
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)}
>
{layout.renderXAxis()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
WithTooltip,
} from '@data-ui/xy-chart';
import { chartTheme } from '@data-ui/theme';
import { Margin, Dimension } from '@superset-ui/dimension';
import { Margin, Dimension } from '@superset-ui/core';
import { WithLegend } from '@superset-ui/chart-composition';
import { createSelector } from 'reselect';
import { Dataset, PlainObject } from 'encodable';
Expand Down Expand Up @@ -240,9 +240,9 @@ export default class LineChart extends PureComponent<Props> {
renderTooltip={null}
theme={theme}
tooltipData={tooltipData}
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
xScale={convertScaleToDataUIScale(channels.x.definition.scale as any)}
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
yScale={convertScaleToDataUIScale(channels.y.definition.scale as any)}
onMouseMove={onMouseMove}
onMouseLeave={onMouseLeave}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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 { Margin, Dimension } from '@superset-ui/core';
import { WithLegend } from '@superset-ui/chart-composition';
import { isFieldDef, Dataset, PlainObject } from 'encodable';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode, CSSProperties } from 'react';
import { XAxis, YAxis } from '@data-ui/xy-chart';
import { Margin, mergeMargin, Dimension } from '@superset-ui/dimension';
import { Margin, mergeMargin, Dimension } from '@superset-ui/core';
import { ChartFrame } from '@superset-ui/chart-composition';
import { ChannelEncoder, PlainObject, Value, XFieldDef, YFieldDef } from 'encodable';
import createTickComponent from './createTickComponent';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CSSProperties } from 'react';
import { getTextDimension, Margin, Dimension } from '@superset-ui/dimension';
import { getTextDimension, Margin, Dimension } from '@superset-ui/core';
import { AxisOrient, ChannelDef, Value } from 'encodable';

import ChannelEncoderAxis from 'encodable/lib/encoders/ChannelEncoderAxis';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSelector } from 'reselect';
import { Margin } from '@superset-ui/dimension';
import { Margin } from '@superset-ui/core';

export const DEFAULT_MARGIN = { bottom: 16, left: 16, right: 16, top: 16 };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { CSSProperties } from 'react';
import { Dimension } from '@superset-ui/dimension';
import { Dimension } from '@superset-ui/core';
import { AxisLayout } from './computeAxisLayout';

export default function createTickComponent({
Expand Down
3 changes: 0 additions & 3 deletions temporary-plugins/preset-chart-xy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
},
{
"path": "../../packages/superset-ui-core"
},
{
"path": "../../packages/superset-ui-dimension"
}
]
}
6 changes: 0 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
{
"path": "packages/superset-ui-core/test"
},
{
"path": "packages/superset-ui-dimension"
},
{
"path": "packages/superset-ui-dimension/test"
},
{
"path": "packages/superset-ui-style"
},
Expand Down

0 comments on commit 87fec32

Please sign in to comment.