mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #44415 add optional scale argument to ToImgopts interface by @m55c55
* add optional scale argument to ToImgopts interface * add test Co-authored-by: Valentin Steinwandter <valentin.steinwandter@exputec.com>
This commit is contained in:
parent
0b65c0b51c
commit
05c6e0b1fb
1
types/plotly.js/index.d.ts
vendored
1
types/plotly.js/index.d.ts
vendored
@ -178,6 +178,7 @@ export interface ToImgopts {
|
||||
format: 'jpeg' | 'png' | 'webp' | 'svg';
|
||||
width: number;
|
||||
height: number;
|
||||
scale?: number;
|
||||
}
|
||||
|
||||
export interface DownloadImgopts {
|
||||
|
||||
@ -265,6 +265,17 @@ function rand() {
|
||||
})();
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Plotly.toImage + scale parameter
|
||||
(() => {
|
||||
// Plotly.toImage will turn the plot in the given div into a data URL string
|
||||
// toImage takes the div as the first argument and an object specifying image properties as the other
|
||||
Plotly.toImage(graphDiv, { format: 'png', width: 800, height: 600, scale: 2 }).then((dataUrl) => {
|
||||
// use the dataUrl
|
||||
});
|
||||
})();
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Plotly.downloadImage
|
||||
(() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user