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

Feature/dual y axis POC #564

Merged
merged 10 commits into from
May 15, 2019
Prev Previous commit
Next Next commit
Fixed issue with date x-axis
The Zoomable component was replacing the decorator function, so we need to chain them
  • Loading branch information
andy-lee-eng committed May 3, 2019
commit 816ee7c211771a7c2fe7d134228cf63570360590
7 changes: 5 additions & 2 deletions packages/perspective-viewer-d3fc/src/js/axis/chartFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ const chartFactory = (xAxis, yAxis, cartesian, canvas) => {
.xDomain(xAxis.domain)
.xLabel(xAxis.label)
.xAxisHeight(xAxis.size)
.xDecorate(xAxis.decorate)
.yDomain(yAxis.domain)
.yLabel(yAxis.label)
.yAxisWidth(yAxis.size)
.yDecorate(yAxis.decorate)
.yOrient("left");

if (xAxis.decorate) chart.xDecorate(xAxis.decorate);
if (yAxis.decorate) chart.yDecorate(yAxis.decorate);

// Padding defaults can be overridden
chart.xPaddingInner && chart.xPaddingInner(1);
chart.xPaddingOuter && chart.xPaddingOuter(0.5);
Expand All @@ -54,7 +55,9 @@ const chartFactory = (xAxis, yAxis, cartesian, canvas) => {
return chart;
};

const oldDecorate = chart.decorate();
chart.decorate((container, data) => {
oldDecorate(container, data);
if (!axisSplitter) return;

if (axisSplitter.haveSplit()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export default () => {
}
});

chart.decorate(sel => {
const oldDecorate = chart.decorate();
chart.decorate((sel, data) => {
oldDecorate(sel, data);
if (!bound) {
bound = true;
// add the zoom interaction on the enter selection
Expand Down