Skip to content

Commit

Permalink
fix: remove clippings from chart geometries (#320)
Browse files Browse the repository at this point in the history
fix #20
  • Loading branch information
markov00 authored Aug 21, 2019
1 parent cf00fd9 commit ed6d0e5
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions src/components/react_canvas/reactive_chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,6 @@ class Chart extends React.Component<ReactiveChartProps, ReactiveChartState> {
</div>
);
}
// disable clippings when debugging
const clippings = debug
? {}
: {
clipX: 0,
clipY: 0,
clipWidth: [90, -90].includes(chartRotation) ? chartDimensions.height : chartDimensions.width,
clipHeight: [90, -90].includes(chartRotation) ? chartDimensions.width : chartDimensions.height,
};

let brushProps = {};
const isBrushEnabled = this.props.chartStore!.isBrushEnabled();
Expand All @@ -399,13 +390,6 @@ class Chart extends React.Component<ReactiveChartProps, ReactiveChartState> {
};
}

const layerClippings = {
clipX: chartDimensions.left,
clipY: chartDimensions.top,
clipWidth: chartDimensions.width,
clipHeight: chartDimensions.height,
};

const className = classNames({
'echChart--isBrushEnabled': this.props.chartStore!.isCrosshairCursorVisible.get(),
});
Expand Down Expand Up @@ -443,15 +427,17 @@ class Chart extends React.Component<ReactiveChartProps, ReactiveChartState> {
}}
{...brushProps}
>
<Layer hitGraphEnabled={false} listening={false} {...layerClippings}>
<Layer hitGraphEnabled={false} listening={false}>
{this.renderGrids()}
</Layer>
<Layer hitGraphEnabled={false} listening={false}>
{this.renderAxes()}
</Layer>

<Layer
x={chartDimensions.left + chartTransform.x}
y={chartDimensions.top + chartTransform.y}
rotation={chartRotation}
{...clippings}
hitGraphEnabled={false}
listening={false}
>
Expand All @@ -468,10 +454,6 @@ class Chart extends React.Component<ReactiveChartProps, ReactiveChartState> {
)}

<Layer hitGraphEnabled={false} listening={false}>
{this.renderAxes()}
</Layer>

<Layer hitGraphEnabled={false} listening={false} {...layerClippings}>
{this.renderBarValues()}
</Layer>
</Stage>
Expand Down

0 comments on commit ed6d0e5

Please sign in to comment.