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

Adds domain to pie trace in order to support subplots #777

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

emilianbold
Copy link
Contributor

Thanks for contributing.

Description

Plotly supports pie chart subplots. This is doable by adding the domain info.

Testing

Manual testing. With this:

        PieTrace trace = PieTrace.builder(new Object[]{"A","B"}, new double[]{2.0, 1})
                .domain(Domain.builder().row(0).column(0).build())
                .build();
        PieTrace trace2 = PieTrace.builder(new Object[]{"A","B"}, new double[]{12.0, 21})
                .domain(Domain.builder().row(0).column(1).build())
                .build();
        PieTrace trace3 = PieTrace.builder(new Object[]{"A","B"}, new double[]{20.0, 10})
                .domain(Domain.builder().row(1).column(1).build())
                .build();

        Layout layout = Layout.builder()
                .grid(Grid.builder().rows(2).columns(2).build())
                .build();

        Figure f = new Figure(layout, trace, trace2, trace3);

we get this:

Screenshot 2020-03-10 at 12 17 31

Copy link
Collaborator

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

Looks fine to me though Larry knows the plotting code much better than I do

@emilianbold
Copy link
Contributor Author

I think an approval is enough. It's a minor change we can always revert if needed.

@emilianbold emilianbold merged commit f8a979d into jtablesaw:master Mar 10, 2020
@emilianbold emilianbold deleted the pie-subplot branch March 10, 2020 14:57
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.

2 participants