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

Create Visualization class for Artist #20534

Merged
merged 17 commits into from Feb 14, 2018
Merged

Create Visualization class for Artist #20534

merged 17 commits into from Feb 14, 2018

Conversation

joshlory
Copy link
Contributor

@joshlory joshlory commented Feb 9, 2018

Replaces PR #20280.

@joshlory joshlory requested a review from Hamms February 9, 2018 22:41
Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

What's the longer-term plan for this class?

this.isDrawingAnswer_ = false;
this.isPredrawing_ = false;

// This flag is used to draw a version of code (either user code or solution
// code) that nornamlizes patterns and stickers to always use the "first"
// option, so that validation can be agnostic
this.shouldDrawNormalized_ = false;

this.visualization = new Visualization();
Copy link
Contributor

Choose a reason for hiding this comment

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

is it okay for canvases to be created on the DOM here, rather than in afterInject_?

this.x = DEFAULT_X;
this.y = DEFAULT_Y;
this.heading = 0;
this.penDownValue = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

penDownValue seems like it should still live on Artist

@joshlory
Copy link
Contributor Author

My goal is to extract a new version of the class I have here, but a little more carefully than what I did in the other PR.

Maybe Visualization isn't the right name? I'll update the PR to include everything to render the turtle drawing, but none of the interpreter logic.

@joshlory
Copy link
Contributor Author

Ok, I think this is ready for review!

Sorry about the huge diff 😖. It should only be moving code from Artist -> Visualization class and ref updates.

@joshlory
Copy link
Contributor Author

Followup diff to extract the module is here: visualization-class...artist-module.

@joshlory joshlory mentioned this pull request Feb 13, 2018
Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

This looks great! I'd love to see some follow-up work to look at all the places the artist class is doing a bunch of work directly on the Visualization and see how much of that can be yanked out into more tightly-controlled methods on Visualization itself, but this is awesome for the initial extraction

@joshlory joshlory merged commit 7023300 into staging Feb 14, 2018
@joshlory joshlory deleted the visualization-class branch February 14, 2018 22:26
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.

None yet

2 participants