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

fix: remove clippings from chart #320

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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