Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Removes the CSS files from the Treemap plugin #19486

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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