add emotion styling to chord (#578)

This commit is contained in:
Phillip Kelley-Dotson 2020-06-12 06:56:34 -07:00 committed by Yongjie Zhao
parent 2d317774d6
commit 297343ec6e
4 changed files with 41 additions and 39 deletions

View File

@ -28,8 +28,10 @@
"access": "public"
},
"dependencies": {
"@superset-ui/style": "^0.13.26",
"d3": "^3.5.17",
"prop-types": "^15.6.2"
"prop-types": "^15.6.2",
"react": "^16.13.1"
},
"peerDependencies": {
"@superset-ui/chart": "^0.13.0",

View File

@ -1,36 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
.superset-legacy-chart-chord svg #circle circle {
fill: none;
pointer-events: all;
}
.superset-legacy-chart-chord svg .group path {
fill-opacity: 0.6;
}
.superset-legacy-chart-chord svg path.chord {
stroke: #000;
stroke-width: 0.25px;
}
.superset-legacy-chart-chord svg #circle:hover path.fade {
opacity: 0.2;
}

View File

@ -21,7 +21,6 @@ import d3 from 'd3';
import PropTypes from 'prop-types';
import { CategoricalColorNamespace } from '@superset-ui/color';
import { getNumberFormatter } from '@superset-ui/number-format';
import './Chord.css';
const propTypes = {
data: PropTypes.shape({

View File

@ -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 './Chord';
export default reactify(Component);
const ReactComponent = reactify(Component);
const Chord = ({ className, ...otherProps }) => {
return (
<div className={className}>
<ReactComponent {...otherProps} />
</div>
);
};
Chord.defaultProps = {
otherProps: {},
};
Chord.propTypes = {
className: PropTypes.string.isRequired,
otherProps: PropTypes.objectOf(PropTypes.any),
};
export default styled(Chord)`
.superset-legacy-chart-chord svg #circle circle {
fill: none;
pointer-events: all;
}
.superset-legacy-chart-chord svg .group path {
fill-opacity: 0.6;
}
.superset-legacy-chart-chord svg path.chord {
stroke: #000;
stroke-width: 0.25px;
}
.superset-legacy-chart-chord svg #circle:hover path.fade {
opacity: 0.2;
}
`;