Skip to content

Commit 5e49227

Browse files
authored
🤖 Merge PR DefinitelyTyped#72150 Plotlyjs add support for maxdepth (sunburst, treemap, icicle) by @kojo12228
1 parent ca54d88 commit 5e49227

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

‎types/plotly.js/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,6 @@ export type ColorScale = string | string[] | Array<[number, string]>;
13191319
export type DataTransform = Partial<Transform>;
13201320
export type ScatterData = PlotData;
13211321

1322-
// Bar Scatter
13231322
export interface PlotData {
13241323
type: PlotType;
13251324
x: Datum[] | Datum[][] | TypedArray;
@@ -1545,6 +1544,7 @@ export interface PlotData {
15451544
}>;
15461545
autocontour: boolean;
15471546
ncontours: number;
1547+
maxdepth: number;
15481548
uirevision: string | number;
15491549
uid: string;
15501550
}

‎types/plotly.js/test/core-tests.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,24 @@ const layout = {
495495

496496
Plotly.newPlot("myDiv", data, layout);
497497
})();
498+
499+
(() => {
500+
const data: Array<Partial<PlotData>> = [
501+
{
502+
type: "treemap",
503+
labels: ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
504+
parents: ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
505+
maxdepth: 1,
506+
},
507+
];
508+
509+
const layout = {
510+
height: 700,
511+
width: 700,
512+
};
513+
514+
Plotly.newPlot("myDiv", data, layout);
515+
})();
498516
//////////////////////////////////////////////////////////////////////
499517

500518
//////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)