From 4a666dced3a460cc240f83fce37b369ca933ed09 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Fri, 13 Jul 2018 12:00:04 -0400 Subject: [PATCH 1/2] Improve feature event documentation. --- src/event.js | 99 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 87 insertions(+), 12 deletions(-) diff --git a/src/event.js b/src/event.js index dccb716e93..89c907299b 100644 --- a/src/event.js +++ b/src/event.js @@ -314,35 +314,86 @@ geo_event.parallelprojection = 'geo_parallelprojection'; */ geo_event.feature = { /** - * The event is the feature version of {@link geo.event.mousemove}. + * The event is the feature version of {@link geo.event.mousemove}. It is + * fired for each data component of a feature below the mouse when the mouse + * moves. + * * @event geo.event.feature.mousemove + * @property {object} data The feature data the mouse is over. + * @property {number} index The index of the feature data the mouse is over. + * @property {object} extra Extra information about the feature and mouse + * location. + * @property {geo.mouseState} mouse The mouse state. + * @property {number} eventID a monotonically increasing event number. All + * features that the mouse moves over simultaneously will have the same + * `eventID`. + * @property {boolean} top True if this is the topmost data element. */ mousemove: 'geo_feature_mousemove', /** - * The event is the feature version of {@link geo.event.mouseover}. + * This event is fired for each data component of a feature when the mouse is + * above it. + * * @event geo.event.feature.mouseover + * @property {object} data The feature data the mouse is over. + * @property {number} index The index of the feature data the mouse is over. + * @property {object} extra Extra information about the feature and mouse + * location. + * @property {geo.mouseState} mouse The mouse state. + * @property {number} eventID a monotonically increasing event number. All + * features that the mouse goes over simultaneously will have the same + * `eventID`. + * @property {boolean} top True if this is the topmost data element. */ mouseover: 'geo_feature_mouseover', /** - * The event contains the `feature`, the `mouse` record, the `previous` - * record of data elements that were under the mouse, and `over`, the new - * record of data elements that are unrder the mouse. + * This is triggered when the mouse changes either the feature components or + * the order of feature components that it is over. + * * @event geo.event.feature.mouseover_order - */ + * @property {geo.feature} feature The feature. + * @property {geo.mouseState} mouse The mouse state. + * @proeprty {geo.feature.searchResult} over A list of feature components + * that the mouse is over. + * @proeprty {number[]} The indices of the data components that the mouse + * was over before this event. + */ mouseover_order: 'geo_feature_mouseover_order', /** - * The event is the feature version of {@link geo.event.mouseout}. + * The event is the feature version of {@link geo.event.mouseout}.a + * This event is fired for each data component of a feature when the mouse is + * no longer above it. + * * @event geo.event.feature.mouseout + * @property {object} data The feature data the mouse is over. + * @property {number} index The index of the feature data the mouse is over. + * @property {object} extra Extra information about the feature and mouse + * location. + * @property {geo.mouseState} mouse The mouse state. + * @property {number} eventID a monotonically increasing event number. All + * features that the mouse goes over simultaneously will have the same + * `eventID`. + * @property {boolean} top True if this is the topmost data element. */ mouseout: 'geo_feature_mouseout', /** - * The event is the feature version of {@link geo.event.mouseon}. + * This event is fired when mouse is over a new topmost data component of a + * feature. + * * @event geo.event.feature.mouseon + * @property {object} data The feature data the mouse is on. + * @property {number} index The index of the feature data the mouse is on. + * @property {geo.mouseState} mouse The mouse state. */ mouseon: 'geo_feature_mouseon', /** - * The event is the feature version of {@link geo.event.mouseoff}. + * This event is fired when mouse is no longer has the same topmost data + * component of a feature. + * * @event geo.event.feature.mouseoff + * @property {object} data The feature data the mouse is off. + * @property {number} index The index of the feature data the mouse is off. + * @property {geo.mouseState} mouse The mouse state. */ mouseoff: 'geo_feature_mouseoff', /** @@ -354,16 +405,40 @@ geo_event.feature = { * The event contains the `feature`, the `mouse` record, and `over`, the * record of data elements that are unrder the mouse. * @event geo.event.feature.mouseclick_order - */ + * @property {geo.feature} feature The feature that was clicked. + * @property {geo.mouseState} mouse The mouse state. + * @proeprty {geo.feature.searchResult} over A list of feature components + * that the mouse is over. + */ mouseclick_order: 'geo_feature_mouseclick_order', /** - * The event is the feature version of {@link geo.event.brushend}. + * This event is fired for each data component of a feature under a brush + * that has just finished its selection. + * * @event geo.event.feature.brushend + * @property {object} data The feature data the mouse is over. + * @property {number} index The index of the feature data the mouse is over. + * @property {geo.mouseState} mouse The mouse state. + * @property {geo.brushSelection} brush The current brush selection. + * @property {number} eventID a monotonically increasing event number. All + * features that the mouse goes over simultaneously will have the same + * `eventID`. + * @property {boolean} top True if this is the topmost data element. */ brushend: 'geo_feature_brushend', /** - * The event is the feature version of {@link geo.event.brush}. + * This event is fired for each data component of a feature under an active + * brush. + * * @event geo.event.feature.brush + * @property {object} data The feature data the mouse is over. + * @property {number} index The index of the feature data the mouse is over. + * @property {geo.mouseState} mouse The mouse state. + * @property {geo.brushSelection} brush The current brush selection. + * @property {number} eventID a monotonically increasing event number. All + * features that the mouse goes over simultaneously will have the same + * `eventID`. + * @property {boolean} top True if this is the topmost data element. */ brush: 'geo_feature_brush' }; From 76a51c7d92c832d7cf0c8acf2dcc17c0d818b40f Mon Sep 17 00:00:00 2001 From: David Manthey Date: Mon, 23 Jul 2018 10:32:36 -0400 Subject: [PATCH 2/2] Adjust wording for consistency. --- src/event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/event.js b/src/event.js index 89c907299b..0e1550f372 100644 --- a/src/event.js +++ b/src/event.js @@ -347,8 +347,8 @@ geo_event.feature = { */ mouseover: 'geo_feature_mouseover', /** - * This is triggered when the mouse changes either the feature components or - * the order of feature components that it is over. + * This event is fired when the mouse changes either which feature components + * or the order of the feature components that it is over. * * @event geo.event.feature.mouseover_order * @property {geo.feature} feature The feature.