Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Conversation

yotamberk
Copy link
Member

closes #1955

<tr>
<td>zoomIn(percentage)</td>
<td>none</td>
<td>Zoom in the current visible window. The parameter <code>percentage</code> can be a <code>Number</code>. If the parameter value of <code>percentage</code> is null, the window will be left unchanged.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure what a percentage value is. Something between [0..1] or [0..100]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've enforced the percentage to be between 0 and 1 now

@@ -677,6 +677,46 @@ Core.prototype.getWindow = function() {
};

/**
* Zoom in the window such that given time is centered on screen.
* @param {String} time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be something like this:

@param {Number} percentage Percentage of the min-max-timespan you want to zoom [0..1]

should be

@param {Number} percentage Percentage of the min-max-timespan you want to zoom [0..1]

* @param {String} time
*/
Core.prototype.zoomIn = function(percentage) {
if (!percentage) return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also should check if percentage is [0..1] otherwise throw an exception.

@@ -677,6 +677,46 @@ Core.prototype.getWindow = function() {
};

/**
* Zoom in the window such that given time is centered on screen.
* @param {Number} percentage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe an additional explanation? That the percentage of the min-max-timespan. Percentage must be be [0..1]

* @param {Number} percentage
*/
Core.prototype.zoomIn = function(percentage) {
if (!percentage) return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also check if percentage is [0..1]. Otherwise throw exception.

* @param {Number} percentage - must be between [0..1]
*/
Core.prototype.zoomIn = function(percentage) {
if (!percentage || percentage < 0 || percentage > 1) return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the (non existing) error handling. But as far as I it is not better in all the other functions so that's ok for now.

@mojoaxel mojoaxel merged commit 4dedc62 into visjs:develop Oct 28, 2016
@yotamberk yotamberk deleted the bug-fixes-zoom branch March 4, 2017 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants