VolkovLabs / business-text

The Business Text panel plugin allows you to construct a text visualization template from the values of a dataset returned by a data source query.
https://volkovlabs.io
Apache License 2.0
83 stars 13 forks source link

Add custom code option which is called after content is ready #231

Closed asimonok closed 1 year ago

asimonok commented 1 year ago

Add a new custom code option (After Render Code) which is called for every row after row content was rendered. It's a good place to get access to DOM elements, draw charts and add event listeners.

Context object

element -> row DOM element
data -> row data
grafana: {
  replaceVariables,
  eventBus,
  locationService
}

Code example:

console.log(context);

return () => {
  console.log('destroy and unsubscribe');
}

Resolves #228 Resolves #225 Resolves #210 Resolves #216 Resolves #223 Resolves #221

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (0015994) 98.89% compared to head (24bb287) 98.95%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #231 +/- ## ========================================== + Coverage 98.89% 98.95% +0.05% ========================================== Files 33 35 +2 Lines 362 381 +19 Branches 45 48 +3 ========================================== + Hits 358 377 +19 Misses 3 3 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.