forked from carbon-design-system/carbon-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request carbon-design-system#606 from natashadecoste/event…
…-listeners * change storybook tutorial structure * vanilla/angular content * update vanilla * add angular content * react get started * getting started tutorials * update * update styles * clean up file * review changes * update the options and data * update options section * event listener tutorial * add example for event listening * Update packages/core/stories/tutorials/event-listeners.ts Co-authored-by: Eliad Moosavi <[email protected]> Co-authored-by: Eliad Moosavi <[email protected]>
- Loading branch information
1 parent
2c3ed9c
commit ce17e25
Showing
8 changed files
with
61 additions
and
8 deletions.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import marked from "marked"; | ||
|
||
export const eventListenersTutorial = marked(` | ||
# Events in Carbon Charts | ||
Event dispatching for chart elements allows applications to trigger custom UI actions and states when users interact with the charts. | ||
You can see the current dispatched events [here](https://carbon-design-system.github.io/carbon-charts/documentation/modules/_interfaces_events_.html). | ||
| ||
### Listening for events | ||
To listen for event just use a reference to the chart to add an event listener for one of the dispatched events above. | ||
This is an example for adding an event listener for a mouseover event on bar chart \`rect\`s. | ||
\`\`\`js | ||
barChart.services.events.addEventListener("bar-onmouseover", e => { | ||
console.log(e.detail); | ||
}); | ||
\`\`\` | ||
`); |
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
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
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
export * from "./tabular-data-format"; | ||
|
||
// getting started tutorial exports | ||
export * from "./getting-started/angular"; | ||
export * from "./getting-started/react"; | ||
export * from "./getting-started/vue"; | ||
export * from "./getting-started/vanilla"; | ||
|
||
// other tutorials | ||
export * from "./tabular-data-format"; | ||
export * from "./event-listeners"; |
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