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

Update the documentation on events. #704

Merged
merged 4 commits into from
Jun 13, 2017
Merged

Update the documentation on events. #704

merged 4 commits into from
Jun 13, 2017

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Jun 7, 2017

Remove type as a field in events, as we usually use event (and event is always present).

Make some events more consistent.

This also updates documentation in typedef.js and object.js.

Remove 'type' as a field in events, as we usually use 'event'.

Make some events more consistent.

This also updates documentation in typedef.js and object.js.
@manthey
Copy link
Contributor Author

manthey commented Jun 7, 2017

@jbeezley Is there a better way to show the data that is passed to an event? Currently, the geo.event lists some properties at the top, then each event lists properties specific to that event; it may not be obvious to the new user that the event and geo properties always exist.

Also, the geo.event.feature events should reference the main events, but I'm not sure how to get jsdoc to create the appropriate link.

@codecov-io
Copy link

codecov-io commented Jun 7, 2017

Codecov Report

Merging #704 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #704      +/-   ##
==========================================
- Coverage   95.25%   95.25%   -0.01%     
==========================================
  Files          83       83              
  Lines        8983     8980       -3     
==========================================
- Hits         8557     8554       -3     
  Misses        426      426
Impacted Files Coverage Δ
src/map.js 98.77% <ø> (ø) ⬆️
src/mapInteractor.js 95.83% <ø> (ø) ⬆️
src/event.js 100% <ø> (ø) ⬆️
src/object.js 90.76% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99353fb...07846e3. Read the comment docs.

@jbeezley
Copy link
Contributor

jbeezley commented Jun 7, 2017

I don't have any specific advice unfortunately. I suspect we will need to customize the template or create a jsdoc plugin. I can spend some time on it in a different PR.

@manthey
Copy link
Contributor Author

manthey commented Jun 8, 2017

This is a question for future documentation work: The map class and some features, such as contour, take an object with many parameters. I think these really should be specified using @typedef (currently, in map.js it is just listed as a long set of options in the class specification)? If we do so, should the typedefs be moved to typedef.js or left in the appropriate feature? In the map, this means that the class specification would just be @param {geo.mapSpec} arg The map specification object.

src/event.js Outdated
@@ -3,15 +3,16 @@
* Common object containing all event types that are provided by the GeoJS
* API. Each property contained here is a valid target for event handling
* via {@link geo.object#geoOn}. The event object provided to handlers is
* different for each event type. Each handler will generally be called
* with a the <code>this</code> context being the class that caused the event.<br>
* different for each event type. Each handler is generally be called
Copy link
Contributor

Choose a reason for hiding this comment

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

s/be //

src/event.js Outdated
* different for each event type. Each handler will generally be called
* with a the <code>this</code> context being the class that caused the event.<br>
* different for each event type. Each handler is generally be called
* with the <code>this</code> context being the class that caused the event.<br>
Copy link
Contributor

Choose a reason for hiding this comment

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

Might as well just use markdown syntax instead of <code>.

src/event.js Outdated
* object extends {@link geo.mouseState}.
* @mixes geo.mouseState
* Triggered on `mouseup` events that happen soon enough and close enough to a
* mousedown event. The event object extends {@link geo.mouseState}.
Copy link
Contributor

Choose a reason for hiding this comment

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

`mousedown`

src/event.js Outdated
*
* @event geo.event.pixelmap.prepared
* @type {object}
* @property {geo.pixelmapFeature} pixelmap The pixelamp object that was
Copy link
Contributor

Choose a reason for hiding this comment

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

pixelmap

src/typedef.js Outdated
*
* @typedef geo.actionRecord
* @type {object}
* @property {string} action The name of the action, from geo.action.
Copy link
Contributor

Choose a reason for hiding this comment

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

{@link geo.action}

src/typedef.js Outdated
* buttons), `wheel` (the mouse wheel), `pan` (touch pan), `rotate` (touch
* rotate).
* @property {string|object} [modifiers] The name of a modifier key or an
* object withe modifiers as the keys and boolean values. The listed
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

src/event.js Outdated
@@ -194,7 +156,8 @@ geo_event.mouseclick = 'geo_mouseclick';
/**
* Triggered on every 'mousemove' during a brushing selection.
Copy link
Contributor

Choose a reason for hiding this comment

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

`mousemove`

@manthey manthey merged commit 2dd1e80 into master Jun 13, 2017
@manthey manthey deleted the event-documentation branch June 13, 2017 14:08
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.

3 participants