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

chore(react-chart): refactor series #1279

Merged
merged 26 commits into from
Aug 21, 2018

Conversation

alexey-semikozov
Copy link
Contributor

@alexey-semikozov alexey-semikozov commented Jul 31, 2018

BREAKING CHANGES:
Previously, we had the pointComponent property for drawing and customizing LineSeries, SplineSeries, and AreaSeries plugin points. But since we have a scatter series, this property has become unnecessary. Use the ScatterSeries plugin or customize the pathComponent of the corresponding plugin.

fixes #1271

@Krijovnick
Copy link
Contributor

Add subheader 'react-chart' to the PR title, please

@Krijovnick
Copy link
Contributor

The 'point-customization' demo does not display promised feature:
2018-08-01_1422

@alexey-semikozov alexey-semikozov changed the title chore: refactor series chore(react-chart): refactor series Aug 1, 2018
valueField="ru"
argumentField="year"
/>
<AreaSeries
color="black"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to see this colors in this demo?

}) => ({
d: arc()
.innerRadius(0)
.outerRadius(radius)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the 'innerRadius' and 'outerRadius' options do not apply?

const dPoint = symbol().size([size ** 2]).type(symbolCircle)();
const offSet = scales.xScale.bandwidth ? scales.xScale.bandwidth() / 2 : 0;
export const pointAttributes = () => {
const dPoint = symbol().size([DEFAULT_POINT_SIZE ** 2]).type(symbolCircle)();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the doc of the series the 'point.size' option remains. And it looks like BC, that should be described.

@@ -9,137 +9,146 @@ import {
} from 'd3-shape';
import { createScale } from '../../utils/scale';

const getX = ({ x }) => x;
const getX = ({ x, width }) => x + (width / 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that new code no tests

export const findSeriesByName = (name, series) => series.find(
seriesItem => seriesItem.uniqueName === name,
);
export const barCoordinates = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no tests on this method. It is the same with the dArea, dLine, dBar and dSpline methods.

@@ -5,12 +5,11 @@ import classNames from 'classnames';
export class Area extends React.PureComponent {
render() {
const {
x, y, className, pointComponent, pointStyle, coordinates, path, themeColor, ...restProps
className, pointComponent, pointStyle, coordinates, path, color, ...restProps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'pointComponent' property is not needed in the area, line, spline series

const { coordinates } = props;
return (
<React.Fragment>
<LineSeries.Path {...props} coordinates={coordinates.slice(0)} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are extra actions with the coordinates property.

@@ -8,7 +8,6 @@ export class AreaSeries extends React.PureComponent {
return (
<AreaSeriesBase
seriesComponent={Area}
pointComponent={() => null}
{...this.props}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string AreaSeries.Point = Point is not expected there. The same in the material-ui theme in all line series (spline, line, area)

@alexey-semikozov alexey-semikozov merged commit 9634390 into DevExpress:master Aug 21, 2018
@alexey-semikozov alexey-semikozov deleted the refactor-series branch August 21, 2018 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Bar Has Wrong Position
2 participants