Extract a common interface for scatter and line chart#11
Open
jeffsantos wants to merge 4 commits intofeenkcom:mainfrom
Open
Extract a common interface for scatter and line chart#11jeffsantos wants to merge 4 commits intofeenkcom:mainfrom
jeffsantos wants to merge 4 commits intofeenkcom:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi all.
I was trying to port to GT Plotter some charts from the Alexander Bergel book, Agile Artificial Intelligence in Pharo, originally made using Roassal. One of the first book examples use a composite chart that mixes a scatter plot with a line chart. I tried to reproduce that in GT, but I realized that
GtPlotterCompositeChartclass only works withGtPlotterLineChartobjects.Comparing
GtPlotterLineChartclass definition withGtPlotterScatterChartI could notice many common instance variables and methods (many of them, just accessors on these variables). Thus, I decided to extract the common behavior to a new super class that I calledGtPlotterXYChart.Beyond the extraction of the common behavior, I need to do a small fix on methods
axisXStencilandaxisYStencilin theGtPlotterScatterChartclass to guarantee the scatter chart object is correctly associated with the stencil. This was necessary since I got an error when the composite objectcreatemethod executed. This is the small fix:This is a fragment class diagram with the resultant classes related to the existent examples classes that test them. All original examples pass.
Here are the snippets to recreate the chart from the book (page 28, figure 1-12). I did it in a Lepiter page with three snippets:
Generate the scatter plot:
Generate the Line chart:
Generate the composite chart:
This is the result chart: