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
@@ -777,41 +777,43 @@ D3TimeChart.prototype.reinitializeChart = function (options) {
777
777
// unnecessary check, but added to make it clear that if you wanted to add extra functionality to "simple gesture" mode, then you should handle things differently.
778
778
// handle foreground or background selection
779
779
780
-
// Defined from docs on Wt::KeyboardModifier
781
-
varkeyModifierMap={
782
-
altKey: 0x4,
783
-
ctrlKey: 0x2,
784
-
metaKey: 0x8,
785
-
shiftKey: 0x1,
786
-
none: 0x0,
787
-
};
788
-
789
-
if(this.shiftKeyHeld){
790
-
this.WtEmit(
791
-
this.chart.id,
792
-
{name: "timedragged"},
793
-
this.state.data.formatted[0].sampleNumbers[lIdx],
794
-
this.state.data.formatted[0].sampleNumbers[rIdx],
795
-
keyModifierMap[this.highlightModifier]|
796
-
keyModifierMap["shiftKey"]
797
-
);
798
-
}elseif(this.ctrlKeyHeld){
799
-
this.WtEmit(
800
-
this.chart.id,
801
-
{name: "timedragged"},
802
-
this.state.data.formatted[0].sampleNumbers[lIdx],
803
-
this.state.data.formatted[0].sampleNumbers[rIdx],
804
-
keyModifierMap[this.highlightModifier]|
805
-
keyModifierMap["ctrlKey"]
806
-
);
807
-
}else{
808
-
this.WtEmit(
809
-
this.chart.id,
810
-
{name: "timedragged"},
811
-
this.state.data.formatted[0].sampleNumbers[lIdx],
812
-
this.state.data.formatted[0].sampleNumbers[rIdx],
813
-
keyModifierMap[this.highlightModifier]
814
-
);
780
+
if(lIdx<rIdx){
781
+
// Defined from docs on Wt::KeyboardModifier
782
+
varkeyModifierMap={
783
+
altKey: 0x4,
784
+
ctrlKey: 0x2,
785
+
metaKey: 0x8,
786
+
shiftKey: 0x1,
787
+
none: 0x0,
788
+
};
789
+
790
+
if(this.shiftKeyHeld){
791
+
this.WtEmit(
792
+
this.chart.id,
793
+
{name: "timedragged"},
794
+
this.state.data.formatted[0].sampleNumbers[lIdx],
795
+
this.state.data.formatted[0].sampleNumbers[rIdx],
796
+
keyModifierMap[this.highlightModifier]|
797
+
keyModifierMap["shiftKey"]
798
+
);
799
+
}elseif(this.ctrlKeyHeld){
800
+
this.WtEmit(
801
+
this.chart.id,
802
+
{name: "timedragged"},
803
+
this.state.data.formatted[0].sampleNumbers[lIdx],
804
+
this.state.data.formatted[0].sampleNumbers[rIdx],
805
+
keyModifierMap[this.highlightModifier]|
806
+
keyModifierMap["ctrlKey"]
807
+
);
808
+
}else{
809
+
this.WtEmit(
810
+
this.chart.id,
811
+
{name: "timedragged"},
812
+
this.state.data.formatted[0].sampleNumbers[lIdx],
813
+
this.state.data.formatted[0].sampleNumbers[rIdx],
814
+
keyModifierMap[this.highlightModifier]
815
+
);
816
+
}
815
817
}
816
818
}
817
819
}
@@ -1010,12 +1012,12 @@ D3TimeChart.prototype.updateChart = function (
// only use visible range if zoomed in, otherwise use full range.
1020
+
// only use visible range if zoomed in, otherwise use full range. This is an optimization which is helpful for avoiding wasteful out-of-view data rendering.
@@ -1114,8 +1116,8 @@ D3TimeChart.prototype.updateChart = function (
1114
1116
});
1115
1117
}
1116
1118
1117
-
// plot axes and labels
1118
-
1119
+
/** PLOT AXES AND LABELS */
1120
+
// Below is a way to create major and minor axis ticks on the x-axis. Somewhat experimental, but seems to work. Still may need some refinement for more dynamic behavior.
1119
1121
vartickCount=20;
1120
1122
1121
1123
do{
@@ -1153,13 +1155,9 @@ D3TimeChart.prototype.updateChart = function (
// check whether there is any possibility for axis text overlap
1162
-
// if yes, then re-define axes with reduced (half) the current tick count
1159
+
// check whether there is any possibility for axis text overlap. (Checks using only the final two tick labels because those would generally signal the potential for overlap)
1160
+
// if yes, then re-define axes with **reduced** (half) the current tick count
1163
1161
varNUMBER_OF_TICKS_BETWEEN_MAJOR_TICKS=5;// set this to the number of ticks between major ticks. Helps you get the next visible tick.
0 commit comments