Show More
@@ -452,43 +452,33 b'' | |||
|
452 | 452 | function getDataAccordingToRanges(ranges) { |
|
453 | 453 | |
|
454 | 454 | var data = []; |
|
455 | var new_dataset = {}; | |
|
455 | 456 | var keys = []; |
|
457 | var max_commits = 0; | |
|
456 | 458 | for(var key in dataset){ |
|
457 | var push = false; | |
|
458 | 459 | |
|
459 | //method1 slow !! | |
|
460 | //* | |
|
461 | 460 | for(var ds in dataset[key].data){ |
|
462 | 461 | commit_data = dataset[key].data[ds]; |
|
463 | 462 | if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){ |
|
464 | push = true; | |
|
465 | break; | |
|
463 | ||
|
464 | if(new_dataset[key] === undefined){ | |
|
465 | new_dataset[key] = {data:[],schema:["commits"],label:key}; | |
|
466 | } | |
|
467 | new_dataset[key].data.push(commit_data); | |
|
466 | 468 | } |
|
467 | 469 | } |
|
468 | //*/ | |
|
469 | ||
|
470 | /*//method2 sorted commit data !!! | |
|
471 | ||
|
472 | var first_commit = dataset[key].data[0].time; | |
|
473 | var last_commit = dataset[key].data[dataset[key].data.length-1].time; | |
|
474 | ||
|
475 | if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){ | |
|
476 | push = true; | |
|
477 | } | |
|
478 | //*/ | |
|
479 | ||
|
480 | if(push){ | |
|
481 | data.push(dataset[key]); | |
|
470 | if (new_dataset[key] !== undefined){ | |
|
471 | data.push(new_dataset[key]); | |
|
482 | 472 | } |
|
483 | 473 | } |
|
484 | if(data.length >= 1){ | |
|
474 | ||
|
475 | if (data.length > 0){ | |
|
485 | 476 | return data; |
|
486 | 477 |
} |
|
487 | 478 | else{ |
|
488 | 479 | //just return dummy data for graph to plot itself |
|
489 | 480 | return [getDummyData('')]; |
|
490 | 481 | } |
|
491 | ||
|
492 | 482 | } |
|
493 | 483 | |
|
494 | 484 | /** |
@@ -549,7 +539,7 b'' | |||
|
549 | 539 | */ |
|
550 | 540 | function plotselected(ranges,cur_data) { |
|
551 | 541 | //updates the data for new plot |
|
552 | data = getDataAccordingToRanges(ranges); | |
|
542 | var data = getDataAccordingToRanges(ranges); | |
|
553 | 543 | generateCheckboxes(data); |
|
554 | 544 | |
|
555 | 545 | var new_options = YAHOO.lang.merge(plot_options, { |
@@ -559,11 +549,6 b'' | |||
|
559 | 549 | mode:"time", |
|
560 | 550 | timeformat: "%d/%m", |
|
561 | 551 | }, |
|
562 | yaxis: { | |
|
563 | min: ranges.yaxis.from, | |
|
564 | max: ranges.yaxis.to, | |
|
565 | }, | |
|
566 | ||
|
567 | 552 | }); |
|
568 | 553 | // do the zooming |
|
569 | 554 | plot = YAHOO.widget.Flot(plotContainer, data, new_options); |
@@ -651,19 +636,19 b'' | |||
|
651 | 636 | var plot = YAHOO.widget.Flot(plotContainer,data,plot_options); |
|
652 | 637 | |
|
653 | 638 | //overview |
|
654 |
var overview = YAHOO.widget.Flot(overviewContainer, |
|
|
639 | var overview = YAHOO.widget.Flot(overviewContainer, | |
|
640 | overview_dataset, overview_options); | |
|
655 | 641 | |
|
656 | 642 | //show initial selection on overview |
|
657 | 643 | overview.setSelection(initial_ranges); |
|
658 | 644 | |
|
659 | 645 | plot.subscribe("plotselected", plotselected); |
|
646 | plot.subscribe("plothover", plothover) | |
|
660 | 647 | |
|
661 | 648 | overview.subscribe("plotselected", function (ranges) { |
|
662 | 649 | plot.setSelection(ranges); |
|
663 | 650 | }); |
|
664 | 651 | |
|
665 | plot.subscribe("plothover", plothover); | |
|
666 | ||
|
667 | 652 | YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]); |
|
668 | 653 | } |
|
669 | 654 | SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n}); |
General Comments 0
You need to be logged in to leave comments.
Login now