@@ -7,6 +7,16 @@ var helpers = require('./helpers');
77
88var SHOWISOLATETIP = true ;
99
10+ /**
11+ * Handles click actions on individual legend items.
12+ *
13+ * @param {object } g D3 selection of the legend item element
14+ * @param {object } gd graph div
15+ * @param {object } legendObj the legend object from fullLayout
16+ * @param {string } mode toggle mode for the current action: 'toggle' | 'toggleothers'
17+ * - 'toggle': Toggle visibility of this item (or group if groupclick is 'togglegroup')
18+ * - 'toggleothers': Show only this item, hide all others (isolation mode)
19+ */
1020exports . handleClick = function handleClick ( g , gd , legendObj , mode ) {
1121 var fullLayout = gd . _fullLayout ;
1222
@@ -263,6 +273,15 @@ exports.handleClick = function handleClick(g, gd, legendObj, mode) {
263273 }
264274} ;
265275
276+ /**
277+ * Handles click actions on legend titles.
278+ *
279+ * @param {object } gd graph div (plot container)
280+ * @param {object } legendObj the legend object from fullLayout
281+ * @param {string } mode toggle mode for the current action: 'toggle' | 'toggleothers'
282+ * - 'toggle': show/hide all items in this legend
283+ * - 'toggleothers': isolate this legend (show its items, hide items in other legends)
284+ */
266285exports . handleTitleClick = function handleTitleClick ( gd , legendObj , mode ) {
267286 const fullLayout = gd . _fullLayout ;
268287 const fullData = gd . _fullData ;
0 commit comments