Skip to content

Commit

Permalink
chore(chart-sankey): use emotion styling typography (apache#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdotson authored and zhaoyongjie committed Nov 24, 2021
1 parent cd40b3b commit c746ffc
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
},
"dependencies": {
"d3": "^3.5.17",
"d3-sankey": "^0.4.2",
"prop-types": "^15.6.2"
"d3-sankey": "^0.4.2"
},
"peerDependencies": {
"@superset-ui/style": "^0.14.3",
"@superset-ui/chart": "^0.14.0",
"@superset-ui/color": "^0.14.0",
"@superset-ui/number-format": "^0.14.0",
"@superset-ui/translation": "^0.14.0"
"@superset-ui/translation": "^0.14.0",
"prop-types": "^15.6.2",
"react": "^16.13.1"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* 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.
*/
import React from 'react';
import { reactify } from '@superset-ui/chart';
import styled from '@superset-ui/style';
import PropTypes from 'prop-types';
import SanKey from './Sankey';

const ReactSanKey = reactify(SanKey);

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

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

export default styled(SankeyComponent)`
.superset-legacy-chart-sankey {
.node {
rect {
cursor: move;
fill-opacity: 0.9;
shape-rendering: crispEdges;
}
text {
pointer-events: none;
text-shadow: 0 1px 0 #fff;
}
}
.link {
fill: none;
stroke: #000;
stroke-opacity: 0.2;
&:hover {
stroke-opacity: 0.5;
}
}
}
.superset-legacy-chart-sankey-tooltip {
position: absolute;
width: auto;
background: #ddd;
padding: 10px;
font-size: ${({ theme }) => theme.typography.sizes.s};
font-weight: ${({ theme }) => theme.typography.weights.light};
color: #333;
border: 1px solid #fff;
text-align: center;
pointer-events: none;
}
`;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import PropTypes from 'prop-types';
import { sankey as d3Sankey } from 'd3-sankey';
import { CategoricalColorNamespace } from '@superset-ui/color';
import { getNumberFormatter, NumberFormats } from '@superset-ui/number-format';
import './Sankey.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 SankeyChartPlugin extends ChartPlugin {
constructor() {
super({
loadChart: () => import('./ReactSankey.js'),
loadChart: () => import('./ReactSankey'),
metadata,
transformProps,
controlPanel,
Expand Down

0 comments on commit c746ffc

Please sign in to comment.