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

API Changes requested #10

Open
lwhite1 opened this issue May 1, 2022 · 0 comments
Open

API Changes requested #10

lwhite1 opened this issue May 1, 2022 · 0 comments

Comments

@lwhite1
Copy link
Contributor

lwhite1 commented May 1, 2022

This covers a list of API changes suggested in the tablesaw repo. See original description below and original issue: jtablesaw/tablesaw#716

I'm not sure what's left to do here that makes sense so a review is needed.

I would like to suggest some simple API changes to the jsplot-plotly classes which will slowly help in the direction proposed in issue jtablesaw/tablesaw#693. If these suggestions sound acceptable, I can work on a PR.

Figure.java : Add methods .setTraces(Trace[]), .setLayout(Layout) & .setEventHandlers().

Figure.java : Change methods buildContext(), plotFunction(), eventHandlerFunction to "protected" instead of "private" so that they can be overridden.

For all Plot classes in tech.tablesaw.plotly.api.*, extend the classes to Figure.java.

Make the constructor of Heatmap (tech.tablesaw.plotly.api) public.

For all *Plot classes create constructors with parameters that match the static create() methods of each class, with an added Layout object. The constructors would do the same as the static methods except that it would setXXX() the layout, trace and eventhandlers instead of creating a new Figure.

If these changes are made, then the following will be true :

a) It will not break the current API.
b) It will allow users of Tablesaw to set a custom Layout object for each of the Plot classes.
c) It will allow users of Tablesaw to take advantage of inheritance and create classes which extend the Plot classes and override the underlying methods, so that they can make enhancements or changes to the current implementation.
d) It will allow users of Tablesaw to contribute their enhancements to the Tablesaw project, but still use their custom enhancements and the latest Tablesaw release while waiting for the acceptance of the enhancements and a new release with the changes.

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

No branches or pull requests

1 participant