Closed jessegreenberg closed 3 years ago
I added an UpDownArrowPlot in the above commit. It is much like BarPlot, but draws the data with ArrowNode instead of Rectangle.
@samreid would you mind reviewing this addition? One thing I noticed was that WebStorm flagged some things in the constructor as duplicated code with BarPlot, which comes from them all having a matching API. Do you think it would be worthwhile to have a supertype like BamboPlot that is extended by BarPlot, UpDownArrowPlot, Lineplot, CanvasLinePlot (and maybe others) that implements these kinds of lines?
(Green highlight is what WebStorm flagged as duplicated).
A better way to add/remove the graphic for each data point was shown in #33. Rather than removing all then adding all back each update, it should just add/remove the new ArrowNodes if necessary. This improvement was made in the following commit.
The changes look good and I tested them in greenhouse effect. Would you like to add a bamboo demo that shows the UpDownArrowPlot?
I also opened https://github.com/phetsims/bamboo/issues/35 to factor out a BambooPlot parent type.
OK sounds good, thanks for reviewing. I made a simple demo for the BambooDemoScreenView. Anything else for this one?
Looks great, thanks! Closing.
From https://github.com/phetsims/greenhouse-effect/issues/44, we need a plot that is similar to BarPlot but where the bars have arrow heads. Over slack I checked to see if anyone had a recommendation for how to go about this:
To summarize, the recommendation was to create a new class that draws the data with arrows, called UpDownArrowPlot. The class should have the same API as all the other plots in bamboo.