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 Paired T-Test plugin #19563

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,25 @@
"name": "@superset-ui/legacy-plugin-chart-paired-t-test",
"version": "0.18.25",
"description": "Superset Legacy Chart - Paired T Test",
"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": {
"distributions": "^1.0.0",
"prop-types": "^15.6.2",
Expand All @@ -36,5 +30,8 @@
"@superset-ui/chart-controls": "*",
"@superset-ui/core": "*",
"react": "^15 || ^16"
},
"publishConfig": {
"access": "public"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/* eslint-disable react/no-array-index-key */
import PropTypes from 'prop-types';
import React from 'react';
import { styled } from '@superset-ui/core';
import TTestTable, { dataPropType } from './TTestTable';
import './PairedTTest.css';

const propTypes = {
alpha: PropTypes.number,
Expand All @@ -39,29 +39,103 @@ const defaultProps = {
pValPrec: 6,
};

const StyledDiv = styled.div`
${({ theme }) => `
.superset-legacy-chart-paired_ttest .scrollbar-container {
overflow: auto;
}

.paired-ttest-table .scrollbar-content {
padding-left: ${theme.gridUnit}px;
padding-right: ${theme.gridUnit}px;
margin-bottom: 0;
}

.paired-ttest-table table {
margin-bottom: 0;
}

.paired-ttest-table h1 {
margin-left: ${theme.gridUnit}px;
}

.reactable-data tr,
.reactable-header-sortable {
-webkit-transition: ease-in-out 0.1s;
transition: ease-in-out 0.1s;
}

.reactable-data tr:hover {
background-color: ${theme.colors.grayscale.light3};
}

.reactable-data tr .false {
color: ${theme.colors.error.base};
}

.reactable-data tr .true {
color: ${theme.colors.success.base};
}

.reactable-data tr .control {
color: ${theme.colors.primary.base};
}

.reactable-data tr .invalid {
color: ${theme.colors.warning.base};
}

.reactable-data .control td {
background-color: ${theme.colors.grayscale.light3};
}

.reactable-header-sortable:hover,
.reactable-header-sortable:focus,
.reactable-header-sort-asc,
.reactable-header-sort-desc {
background-color: ${theme.colors.grayscale.light3};
position: relative;
}

.reactable-header-sort-asc:after {
content: '\\25bc';
position: absolute;
right: ${theme.gridUnit * 3}px;
}

.reactable-header-sort-desc:after {
content: '\\25b2';
position: absolute;
right: ${theme.gridUnit * 3}px;
}
`}
`;

class PairedTTest extends React.PureComponent {
render() {
const { className, metrics, groups, data, alpha, pValPrec, liftValPrec } =
this.props;

return (
<div className={`superset-legacy-chart-paired-t-test ${className}`}>
<div className="paired-ttest-table">
<div className="scrollbar-content">
{metrics.map((metric, i) => (
<TTestTable
key={i}
metric={metric}
groups={groups}
data={data[metric]}
alpha={alpha}
pValPrec={Math.min(pValPrec, 32)}
liftValPrec={Math.min(liftValPrec, 32)}
/>
))}
<StyledDiv>
<div className={`superset-legacy-chart-paired-t-test ${className}`}>
<div className="paired-ttest-table">
<div className="scrollbar-content">
{metrics.map((metric, i) => (
<TTestTable
key={i}
metric={metric}
groups={groups}
data={data[metric]}
alpha={alpha}
pValPrec={Math.min(pValPrec, 32)}
liftValPrec={Math.min(liftValPrec, 32)}
/>
))}
</div>
</div>
</div>
</div>
</StyledDiv>
);
}
}
Expand Down