-
Notifications
You must be signed in to change notification settings - Fork 75
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
Conversation
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.
@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 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 Report
@@ 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
Continue to review full report at Codecov.
|
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. |
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 |
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 |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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}. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`mousemove`
Remove
type
as a field in events, as we usually useevent
(andevent
is always present).Make some events more consistent.
This also updates documentation in typedef.js and object.js.