Browse Source

Made graph2d robust against strings for y values.

flowchartTest
Alex de Mulder 9 years ago
parent
commit
04aea9e37a
3 changed files with 1331 additions and 1323 deletions
  1. +1326
    -1322
      dist/vis.js
  2. +1
    -1
      docs/graph2d/index.html
  3. +4
    -0
      lib/timeline/component/GraphGroup.js

+ 1326
- 1322
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
docs/graph2d/index.html View File

@ -266,7 +266,7 @@ var items = [
</tr> </tr>
<tr> <tr>
<td>x</td> <td>x</td>
<td>Number</td>
<td>Date</td>
<td>yes</td> <td>yes</td>
<td>Location on the x-axis.</td> <td>Location on the x-axis.</td>
</tr> </tr>

+ 4
- 0
lib/timeline/component/GraphGroup.js View File

@ -40,6 +40,10 @@ GraphGroup.prototype.setItems = function(items) {
if (this.options.sort == true) { if (this.options.sort == true) {
this.itemsData.sort(function (a,b) {return a.x - b.x;}) this.itemsData.sort(function (a,b) {return a.x - b.x;})
} }
// typecast all items to numbers. Takes around 10ms for 500.000 items
for (var i = 0; i < this.itemsData.length; i++) {
this.itemsData[i].y = Number(this.itemsData[i].y);
}
} }
else { else {
this.itemsData = []; this.itemsData = [];

Loading…
Cancel
Save