Skip to content

Commit

Permalink
removed label props and used absolute import
Browse files Browse the repository at this point in the history
  • Loading branch information
Conglei Shi committed Nov 15, 2017
1 parent 6fbc442 commit beaa221
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
6 changes: 0 additions & 6 deletions packages/demo/examples/01-xy-chart/StatsSeriesExample.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export function SimpleBoxPlotSeriesExample() {
<YAxis numTicks={4} />
<BoxPlotSeries
data={boxPlotData}
label="Test"
fill="url(#aqua_lightaqua_gradient)"
stroke="#22b8cf"
strokeWidth={1.5}
Expand Down Expand Up @@ -140,7 +139,6 @@ export function SingleBoxPlotSeriesExample() {
/>
<BoxPlotSeries
data={boxPlotData}
label="Test"
fill="url(#aqua_lightaqua_gradient)"
stroke="#22b8cf"
strokeWidth={1.5}
Expand Down Expand Up @@ -192,15 +190,13 @@ export function HorizontalBoxPlotViolinPlotSeriesExample() {
<YAxis numTicks={4} />
<ViolinPlotSeries
data={violinData}
label="Test"
fill="url(#vViolinLines)"
stroke="#22b8cf"
strokeWidth={0.5}
horizontal
/>
<BoxPlotSeries
data={boxPlotData}
label="Test"
fill={colors.categories[0]}
stroke={colors.categories[0]}
widthRatio={0.5}
Expand Down Expand Up @@ -248,14 +244,12 @@ export function BoxPlotViolinPlotSeriesExample() {
<YAxis numTicks={4} />
<ViolinPlotSeries
data={violinData}
label="Test"
fill="url(#hViolinLines)"
stroke="#22b8cf"
strokeWidth={0.5}
/>
<BoxPlotSeries
data={boxPlotData}
label="Test"
fill={colors.categories[0]}
stroke={colors.categories[0]}
widthRatio={0.5}
Expand Down
8 changes: 3 additions & 5 deletions packages/xy-chart/src/series/BoxPlotSeries.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Group } from '@vx/group';
import { BoxPlot } from '@vx/stats';
import Group from '@vx/group/build/Group';
import BoxPlot from '@vx/stats/build/boxplot/BoxPlot';
import themeColors from '@data-ui/theme/build/color';

import { callOrValue, isDefined } from '../utils/chartUtils';
Expand All @@ -10,7 +10,6 @@ import { boxPlotSeriesDataShape } from '../utils/propShapes';

const propTypes = {
data: boxPlotSeriesDataShape.isRequired,
label: PropTypes.string.isRequired,

// attributes on data points will override these
fill: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
Expand Down Expand Up @@ -53,7 +52,6 @@ const outliers = d => d.outliers || [];

export default function BoxPlotSeries({
data,
label,
fill,
stroke,
strokeWidth,
Expand All @@ -78,7 +76,7 @@ export default function BoxPlotSeries({
(((1 - widthRatio) / 2) * actualyWidth),
});
return (
<Group key={label}>
<Group>
{data.map((d, i) => (
isDefined(min(d)) && (
<BoxPlot
Expand Down
8 changes: 3 additions & 5 deletions packages/xy-chart/src/series/ViolinPlotSeries.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Group } from '@vx/group';
import { ViolinPlot } from '@vx/stats';
import Group from '@vx/group/build/Group';
import ViolinPlot from '@vx/stats/build/violinplot/ViolinPlot';
import themeColors from '@data-ui/theme/build/color';

import { callOrValue } from '../utils/chartUtils';
Expand All @@ -11,7 +11,6 @@ import { violinPlotSeriesDataShape } from '../utils/propShapes';

const propTypes = {
data: violinPlotSeriesDataShape.isRequired,
label: PropTypes.string.isRequired,

// attributes on data points will override these
fill: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
Expand Down Expand Up @@ -42,7 +41,6 @@ const y = d => d.y;

export default function ViolinPlotSeries({
data,
label,
fill,
stroke,
strokeWidth,
Expand All @@ -64,7 +62,7 @@ export default function ViolinPlotSeries({
(((1 - widthRatio) / 2) * actualyWidth),
});
return (
<Group key={label}>
<Group>
{data.map((d, i) => (
<ViolinPlot
key={offsetValue(d)}
Expand Down

0 comments on commit beaa221

Please sign in to comment.