Skip to content

Commit

Permalink
Allow strings to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
etimberg committed May 1, 2021
1 parent 9b2c5e5 commit 4d4d8fe
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/index.esm.d.ts
Expand Up @@ -1961,12 +1961,12 @@ interface BaseDecimationOptions {
}

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;
Expand Down
54 changes: 54 additions & 0 deletions types/tests/plugins/plugin.decimation/decimation_algorithm.ts
Expand Up @@ -16,3 +16,57 @@ const chart = new Chart('id', {
}
}
});


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',
}
}
}
});

0 comments on commit 4d4d8fe

Please sign in to comment.