Skip to content

Commit

Permalink
refactor: Removes the CSS files from the Treemap plugin (apache#19486)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and philipher29 committed Jun 9, 2022
1 parent 36f928e commit 07f12c3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
},
"license": "Apache-2.0",
"author": "Superset",
"sideEffects": [
"*.css"
],
"main": "lib/index.js",
"module": "esm/index.js",
"files": [
Expand All @@ -31,7 +28,8 @@
},
"peerDependencies": {
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*"
"@superset-ui/core": "*",
"react": "^16.13.1"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,36 @@
* specific language governing permissions and limitations
* under the License.
*/
import { reactify } from '@superset-ui/core';
import React from 'react';
import { reactify, styled } from '@superset-ui/core';
import Component from './Treemap';

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

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

export default styled(Treemap)`
${({ theme }) => `
.superset-legacy-chart-treemap text {
font-size: ${theme.typography.sizes.s}px;
pointer-events: none;
}
.superset-legacy-chart-treemap tspan:last-child {
font-size: ${theme.typography.sizes.xs}px;
fill-opacity: 0.8;
}
.superset-legacy-chart-treemap .node rect {
shape-rendering: crispEdges;
}
.superset-legacy-chart-treemap .node--hover rect {
stroke: ${theme.colors.grayscale.dark2};
}
`}
`;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
getNumberFormatter,
CategoricalColorNamespace,
} from '@superset-ui/core';
import './Treemap.css';

// Declare PropTypes for recursive data structures
// https://github.com/facebook/react/issues/5676
Expand Down

0 comments on commit 07f12c3

Please sign in to comment.