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

Add interactive testing, fix errors to do with update to Elm 0.19, fi… #18

Merged
merged 1 commit into from
Sep 28, 2018
Merged

Add interactive testing, fix errors to do with update to Elm 0.19, fi… #18

merged 1 commit into from
Sep 28, 2018

Conversation

GordonBGood
Copy link
Contributor

…x documentation, etc.

Made the following changes:

  1. Modified the "elm.json" file to the new Elm version 0.19 format.
  2. Added keyboard decoding to the "GameApp.elm" template so that it now adequately tests "gameApp".
  3. Corrected the documentation for both the "Apps.elm" and the "GraphicSVG.elm" file to the point where both can auto-generate the requisite documentation JSON file as well as adjusting formatting for both as per the Elm Style Guide.
  4. Added type annotations to global functions for both of the above files where missing.

For the "Apps.elm" file, made the following additional changes/corrections:

  1. exposed the InputHandler type alias and the KeyState(..) and Keys(..) types, which are necessary in order to annotate and use key decoding for use in the gameApp` application creation where keyboard inputs are desired.

For the "GraphicSVG.elm" file, made the following corrections to errors:

  1. Corrected the mousePosDecoder which was transposed incorrectly; missing a minus sign on "y".
  2. Improved accuracy of mouse position by changes to "createCollage" and "convertCoords" so that scroll bars no longer appear until the height of the window is reduced to about 250 pixels (really really small) and to adjust for the actual browser placement of the Collage in the browser window.
  3. Correct outside so that it no longer makes Everything disappear but rather only the Shape (or group of shapes` defined to be on the "inside".
  4. Corrected Clip so that repaint and mapping apply to the actual Shape (the Shape on the left) and not the clipping Shape (the Shape on the right).
  5. Exposed, documented, and tested puppetShow as otherwise it was an unused and unusable orphan in the "GraphicSVG.elm" file; changed the definition to auto-scale according to the given Collage dimensions and to return a List of Shape's to be used directly or within a Collage, whichever is required.

Also:

  1. Added back the now working "OrbsGame.elm" game template so it works with the above; more cleanup as to performance could be done...
  2. Provided "InteractiveTest.elm" program to test major functionality of the entire GraphicSVG library (not including "GraphicSVG.App", which is now adequately tested by the Templates). This was already valuable in finding the errors corrected above.

Open questions remain as follows:

  1. What to do with MyStyle, which is defined in the "GraphicSVG.elm" file but never used and not exposed, making it an orphan?
  2. Whether to try to improve addOutline in the "GraphicSVG.elm" file to its intention to add outlines to any Shape and/or Group of Shape's, but which currently only works for simple basic Shape's.
  3. Of what use is ghost as all it does is make the colour of a Shape white and is no longer used as we no longer have scissors; practically, a ghost should be ephemeral as in blank (transparent) colour, in which case it could be used as a clipping agent without being visible.

…x documentation, etc.

Made the following changes:
1. Modified the "elm.json" file to the new Elm version 0.19 format.
1. Added keyboard decoding to the "GameApp.elm" template so that it now adequately tests "gameApp".
1. Corrected the documentation for both the "Apps.elm" and the "GraphicSVG.elm" file to the point where both can auto-generate the requisite documentation JSON file as well as adjusting formatting for both as per the Elm Style Guide.
1. Added type annotations to global functions for both of the above files where missing.

For the "Apps.elm" file, made the following additional changes/corrections:
1. exposed the `InputHandler` type alias and the `KeyState(..)` and `Keys(..) types, which are necessary in order to annotate and use key decoding for use in the `gameApp` application creation where keyboard inputs are desired.

For the "GraphicSVG.elm" file, made the following corrections to errors:
1. Corrected the `mousePosDecoder` which was transposed incorrectly; missing a minus sign on "y".
1. Improved accuracy of mouse position by changes to "createCollage" and "convertCoords" so that scroll bars no longer appear until the height of the window is reduced to about 250 pixels (really really small) and to adjust for the actual browser placement of the `Collage` in the browser window.
1. Correct `outside` so that it no longer makes `Everything` disappear but rather only the `Shape` (or group of shapes` defined to be on the "inside".
1. Corrected `Clip` so that `repaint` and mapping apply to the actual `Shape` (the `Shape` on the left) and not the clipping `Shape` (the `Shape` on the right).
1. Exposed, documented, and tested `puppetShow` as otherwise it was an unused and unusable orphan in the "GraphicSVG.elm" file; changed the definition to auto-scale according to the given `Collage` dimensions and to return a `List` of `Shape`'s to be used directly or within a `Collage`, whichever is required.

Also:
1. Added back the now working "OrbsGame.elm" game template so it works with the above; more cleanup as to performance could be done...
1. Provided "InteractiveTest.elm" program to test major functionality of the entire GraphicSVG library (not including "GraphicSVG.App", which is now adequately tested by the Templates).  This was already valuable in finding the errors corrected above.

Open questions remain as follows:
1.  What to do with `MyStyle`, which is defined in the "GraphicSVG.elm" file but never used and not exposed, making it an orphan?
1.  Whether to try to improve `addOutline` in the "GraphicSVG.elm" file to its intention to add outlines to any `Shape` and/or `Group` of `Shape`'s, but which currently only works for simple basic `Shape`'s.
1.  Of what use is `ghost` as all it does is make the colour of a `Shape` white and is no longer used as we no longer have scissors; practically, a ghost should be ephemeral as in blank (transparent) colour, in which case it could be used as a clipping agent without being visible.
Copy link
Member

@CSchank CSchank 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 fantastic. Thank you very much!

@CSchank CSchank merged commit d5eaf20 into MacCASOutreach:elm-nineteen Sep 28, 2018
@GordonBGood GordonBGood deleted the elm-nineteen-fixed branch September 28, 2018 23:47
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