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 Apr 4, 2022
1 parent 4730802 commit 82a653f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 58 deletions.
36 changes: 17 additions & 19 deletions superset-frontend/plugins/legacy-plugin-chart-treemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,36 @@
"name": "@superset-ui/legacy-plugin-chart-treemap",
"version": "0.18.25",
"description": "Superset Legacy Chart - Treemap",
"sideEffects": [
"*.css"
],
"main": "lib/index.js",
"module": "esm/index.js",
"files": [
"esm",
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/apache-superset/superset-ui.git"
},
"keywords": [
"superset"
],
"author": "Superset",
"license": "Apache-2.0",
"homepage": "https://github.com/apache-superset/superset-ui#readme",
"bugs": {
"url": "https://github.com/apache-superset/superset-ui/issues"
},
"homepage": "https://github.com/apache-superset/superset-ui#readme",
"publishConfig": {
"access": "public"
"repository": {
"type": "git",
"url": "git+https://github.com/apache-superset/superset-ui.git"
},
"license": "Apache-2.0",
"author": "Superset",
"main": "lib/index.js",
"module": "esm/index.js",
"files": [
"esm",
"lib"
],
"dependencies": {
"d3-hierarchy": "^1.1.8",
"d3-selection": "^1.4.0",
"prop-types": "^15.6.2"
},
"peerDependencies": {
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*"
"@superset-ui/core": "*",
"react": "^16.13.1"
},
"publishConfig": {
"access": "public"
}
}
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 82a653f

Please sign in to comment.