* Add test for DecimationAlgorithm type
* Allow strings to be set
* Linting
}
interface LttbDecimationOptions extends BaseDecimationOptions {
- algorithm: DecimationAlgorithm.lttb;
+ algorithm: DecimationAlgorithm.lttb | 'lttb';
samples?: number;
}
interface MinMaxDecimationOptions extends BaseDecimationOptions {
- algorithm: DecimationAlgorithm.minmax;
+ algorithm: DecimationAlgorithm.minmax | 'min-max';
}
export type DecimationOptions = LttbDecimationOptions | MinMaxDecimationOptions;
--- /dev/null
+import { Chart, DecimationAlgorithm } from '../../../index.esm';
+
+const chart = new Chart('id', {
+ type: 'bubble',
+ data: {
+ labels: [],
+ datasets: [{
+ data: []
+ }]
+ },
+ options: {
+ plugins: {
+ decimation: {
+ algorithm: DecimationAlgorithm.lttb,
+ }
+ }
+ }
+});
+
+
+const chart2 = new Chart('id', {
+ type: 'bubble',
+ data: {
+ labels: [],
+ datasets: [{
+ data: []
+ }]
+ },
+ options: {
+ plugins: {
+ decimation: {
+ algorithm: 'lttb',
+ }
+ }
+ }
+});
+
+
+const chart3 = new Chart('id', {
+ type: 'bubble',
+ data: {
+ labels: [],
+ datasets: [{
+ data: []
+ }]
+ },
+ options: {
+ plugins: {
+ decimation: {
+ algorithm: DecimationAlgorithm.minmax,
+ }
+ }
+ }
+});
+
+
+const chart4 = new Chart('id', {
+ type: 'bubble',
+ data: {
+ labels: [],
+ datasets: [{
+ data: []
+ }]
+ },
+ options: {
+ plugins: {
+ decimation: {
+ algorithm: 'min-max',
+ }
+ }
+ }
+});