You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -293,7 +293,7 @@ D3TimeChart = function (elem, options) {
293
293
sampleNumberToIndexMap: null,
294
294
unzoomedCompressionIndex: 0,
295
295
},
296
-
selection: null,// maybe would have been better to have named this "zoom": stores data related to zoom selection (e.g. data domain of magnified area, corresponding compression index to use for plotting this magnified data). NOTE: set to null when zoomed all the way out.
296
+
selection: null,// maybe would have been better to have named this "zoom": stores data related to zoom selection (e.g. x data domain of magnified area, corresponding compression index to use for plotting this magnified data). IMPORTANT NOTE: set to null when zoomed all the way out.
297
297
regions: null,
298
298
brush: newBrushX(),
299
299
height: null,
@@ -362,6 +362,7 @@ D3TimeChart = function (elem, options) {
@@ -625,10 +627,10 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
625
627
brush.setScale(scales.xScale);
626
628
}
627
629
// DEFINE HANDLERS AND LISTENERS
628
-
// TODO: To add additional touch functionality, add analogous touch gestures (to right click, alt key, ctrl key-- to perform zoom and background selection)
629
630
630
631
/**
631
-
* Handler for the initiation of a selection gesture.
632
+
* Callback for handling the initiation of a selection gesture (for both mouse and touch).
633
+
* @param {*} options : an object that defines certain options. For example, pass { touch: true } to execute touch codepath
632
634
*/
633
635
varstartSelection=(options)=>{
634
636
if(options&&options.touch){
@@ -704,7 +706,8 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
704
706
};
705
707
706
708
/**
707
-
* Handler for the progression of a selection gesture.
709
+
* Callback for handling the progression of a selection gesture (for both mouse and touch).
710
+
* @param {*} options : an object that defines certain options. For example, pass { touch: true } to execute touch codepath
708
711
*/
709
712
varmoveSelection=(options)=>{
710
713
if(options&&options.touch){
@@ -745,7 +748,8 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
745
748
};
746
749
747
750
/**
748
-
* Handler for the termination of a selection gesture.
751
+
* Callback for handling the termination of a selection gesture (for both mouse and touch).
752
+
* @param {*} options : an object that defines certain options. For example, pass { touch: true } to execute touch codepath
749
753
*/
750
754
varendSelection=(options)=>{
751
755
if(options&&options.touch){
@@ -778,7 +782,7 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
778
782
// handle foreground or background selection
779
783
780
784
// only enable highlighting if brush forward, for more alignment with expected behavior
781
-
if(lIdx<rIdx){
785
+
if(brush.getStart()<=brush.getEnd()){
782
786
// Defined from docs on Wt::KeyboardModifier
783
787
varkeyModifierMap={
784
788
altKey: 0x4,
@@ -847,6 +851,10 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
847
851
varnewSelection=null;
848
852
varnewScale=brush.getScale();
849
853
854
+
/**
855
+
* Callback for handling the initiation of a panning gesture (for both mouse and touch).
856
+
* @param {*} options : an object that defines certain options. For example, pass { touch: true } to execute touch codepath
857
+
*/
850
858
varstartPanDragSelection=(options)=>{
851
859
if(options&&options.touch){
852
860
d3.event.preventDefault();
@@ -864,6 +872,10 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
864
872
d3.select("body").style("cursor","ew-resize");
865
873
};
866
874
875
+
/**
876
+
* Callback for handling the progression of a panning gesture (for both mouse and touch).
877
+
* @param {*} options : an object that defines certain options. For example, pass { touch: true } to execute touch codepath
878
+
*/
867
879
varmovePanDragSelection=(options)=>{
868
880
if(options&&options.touch){
869
881
d3.event.preventDefault();
@@ -886,6 +898,10 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
886
898
}
887
899
};
888
900
901
+
/**
902
+
* Callback for handling the termination of a panning gesture (for both mouse and touch).
903
+
* @param {*} options : an object that defines certain options. For example, pass { touch: true } to execute touch codepath
904
+
*/
889
905
varendPanDragSelection=(options)=>{
890
906
if(options&&options.touch){
891
907
d3.event.preventDefault();
@@ -915,7 +931,7 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
915
931
916
932
this.bottomAxisRect.call(panDrag);
917
933
918
-
// Special behavior for PAN interaction mode.
934
+
// Special behavior for PAN interaction mode, which allows panning by dragging on the main interaction area of the chart
0 commit comments