Skip to content

Conversation

@Rishav159
Copy link
Contributor

This PR adds sliders for the animations in chapter 3.
It has the following advantages:

  1. The animation can now be controlled by the readers.
  2. We will no longer have the problem of diagrams animating even when the user is not seeing it.

It adds a new file globalHelpers.js. We can have code that are common to all the chapters there.

Copy link
Contributor

@redblobgames redblobgames left a comment

Choose a reason for hiding this comment

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

Since AnimationController is new, and it's something we want people to reuse across chapters, it should have good documentation.

  • What are the constructor arguments?
  • What are the methods and properties that the user should use?
  • Will it create the slider or does the caller create it?

It would also be useful to give a small example in the documentation that shows how the slider class should be used.

The documentation can be inside /* ... */ at the top of the file.

@Rishav159
Copy link
Contributor Author

Makes sense. Since it is supposed to be reused many times, maybe I could make it more modular and independent of the calling circumstances (Currently it uses d3 but maybe not all chapters will use it. But, we can be sure that JQuery for all chapters).
Also, it would be nice if the function actually creates the slider.

@Rishav159
Copy link
Contributor Author

Regarding Documentation, will it be a good idea to follow the jsdoc standards? It seems like a good style and also, we might later use jsdoc package to create documentation later.

@redblobgames
Copy link
Contributor

I think it's fine to leave it d3, as it seems like it's the most popular choice among the people writing visualizations for aima.

I admit I don't know the javascript doc ecosystem these days, but jsdoc seems like a reasonable choice. The same syntax is used in esdoc.

@Rishav159
Copy link
Contributor Author

Updated PR to include documentation for globalHelpers.js. The documentation is in jsdoc format. Later we can use the package to create documentation.

@redblobgames redblobgames merged commit 09a6163 into aimacode:master Aug 2, 2017
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