8000 #2344: Front: Show correct estimated gaussians · newcrom/plotly.js@569a0bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 569a0bb

Browse files
author
ivankirshin
committed
plotly#2344: Front: Show correct estimated gaussians
1 parent 262c577 commit 569a0bb

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

lib/index-newcrom.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,18 @@ export function react(
441441
export function addFrames(root: Root, frames: Array<Partial<Frame>>): Promise<PlotlyHTMLElement>;
442442
export function deleteFrames(root: Root, frames: number[]): Promise<PlotlyHTMLElement>;
443443
export function register(modules: PlotlyModule | PlotlyModule[]): void;
444+
export function zoom(
445+
gd: PlotlyHTMLElement,
446+
zoomBounds: ZoomBounds,
447+
): void;
448+
449+
type ZoomBounds = {
450+
x0: number;
451+
x1: number;
452+
y0: number;
453+
y1: number;
454+
};
455+
444456

445457
// Layout
446458
export interface Layout {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@newcrom/plotly.js",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "Forked version of plotly.js with some hacks for use in Newcrom's products. The version is based on plotly.js@2.27.1",
55
"license": "MIT",
66
"main": "./lib/index-newcrom.js",

src/plot_api/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exports._guiRelayout = main._guiRelayout;
1313
exports._guiUpdate = main._guiUpdate;
1414
exports._storeDirectGUIEdit = main._storeDirectGUIEdit;
1515
exports.react = main.react;
16+
exports.zoom = main.zoom;
1617
exports.extendTraces = main.extendTraces;
1718
exports.prependTraces = main.prependTraces;
1819
exports.addTraces = main.addTraces;

src/plot_api/plot_api.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,15 @@ function newPlot(gd, data, layout, config) {
576576
return exports._doPlot(gd, data, layout, config);
577577
}
578578

579+
const zoom = (gd, {x0, x1, y0, y1}) => {
580+
Registry.call('_guiRelayout', gd, {
581+
"xaxis.range[0]": x0,
582+
"xaxis.range[1]": x1,
583+
"yaxis.range[0]": y0,
584+
"yaxis.range[1]": y1
585+
});
586+
};
587+
579588
/**
580589
* Wrap negative indicies to their positive counterparts.
581590
*
@@ -3867,6 +3876,7 @@ exports.moveTraces = moveTraces;
38673876
exports.prependTraces = prependTraces;
38683877

38693878
exports.newPlot = newPlot;
3879+
exports.zoom = zoom;
38703880
exports._doPlot = _doPlot;
38713881
exports.purge = purge;
38723882

0 commit comments

Comments
 (0)
0