hyperprop-charting-library 0.1.110 → 0.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hyperprop-charting-library.cjs +61 -55
- package/dist/hyperprop-charting-library.js +61 -55
- package/dist/index.cjs +61 -55
- package/dist/index.js +61 -55
- package/package.json +1 -1
|
@@ -4617,52 +4617,55 @@ function createChart(element, options = {}) {
|
|
|
4617
4617
|
return;
|
|
4618
4618
|
}
|
|
4619
4619
|
}
|
|
4620
|
-
const
|
|
4621
|
-
if (
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4620
|
+
const drawingToolCapturesPointer = activeDrawingTool !== null || draftDrawing !== null;
|
|
4621
|
+
if (!drawingToolCapturesPointer) {
|
|
4622
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4623
|
+
if (crosshairButtonRegion) {
|
|
4624
|
+
crosshairPriceActionHandler?.({
|
|
4625
|
+
x: point.x,
|
|
4626
|
+
y: point.y,
|
|
4627
|
+
price: crosshairButtonRegion.price
|
|
4628
|
+
});
|
|
4629
|
+
return;
|
|
4630
|
+
}
|
|
4631
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4632
|
+
if (orderRegion) {
|
|
4633
|
+
if (orderRegion.draggable) {
|
|
4634
|
+
activePointerId = event.pointerId;
|
|
4635
|
+
const startPrice = roundToPricePrecision(orderRegion.line.price);
|
|
4636
|
+
actionDragState = {
|
|
4637
|
+
orderId: orderRegion.orderId,
|
|
4638
|
+
action: orderRegion.action,
|
|
4639
|
+
startPrice,
|
|
4640
|
+
lastPrice: startPrice,
|
|
4641
|
+
moved: false
|
|
4642
|
+
};
|
|
4643
|
+
canvas.setPointerCapture(event.pointerId);
|
|
4644
|
+
canvas.style.cursor = "ns-resize";
|
|
4645
|
+
setCrosshairPoint(null);
|
|
4646
|
+
return;
|
|
4647
|
+
}
|
|
4648
|
+
setCrosshairPoint(null);
|
|
4649
|
+
orderActionHandler?.({
|
|
4635
4650
|
orderId: orderRegion.orderId,
|
|
4636
4651
|
action: orderRegion.action,
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4652
|
+
line: orderRegion.line
|
|
4653
|
+
});
|
|
4654
|
+
return;
|
|
4655
|
+
}
|
|
4656
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4657
|
+
if (orderDragRegion) {
|
|
4658
|
+
activePointerId = event.pointerId;
|
|
4659
|
+
orderDragState = {
|
|
4660
|
+
orderId: orderDragRegion.orderId,
|
|
4661
|
+
startPrice: orderDragRegion.price,
|
|
4662
|
+
lastPrice: orderDragRegion.price
|
|
4640
4663
|
};
|
|
4641
4664
|
canvas.setPointerCapture(event.pointerId);
|
|
4642
4665
|
canvas.style.cursor = "ns-resize";
|
|
4643
4666
|
setCrosshairPoint(null);
|
|
4644
4667
|
return;
|
|
4645
4668
|
}
|
|
4646
|
-
setCrosshairPoint(null);
|
|
4647
|
-
orderActionHandler?.({
|
|
4648
|
-
orderId: orderRegion.orderId,
|
|
4649
|
-
action: orderRegion.action,
|
|
4650
|
-
line: orderRegion.line
|
|
4651
|
-
});
|
|
4652
|
-
return;
|
|
4653
|
-
}
|
|
4654
|
-
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4655
|
-
if (orderDragRegion) {
|
|
4656
|
-
activePointerId = event.pointerId;
|
|
4657
|
-
orderDragState = {
|
|
4658
|
-
orderId: orderDragRegion.orderId,
|
|
4659
|
-
startPrice: orderDragRegion.price,
|
|
4660
|
-
lastPrice: orderDragRegion.price
|
|
4661
|
-
};
|
|
4662
|
-
canvas.setPointerCapture(event.pointerId);
|
|
4663
|
-
canvas.style.cursor = "ns-resize";
|
|
4664
|
-
setCrosshairPoint(null);
|
|
4665
|
-
return;
|
|
4666
4669
|
}
|
|
4667
4670
|
const region = getHitRegion(point.x, point.y);
|
|
4668
4671
|
if (region === "outside") {
|
|
@@ -4839,23 +4842,26 @@ function createChart(element, options = {}) {
|
|
|
4839
4842
|
return;
|
|
4840
4843
|
}
|
|
4841
4844
|
if (!isDragging || !dragMode) {
|
|
4842
|
-
const
|
|
4843
|
-
if (
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4845
|
+
const drawingToolOwnsHover = activeDrawingTool !== null || draftDrawing !== null;
|
|
4846
|
+
if (!drawingToolOwnsHover) {
|
|
4847
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4848
|
+
if (crosshairButtonRegion) {
|
|
4849
|
+
canvas.style.cursor = "pointer";
|
|
4850
|
+
setCrosshairPoint(point);
|
|
4851
|
+
return;
|
|
4852
|
+
}
|
|
4853
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4854
|
+
if (orderRegion) {
|
|
4855
|
+
canvas.style.cursor = orderRegion.draggable ? "ns-resize" : "pointer";
|
|
4856
|
+
setCrosshairPoint(null);
|
|
4857
|
+
return;
|
|
4858
|
+
}
|
|
4859
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4860
|
+
if (orderDragRegion) {
|
|
4861
|
+
canvas.style.cursor = "ns-resize";
|
|
4862
|
+
setCrosshairPoint(null);
|
|
4863
|
+
return;
|
|
4864
|
+
}
|
|
4859
4865
|
}
|
|
4860
4866
|
if (!activeDrawingTool && getDrawingHit(point.x, point.y)) {
|
|
4861
4867
|
const drawingHit = getDrawingHit(point.x, point.y);
|
|
@@ -4591,52 +4591,55 @@ function createChart(element, options = {}) {
|
|
|
4591
4591
|
return;
|
|
4592
4592
|
}
|
|
4593
4593
|
}
|
|
4594
|
-
const
|
|
4595
|
-
if (
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4594
|
+
const drawingToolCapturesPointer = activeDrawingTool !== null || draftDrawing !== null;
|
|
4595
|
+
if (!drawingToolCapturesPointer) {
|
|
4596
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4597
|
+
if (crosshairButtonRegion) {
|
|
4598
|
+
crosshairPriceActionHandler?.({
|
|
4599
|
+
x: point.x,
|
|
4600
|
+
y: point.y,
|
|
4601
|
+
price: crosshairButtonRegion.price
|
|
4602
|
+
});
|
|
4603
|
+
return;
|
|
4604
|
+
}
|
|
4605
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4606
|
+
if (orderRegion) {
|
|
4607
|
+
if (orderRegion.draggable) {
|
|
4608
|
+
activePointerId = event.pointerId;
|
|
4609
|
+
const startPrice = roundToPricePrecision(orderRegion.line.price);
|
|
4610
|
+
actionDragState = {
|
|
4611
|
+
orderId: orderRegion.orderId,
|
|
4612
|
+
action: orderRegion.action,
|
|
4613
|
+
startPrice,
|
|
4614
|
+
lastPrice: startPrice,
|
|
4615
|
+
moved: false
|
|
4616
|
+
};
|
|
4617
|
+
canvas.setPointerCapture(event.pointerId);
|
|
4618
|
+
canvas.style.cursor = "ns-resize";
|
|
4619
|
+
setCrosshairPoint(null);
|
|
4620
|
+
return;
|
|
4621
|
+
}
|
|
4622
|
+
setCrosshairPoint(null);
|
|
4623
|
+
orderActionHandler?.({
|
|
4609
4624
|
orderId: orderRegion.orderId,
|
|
4610
4625
|
action: orderRegion.action,
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4626
|
+
line: orderRegion.line
|
|
4627
|
+
});
|
|
4628
|
+
return;
|
|
4629
|
+
}
|
|
4630
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4631
|
+
if (orderDragRegion) {
|
|
4632
|
+
activePointerId = event.pointerId;
|
|
4633
|
+
orderDragState = {
|
|
4634
|
+
orderId: orderDragRegion.orderId,
|
|
4635
|
+
startPrice: orderDragRegion.price,
|
|
4636
|
+
lastPrice: orderDragRegion.price
|
|
4614
4637
|
};
|
|
4615
4638
|
canvas.setPointerCapture(event.pointerId);
|
|
4616
4639
|
canvas.style.cursor = "ns-resize";
|
|
4617
4640
|
setCrosshairPoint(null);
|
|
4618
4641
|
return;
|
|
4619
4642
|
}
|
|
4620
|
-
setCrosshairPoint(null);
|
|
4621
|
-
orderActionHandler?.({
|
|
4622
|
-
orderId: orderRegion.orderId,
|
|
4623
|
-
action: orderRegion.action,
|
|
4624
|
-
line: orderRegion.line
|
|
4625
|
-
});
|
|
4626
|
-
return;
|
|
4627
|
-
}
|
|
4628
|
-
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4629
|
-
if (orderDragRegion) {
|
|
4630
|
-
activePointerId = event.pointerId;
|
|
4631
|
-
orderDragState = {
|
|
4632
|
-
orderId: orderDragRegion.orderId,
|
|
4633
|
-
startPrice: orderDragRegion.price,
|
|
4634
|
-
lastPrice: orderDragRegion.price
|
|
4635
|
-
};
|
|
4636
|
-
canvas.setPointerCapture(event.pointerId);
|
|
4637
|
-
canvas.style.cursor = "ns-resize";
|
|
4638
|
-
setCrosshairPoint(null);
|
|
4639
|
-
return;
|
|
4640
4643
|
}
|
|
4641
4644
|
const region = getHitRegion(point.x, point.y);
|
|
4642
4645
|
if (region === "outside") {
|
|
@@ -4813,23 +4816,26 @@ function createChart(element, options = {}) {
|
|
|
4813
4816
|
return;
|
|
4814
4817
|
}
|
|
4815
4818
|
if (!isDragging || !dragMode) {
|
|
4816
|
-
const
|
|
4817
|
-
if (
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4819
|
+
const drawingToolOwnsHover = activeDrawingTool !== null || draftDrawing !== null;
|
|
4820
|
+
if (!drawingToolOwnsHover) {
|
|
4821
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4822
|
+
if (crosshairButtonRegion) {
|
|
4823
|
+
canvas.style.cursor = "pointer";
|
|
4824
|
+
setCrosshairPoint(point);
|
|
4825
|
+
return;
|
|
4826
|
+
}
|
|
4827
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4828
|
+
if (orderRegion) {
|
|
4829
|
+
canvas.style.cursor = orderRegion.draggable ? "ns-resize" : "pointer";
|
|
4830
|
+
setCrosshairPoint(null);
|
|
4831
|
+
return;
|
|
4832
|
+
}
|
|
4833
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4834
|
+
if (orderDragRegion) {
|
|
4835
|
+
canvas.style.cursor = "ns-resize";
|
|
4836
|
+
setCrosshairPoint(null);
|
|
4837
|
+
return;
|
|
4838
|
+
}
|
|
4833
4839
|
}
|
|
4834
4840
|
if (!activeDrawingTool && getDrawingHit(point.x, point.y)) {
|
|
4835
4841
|
const drawingHit = getDrawingHit(point.x, point.y);
|
package/dist/index.cjs
CHANGED
|
@@ -4617,52 +4617,55 @@ function createChart(element, options = {}) {
|
|
|
4617
4617
|
return;
|
|
4618
4618
|
}
|
|
4619
4619
|
}
|
|
4620
|
-
const
|
|
4621
|
-
if (
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4620
|
+
const drawingToolCapturesPointer = activeDrawingTool !== null || draftDrawing !== null;
|
|
4621
|
+
if (!drawingToolCapturesPointer) {
|
|
4622
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4623
|
+
if (crosshairButtonRegion) {
|
|
4624
|
+
crosshairPriceActionHandler?.({
|
|
4625
|
+
x: point.x,
|
|
4626
|
+
y: point.y,
|
|
4627
|
+
price: crosshairButtonRegion.price
|
|
4628
|
+
});
|
|
4629
|
+
return;
|
|
4630
|
+
}
|
|
4631
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4632
|
+
if (orderRegion) {
|
|
4633
|
+
if (orderRegion.draggable) {
|
|
4634
|
+
activePointerId = event.pointerId;
|
|
4635
|
+
const startPrice = roundToPricePrecision(orderRegion.line.price);
|
|
4636
|
+
actionDragState = {
|
|
4637
|
+
orderId: orderRegion.orderId,
|
|
4638
|
+
action: orderRegion.action,
|
|
4639
|
+
startPrice,
|
|
4640
|
+
lastPrice: startPrice,
|
|
4641
|
+
moved: false
|
|
4642
|
+
};
|
|
4643
|
+
canvas.setPointerCapture(event.pointerId);
|
|
4644
|
+
canvas.style.cursor = "ns-resize";
|
|
4645
|
+
setCrosshairPoint(null);
|
|
4646
|
+
return;
|
|
4647
|
+
}
|
|
4648
|
+
setCrosshairPoint(null);
|
|
4649
|
+
orderActionHandler?.({
|
|
4635
4650
|
orderId: orderRegion.orderId,
|
|
4636
4651
|
action: orderRegion.action,
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4652
|
+
line: orderRegion.line
|
|
4653
|
+
});
|
|
4654
|
+
return;
|
|
4655
|
+
}
|
|
4656
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4657
|
+
if (orderDragRegion) {
|
|
4658
|
+
activePointerId = event.pointerId;
|
|
4659
|
+
orderDragState = {
|
|
4660
|
+
orderId: orderDragRegion.orderId,
|
|
4661
|
+
startPrice: orderDragRegion.price,
|
|
4662
|
+
lastPrice: orderDragRegion.price
|
|
4640
4663
|
};
|
|
4641
4664
|
canvas.setPointerCapture(event.pointerId);
|
|
4642
4665
|
canvas.style.cursor = "ns-resize";
|
|
4643
4666
|
setCrosshairPoint(null);
|
|
4644
4667
|
return;
|
|
4645
4668
|
}
|
|
4646
|
-
setCrosshairPoint(null);
|
|
4647
|
-
orderActionHandler?.({
|
|
4648
|
-
orderId: orderRegion.orderId,
|
|
4649
|
-
action: orderRegion.action,
|
|
4650
|
-
line: orderRegion.line
|
|
4651
|
-
});
|
|
4652
|
-
return;
|
|
4653
|
-
}
|
|
4654
|
-
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4655
|
-
if (orderDragRegion) {
|
|
4656
|
-
activePointerId = event.pointerId;
|
|
4657
|
-
orderDragState = {
|
|
4658
|
-
orderId: orderDragRegion.orderId,
|
|
4659
|
-
startPrice: orderDragRegion.price,
|
|
4660
|
-
lastPrice: orderDragRegion.price
|
|
4661
|
-
};
|
|
4662
|
-
canvas.setPointerCapture(event.pointerId);
|
|
4663
|
-
canvas.style.cursor = "ns-resize";
|
|
4664
|
-
setCrosshairPoint(null);
|
|
4665
|
-
return;
|
|
4666
4669
|
}
|
|
4667
4670
|
const region = getHitRegion(point.x, point.y);
|
|
4668
4671
|
if (region === "outside") {
|
|
@@ -4839,23 +4842,26 @@ function createChart(element, options = {}) {
|
|
|
4839
4842
|
return;
|
|
4840
4843
|
}
|
|
4841
4844
|
if (!isDragging || !dragMode) {
|
|
4842
|
-
const
|
|
4843
|
-
if (
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4845
|
+
const drawingToolOwnsHover = activeDrawingTool !== null || draftDrawing !== null;
|
|
4846
|
+
if (!drawingToolOwnsHover) {
|
|
4847
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4848
|
+
if (crosshairButtonRegion) {
|
|
4849
|
+
canvas.style.cursor = "pointer";
|
|
4850
|
+
setCrosshairPoint(point);
|
|
4851
|
+
return;
|
|
4852
|
+
}
|
|
4853
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4854
|
+
if (orderRegion) {
|
|
4855
|
+
canvas.style.cursor = orderRegion.draggable ? "ns-resize" : "pointer";
|
|
4856
|
+
setCrosshairPoint(null);
|
|
4857
|
+
return;
|
|
4858
|
+
}
|
|
4859
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4860
|
+
if (orderDragRegion) {
|
|
4861
|
+
canvas.style.cursor = "ns-resize";
|
|
4862
|
+
setCrosshairPoint(null);
|
|
4863
|
+
return;
|
|
4864
|
+
}
|
|
4859
4865
|
}
|
|
4860
4866
|
if (!activeDrawingTool && getDrawingHit(point.x, point.y)) {
|
|
4861
4867
|
const drawingHit = getDrawingHit(point.x, point.y);
|
package/dist/index.js
CHANGED
|
@@ -4591,52 +4591,55 @@ function createChart(element, options = {}) {
|
|
|
4591
4591
|
return;
|
|
4592
4592
|
}
|
|
4593
4593
|
}
|
|
4594
|
-
const
|
|
4595
|
-
if (
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4594
|
+
const drawingToolCapturesPointer = activeDrawingTool !== null || draftDrawing !== null;
|
|
4595
|
+
if (!drawingToolCapturesPointer) {
|
|
4596
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4597
|
+
if (crosshairButtonRegion) {
|
|
4598
|
+
crosshairPriceActionHandler?.({
|
|
4599
|
+
x: point.x,
|
|
4600
|
+
y: point.y,
|
|
4601
|
+
price: crosshairButtonRegion.price
|
|
4602
|
+
});
|
|
4603
|
+
return;
|
|
4604
|
+
}
|
|
4605
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4606
|
+
if (orderRegion) {
|
|
4607
|
+
if (orderRegion.draggable) {
|
|
4608
|
+
activePointerId = event.pointerId;
|
|
4609
|
+
const startPrice = roundToPricePrecision(orderRegion.line.price);
|
|
4610
|
+
actionDragState = {
|
|
4611
|
+
orderId: orderRegion.orderId,
|
|
4612
|
+
action: orderRegion.action,
|
|
4613
|
+
startPrice,
|
|
4614
|
+
lastPrice: startPrice,
|
|
4615
|
+
moved: false
|
|
4616
|
+
};
|
|
4617
|
+
canvas.setPointerCapture(event.pointerId);
|
|
4618
|
+
canvas.style.cursor = "ns-resize";
|
|
4619
|
+
setCrosshairPoint(null);
|
|
4620
|
+
return;
|
|
4621
|
+
}
|
|
4622
|
+
setCrosshairPoint(null);
|
|
4623
|
+
orderActionHandler?.({
|
|
4609
4624
|
orderId: orderRegion.orderId,
|
|
4610
4625
|
action: orderRegion.action,
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4626
|
+
line: orderRegion.line
|
|
4627
|
+
});
|
|
4628
|
+
return;
|
|
4629
|
+
}
|
|
4630
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4631
|
+
if (orderDragRegion) {
|
|
4632
|
+
activePointerId = event.pointerId;
|
|
4633
|
+
orderDragState = {
|
|
4634
|
+
orderId: orderDragRegion.orderId,
|
|
4635
|
+
startPrice: orderDragRegion.price,
|
|
4636
|
+
lastPrice: orderDragRegion.price
|
|
4614
4637
|
};
|
|
4615
4638
|
canvas.setPointerCapture(event.pointerId);
|
|
4616
4639
|
canvas.style.cursor = "ns-resize";
|
|
4617
4640
|
setCrosshairPoint(null);
|
|
4618
4641
|
return;
|
|
4619
4642
|
}
|
|
4620
|
-
setCrosshairPoint(null);
|
|
4621
|
-
orderActionHandler?.({
|
|
4622
|
-
orderId: orderRegion.orderId,
|
|
4623
|
-
action: orderRegion.action,
|
|
4624
|
-
line: orderRegion.line
|
|
4625
|
-
});
|
|
4626
|
-
return;
|
|
4627
|
-
}
|
|
4628
|
-
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4629
|
-
if (orderDragRegion) {
|
|
4630
|
-
activePointerId = event.pointerId;
|
|
4631
|
-
orderDragState = {
|
|
4632
|
-
orderId: orderDragRegion.orderId,
|
|
4633
|
-
startPrice: orderDragRegion.price,
|
|
4634
|
-
lastPrice: orderDragRegion.price
|
|
4635
|
-
};
|
|
4636
|
-
canvas.setPointerCapture(event.pointerId);
|
|
4637
|
-
canvas.style.cursor = "ns-resize";
|
|
4638
|
-
setCrosshairPoint(null);
|
|
4639
|
-
return;
|
|
4640
4643
|
}
|
|
4641
4644
|
const region = getHitRegion(point.x, point.y);
|
|
4642
4645
|
if (region === "outside") {
|
|
@@ -4813,23 +4816,26 @@ function createChart(element, options = {}) {
|
|
|
4813
4816
|
return;
|
|
4814
4817
|
}
|
|
4815
4818
|
if (!isDragging || !dragMode) {
|
|
4816
|
-
const
|
|
4817
|
-
if (
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4819
|
+
const drawingToolOwnsHover = activeDrawingTool !== null || draftDrawing !== null;
|
|
4820
|
+
if (!drawingToolOwnsHover) {
|
|
4821
|
+
const crosshairButtonRegion = getCrosshairPriceActionRegion(point.x, point.y);
|
|
4822
|
+
if (crosshairButtonRegion) {
|
|
4823
|
+
canvas.style.cursor = "pointer";
|
|
4824
|
+
setCrosshairPoint(point);
|
|
4825
|
+
return;
|
|
4826
|
+
}
|
|
4827
|
+
const orderRegion = getOrderActionRegion(point.x, point.y);
|
|
4828
|
+
if (orderRegion) {
|
|
4829
|
+
canvas.style.cursor = orderRegion.draggable ? "ns-resize" : "pointer";
|
|
4830
|
+
setCrosshairPoint(null);
|
|
4831
|
+
return;
|
|
4832
|
+
}
|
|
4833
|
+
const orderDragRegion = getOrderDragRegion(point.x, point.y);
|
|
4834
|
+
if (orderDragRegion) {
|
|
4835
|
+
canvas.style.cursor = "ns-resize";
|
|
4836
|
+
setCrosshairPoint(null);
|
|
4837
|
+
return;
|
|
4838
|
+
}
|
|
4833
4839
|
}
|
|
4834
4840
|
if (!activeDrawingTool && getDrawingHit(point.x, point.y)) {
|
|
4835
4841
|
const drawingHit = getDrawingHit(point.x, point.y);
|