mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
plotly.js: Add barnorm to Layout (#40874)
This commit is contained in:
committed by
Daniel Rosenwasser
parent
db3ff1623a
commit
c5bbcb252c
Vendored
+4
-3
@@ -278,9 +278,10 @@ export interface Layout {
|
||||
legend: Partial<Legend>;
|
||||
font: Partial<Font>;
|
||||
scene: Partial<Scene>;
|
||||
barmode: "stack" | "group" | "overlay" | "relative";
|
||||
bargap: number;
|
||||
bargroupgap: number;
|
||||
barmode: 'stack' | 'group' | 'overlay' | 'relative';
|
||||
barnorm: '' | 'fraction' | 'percent';
|
||||
bargap: 0 | 1;
|
||||
bargroupgap: 0 | 1;
|
||||
selectdirection: 'h' | 'v' | 'd' | 'any';
|
||||
hiddenlabels: string[];
|
||||
}
|
||||
|
||||
@@ -141,11 +141,11 @@ const graphDiv = '#test';
|
||||
// Plotly.relayout
|
||||
// update only values within nested objects
|
||||
(() => {
|
||||
const update = {
|
||||
const update: Partial<Layout> = {
|
||||
title: 'some new title', // updates the title
|
||||
'xaxis.range': [0, 5], // updates the xaxis range
|
||||
'yaxis.range[1]': 15 // updates the end of the yaxis range
|
||||
} as Layout;
|
||||
};
|
||||
Plotly.relayout(graphDiv, update);
|
||||
})();
|
||||
|
||||
@@ -163,11 +163,16 @@ const graphDiv = '#test';
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Plotly.update
|
||||
(() => {
|
||||
const data_update = {
|
||||
marker: { color: 'red' }
|
||||
const data_update: Partial<PlotData> = {
|
||||
marker: { color: 'red' },
|
||||
type: 'bar'
|
||||
};
|
||||
const layout_update = {
|
||||
const layout_update: Partial<Layout> = {
|
||||
title: 'some new title', // updates the title
|
||||
barmode: 'stack',
|
||||
barnorm: 'fraction',
|
||||
bargap: 0,
|
||||
bargroupgap: 0,
|
||||
};
|
||||
Plotly.update(graphDiv, data_update, layout_update);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user