Skip to content

Commit

Permalink
chore(chart-worldmap): use emotion style (apache#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdotson authored and zhaoyongjie committed Nov 17, 2021
1 parent 7d047a0 commit 2c8d22d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@superset-ui/chart": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/number-format": "^0.14.0",
"@superset-ui/translation": "^0.14.0"
"@superset-ui/translation": "^0.14.0",
"@superset-ui/style": "^0.14.3",
"react": "^16.13.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,31 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import styled from '@superset-ui/style';
import { reactify } from '@superset-ui/chart';
import WorldMap from './WorldMap';

export default reactify(WorldMap);
const ReactWorldMap = reactify(WorldMap);

const WorldMapComponent = ({ className, ...otherProps }) => {
return (
<div className={className}>
<ReactWorldMap {...otherProps} />
</div>
);
};

WorldMapComponent.propTypes = {
className: PropTypes.string.isRequired,
};

export default styled(WorldMapComponent)`
.superset-legacy-chart-world-map {
position: relative;
svg {
background-color: #feffff;
}
}
`;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import d3 from 'd3';
import PropTypes from 'prop-types';
import Datamap from 'datamaps/dist/datamaps.world.min';
import { getNumberFormatter } from '@superset-ui/number-format';
import './WorldMap.css';

const propTypes = {
data: PropTypes.arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const metadata = new ChartMetadata({
export default class WorldMapChartPlugin extends ChartPlugin {
constructor() {
super({
loadChart: () => import('./ReactWorldMap.js'),
loadChart: () => import('./ReactWorldMap'),
metadata,
transformProps,
controlPanel,
Expand Down

0 comments on commit 2c8d22d

Please sign in to comment.