Browse Source

Merge remote-tracking branch 'origin/develop' into develop

v3_develop
jos 9 years ago
parent
commit
3180235772
4 changed files with 15 additions and 12 deletions
  1. +1
    -0
      HISTORY.md
  2. +1
    -0
      examples/graph2d/index.html
  3. +9
    -9
      lib/timeline/component/ItemSet.js
  4. +4
    -3
      lib/timeline/component/graph2d_types/bar.js

+ 1
- 0
HISTORY.md View File

@ -13,6 +13,7 @@ http://visjs.org
- Orientation can now be configured separately for axis and items.
- Fixed #654: removed unnecessary minimum height for groups, takes the
height of the group label as minimum height now.
- Fixed #708: detecting wrong group when page is scrolled.
## 2015-03-05, version 3.11.0

+ 1
- 0
examples/graph2d/index.html View File

@ -25,6 +25,7 @@
<p><a href="16_bothAxis_titles.html">16_bothAxis_titles.html</a></p>
<p><a href="17_dynamicStyling.html">17_dynamicStyling.html</a></p>
<p><a href="18_scatterplot.html">18_scatterplot.html</a></p>
<p><a href="19_labels.html">19_labels.html</a></p>
</div>
</body>

+ 9
- 9
lib/timeline/component/ItemSet.js View File

@ -1115,7 +1115,7 @@ ItemSet.prototype._onDragStart = function (event) {
if (dragLeftItem) {
props = {
item: dragLeftItem,
initialX: event.gesture.center.clientX
initialX: event.gesture.center.pageX
};
if (me.options.editable.updateTime) {
@ -1130,7 +1130,7 @@ ItemSet.prototype._onDragStart = function (event) {
else if (dragRightItem) {
props = {
item: dragRightItem,
initialX: event.gesture.center.clientX
initialX: event.gesture.center.pageX
};
if (me.options.editable.updateTime) {
@ -1147,7 +1147,7 @@ ItemSet.prototype._onDragStart = function (event) {
var item = me.items[id];
var props = {
item: item,
initialX: event.gesture.center.clientX
initialX: event.gesture.center.pageX
};
if (me.options.editable.updateTime) {
@ -1214,7 +1214,7 @@ ItemSet.prototype._onDragStartAddItem = function (event) {
var props = {
item: newItem,
end: end.valueOf(),
initialX: event.gesture.center.clientX
initialX: event.gesture.center.pageX
};
this.touchParams.itemProps = [props];
@ -1241,7 +1241,7 @@ ItemSet.prototype._onDrag = function (event) {
// move
this.touchParams.itemProps.forEach(function (props) {
var newProps = {};
var current = me.body.util.toTime(event.gesture.center.clientX - xOffset);
var current = me.body.util.toTime(event.gesture.center.pageX - xOffset);
var initial = me.body.util.toTime(props.initialX - xOffset);
var offset = current - initial;
@ -1607,23 +1607,23 @@ ItemSet.prototype.itemFromTarget = function(event) {
* @return {Group | null} group
*/
ItemSet.prototype.groupFromTarget = function(event) {
var clientY = event.gesture ? event.gesture.center.clientY : event.clientY;
var pageY = event.gesture ? event.gesture.center.pageY : event.pageY;
for (var i = 0; i < this.groupIds.length; i++) {
var groupId = this.groupIds[i];
var group = this.groups[groupId];
var foreground = group.dom.foreground;
var top = util.getAbsoluteTop(foreground);
if (clientY > top && clientY < top + foreground.offsetHeight) {
if (pageY > top && pageY < top + foreground.offsetHeight) {
return group;
}
if (this.options.orientation === 'top') {
if (i === this.groupIds.length - 1 && clientY > top) {
if (i === this.groupIds.length - 1 && pageY > top) {
return group;
}
}
else {
if (i === 0 && clientY < top + foreground.offset) {
if (i === 0 && pageY < top + foreground.offset) {
return group;
}
}

+ 4
- 3
lib/timeline/component/graph2d_types/bar.js View File

@ -58,7 +58,8 @@ Bargraph.draw = function (groupIds, processedGroupData, framework) {
combinedData.push({
x: processedGroupData[groupIds[i]][j].x,
y: processedGroupData[groupIds[i]][j].y,
groupId: groupIds[i]
groupId: groupIds[i],
label: processedGroupData[groupIds[i]][j].label,
});
barPoints += 1;
}
@ -114,7 +115,7 @@ Bargraph.draw = function (groupIds, processedGroupData, framework) {
DOMutil.drawBar(combinedData[i].x + drawData.offset, combinedData[i].y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].y, group.className + ' bar', framework.svgElements, framework.svg);
// draw points
if (group.options.drawPoints.enabled == true) {
DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);
DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg, combinedData[i].label);
}
}
};
@ -226,4 +227,4 @@ Bargraph._getStackedBarYRange = function (intersections, combinedData) {
return {min: yMin, max: yMax};
};
module.exports = Bargraph;
module.exports = Bargraph;

Loading…
Cancel
Save