Skip to content

Commit

Permalink
chore(chart-forced-directed): use emotion style (apache#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdotson authored and zhaoyongjie committed Nov 17, 2021
1 parent ff4000e commit 7d047a0
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
"access": "public"
},
"dependencies": {
"d3": "^3.5.17",
"prop-types": "^15.6.2"
"d3": "^3.5.17"
},
"peerDependencies": {
"@superset-ui/chart": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/translation": "^0.14.0"
"@superset-ui/style": "^0.14.3",
"@superset-ui/translation": "^0.14.0",
"prop-types": "^15.7.2",
"react": "^16.13.1"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
/* eslint-disable react/sort-prop-types, func-names, no-param-reassign */
import d3 from 'd3';
import PropTypes from 'prop-types';
import './ForceDirected.css';

const propTypes = {
data: PropTypes.arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,44 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { reactify } from '@superset-ui/chart';
import styled from '@superset-ui/style';
import PropTypes from 'prop-types';
import Component from './ForceDirected';

export default reactify(Component);
const ReactComponent = reactify(Component);

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

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

export default styled(ForceDirected)`
.superset-legacy-chart-force-directed {
path.link {
fill: none;
stroke: #000;
stroke-width: 1.5px;
}
circle {
fill: #ccc;
stroke: #000;
stroke-width: 1.5px;
stroke-opacity: 1;
opacity: 0.75;
}
text {
fill: #000;
font: 10px sans-serif;
pointer-events: none;
}
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const metadata = new ChartMetadata({
export default class ForceDirectedChartPlugin extends ChartPlugin {
constructor() {
super({
loadChart: () => import('./ReactForceDirected.js'),
loadChart: () => import('./ReactForceDirected'),
metadata,
transformProps,
controlPanel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"peerDependencies": {
"@superset-ui/chart": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.0",
"@superset-ui/chart-controls": "^0.14.3",
"@superset-ui/number-format": "^0.14.0",
"@superset-ui/translation": "^0.14.0"
}
Expand Down

0 comments on commit 7d047a0

Please sign in to comment.