chartjs / chartjs/Chart.js

Platform-specific requestAnimationFrame

Open
#11,579 3 comments 1 reaction 0 assignees View on GitHub
type: enhancement
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Feature Proposal

Library has a really interesting configuration that lets one use it on platforms other than browser, and that's really amazing.
While using platform configuration on NativeScript for rendering charts in mobile platforms, we had trouble making animations work out of the box, unless we added a polyfill for `window`.

### Possible Implementation

It would be helpful if platform class had support for declaring `requestAnimationFrame` logic internally and library used that method instead.
For example:
```ts
class MyCustomPlatform extends BasePlatform {
acquireContext(canvas) {
// Context logic
}

requestAnimationFrame(callback) {
// Frame animation logic
}
}
```

This would make using animations on other platforms easier.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.