Skip to content

Commit

Permalink
chore: calender chart typography (apache#561)
Browse files Browse the repository at this point in the history
* Not a component

* swith to emotion styled

* add proptypes to pass unit test

* fix

* fix: packackage.js

* Update Calendar.js
  • Loading branch information
pkdotson authored and zhaoyongjie committed Nov 24, 2021
1 parent 3d42fba commit a4dc828
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
"prop-types": "^15.6.2"
},
"peerDependencies": {
"react": "^16.13.1",
"@superset-ui/chart": "^0.13.0",
"@superset-ui/color": "^0.13.0",
"@superset-ui/control-utils": "^0.13.3",
"@superset-ui/number-format": "^0.13.0",
"@superset-ui/time-format": "^0.13.0",
"@superset-ui/translation": "^0.13.0",
"@superset-ui/style": "^0.13.21",
"@superset-ui/validator": "^0.13.3"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { getNumberFormatter } from '@superset-ui/number-format';
import { getTimeFormatter } from '@superset-ui/time-format';
import CalHeatMap from './vendor/cal-heatmap';
import './vendor/cal-heatmap.css';
import './Calendar.css';

function convertUTC(dttm) {
return new Date(
Expand Down Expand Up @@ -124,7 +123,6 @@ function Calendar(element, props) {
const legendColors = legend.map(x => colorScale(x));

const cal = new CalHeatMap();

cal.init({
start: convertUTCTS(data.start),
data: timestamps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,40 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import { reactify } from '@superset-ui/chart';
import styled from '@superset-ui/style';
import Component from './Calendar';

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

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

Calender.defaultProps = {
otherProps: {},
};

Calender.propTypes = {
className: PropTypes.string.isRequired,
otherProps: PropTypes.objectOf(PropTypes.any),
};

export default styled(Calender)`
.superset-legacy-chart-calendar {
padding: 10px;
position: static !important;
overflow: auto !important;
}
.superset-legacy-chart-calendar .ch-tooltip {
margin-left: 20px;
margin-top: 5px;
}
`;

0 comments on commit a4dc828

Please sign in to comment.