-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add clickAction in d3tree2 as point of discussion for #9
- Loading branch information
1 parent
1f37d1d
commit ad0d8b0
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,6 +273,11 @@ HTMLWidgets.widget({ | |
Shiny.onInputChange(el.id + '_click', {name:d[celltext]}) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
timelyportfolio
Author
Collaborator
|
||
} | ||
|
||
// check for additional clickAction to perform | ||
if( x.options.clickAction && typeof x.options.clickAction === "function" ){ | ||
x.options.clickAction(d); | ||
} | ||
|
||
return g; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since sometimes 'celltext' might not the same as 'id', wouldn't it better to return 'd' instead? Is there other way to get 'id' when 'celltext' is 'name' which is not unique. Note,
celltext
is an argument tod3tree2
, so you could specify a unique value, but I understand why this could be a suboptimal solution.