hyperprop-charting-library 0.1.74 → 0.1.76
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.
|
@@ -3909,8 +3909,8 @@ function createChart(element, options = {}) {
|
|
|
3909
3909
|
if (activeDrawingTool === "long-position" || activeDrawingTool === "short-position") {
|
|
3910
3910
|
const isLong = activeDrawingTool === "long-position";
|
|
3911
3911
|
const tick = getConfiguredTickSize();
|
|
3912
|
-
const priceOffset = tick > 0 ? tick *
|
|
3913
|
-
const width2 = Math.max(
|
|
3912
|
+
const priceOffset = tick > 0 ? tick * 60 : Math.abs(point.price) * 0.025 || 1;
|
|
3913
|
+
const width2 = Math.max(8, Math.round(xSpan * 0.2));
|
|
3914
3914
|
const entryPrice = point.price;
|
|
3915
3915
|
const targetPrice = isLong ? entryPrice + priceOffset : entryPrice - priceOffset;
|
|
3916
3916
|
const stopPrice = isLong ? entryPrice - priceOffset : entryPrice + priceOffset;
|
|
@@ -4131,6 +4131,7 @@ function createChart(element, options = {}) {
|
|
|
4131
4131
|
if (region === "plot" && !activeDrawingTool) {
|
|
4132
4132
|
const drawingHit = getDrawingHit(point.x, point.y);
|
|
4133
4133
|
if (drawingHit) {
|
|
4134
|
+
selectedDrawingId = drawingHit.drawing.id;
|
|
4134
4135
|
drawingSelectHandler?.({
|
|
4135
4136
|
drawing: serializeDrawing(drawingHit.drawing),
|
|
4136
4137
|
target: drawingHit.target,
|
|
@@ -4440,6 +4441,7 @@ function createChart(element, options = {}) {
|
|
|
4440
4441
|
emitCrosshairMove(point.x, point.y, "plot");
|
|
4441
4442
|
}
|
|
4442
4443
|
} else if (!pointerDownInfo.moved) {
|
|
4444
|
+
selectedDrawingId = null;
|
|
4443
4445
|
const clickPrice = pointerDownInfo.region === "plot" ? roundToPricePrecision(priceFromCanvasY(pointerDownInfo.y)) : void 0;
|
|
4444
4446
|
chartClickHandler?.({
|
|
4445
4447
|
x: pointerDownInfo.x,
|
|
@@ -3883,8 +3883,8 @@ function createChart(element, options = {}) {
|
|
|
3883
3883
|
if (activeDrawingTool === "long-position" || activeDrawingTool === "short-position") {
|
|
3884
3884
|
const isLong = activeDrawingTool === "long-position";
|
|
3885
3885
|
const tick = getConfiguredTickSize();
|
|
3886
|
-
const priceOffset = tick > 0 ? tick *
|
|
3887
|
-
const width2 = Math.max(
|
|
3886
|
+
const priceOffset = tick > 0 ? tick * 60 : Math.abs(point.price) * 0.025 || 1;
|
|
3887
|
+
const width2 = Math.max(8, Math.round(xSpan * 0.2));
|
|
3888
3888
|
const entryPrice = point.price;
|
|
3889
3889
|
const targetPrice = isLong ? entryPrice + priceOffset : entryPrice - priceOffset;
|
|
3890
3890
|
const stopPrice = isLong ? entryPrice - priceOffset : entryPrice + priceOffset;
|
|
@@ -4105,6 +4105,7 @@ function createChart(element, options = {}) {
|
|
|
4105
4105
|
if (region === "plot" && !activeDrawingTool) {
|
|
4106
4106
|
const drawingHit = getDrawingHit(point.x, point.y);
|
|
4107
4107
|
if (drawingHit) {
|
|
4108
|
+
selectedDrawingId = drawingHit.drawing.id;
|
|
4108
4109
|
drawingSelectHandler?.({
|
|
4109
4110
|
drawing: serializeDrawing(drawingHit.drawing),
|
|
4110
4111
|
target: drawingHit.target,
|
|
@@ -4414,6 +4415,7 @@ function createChart(element, options = {}) {
|
|
|
4414
4415
|
emitCrosshairMove(point.x, point.y, "plot");
|
|
4415
4416
|
}
|
|
4416
4417
|
} else if (!pointerDownInfo.moved) {
|
|
4418
|
+
selectedDrawingId = null;
|
|
4417
4419
|
const clickPrice = pointerDownInfo.region === "plot" ? roundToPricePrecision(priceFromCanvasY(pointerDownInfo.y)) : void 0;
|
|
4418
4420
|
chartClickHandler?.({
|
|
4419
4421
|
x: pointerDownInfo.x,
|
package/dist/index.cjs
CHANGED
|
@@ -3909,8 +3909,8 @@ function createChart(element, options = {}) {
|
|
|
3909
3909
|
if (activeDrawingTool === "long-position" || activeDrawingTool === "short-position") {
|
|
3910
3910
|
const isLong = activeDrawingTool === "long-position";
|
|
3911
3911
|
const tick = getConfiguredTickSize();
|
|
3912
|
-
const priceOffset = tick > 0 ? tick *
|
|
3913
|
-
const width2 = Math.max(
|
|
3912
|
+
const priceOffset = tick > 0 ? tick * 60 : Math.abs(point.price) * 0.025 || 1;
|
|
3913
|
+
const width2 = Math.max(8, Math.round(xSpan * 0.2));
|
|
3914
3914
|
const entryPrice = point.price;
|
|
3915
3915
|
const targetPrice = isLong ? entryPrice + priceOffset : entryPrice - priceOffset;
|
|
3916
3916
|
const stopPrice = isLong ? entryPrice - priceOffset : entryPrice + priceOffset;
|
|
@@ -4131,6 +4131,7 @@ function createChart(element, options = {}) {
|
|
|
4131
4131
|
if (region === "plot" && !activeDrawingTool) {
|
|
4132
4132
|
const drawingHit = getDrawingHit(point.x, point.y);
|
|
4133
4133
|
if (drawingHit) {
|
|
4134
|
+
selectedDrawingId = drawingHit.drawing.id;
|
|
4134
4135
|
drawingSelectHandler?.({
|
|
4135
4136
|
drawing: serializeDrawing(drawingHit.drawing),
|
|
4136
4137
|
target: drawingHit.target,
|
|
@@ -4440,6 +4441,7 @@ function createChart(element, options = {}) {
|
|
|
4440
4441
|
emitCrosshairMove(point.x, point.y, "plot");
|
|
4441
4442
|
}
|
|
4442
4443
|
} else if (!pointerDownInfo.moved) {
|
|
4444
|
+
selectedDrawingId = null;
|
|
4443
4445
|
const clickPrice = pointerDownInfo.region === "plot" ? roundToPricePrecision(priceFromCanvasY(pointerDownInfo.y)) : void 0;
|
|
4444
4446
|
chartClickHandler?.({
|
|
4445
4447
|
x: pointerDownInfo.x,
|
package/dist/index.js
CHANGED
|
@@ -3883,8 +3883,8 @@ function createChart(element, options = {}) {
|
|
|
3883
3883
|
if (activeDrawingTool === "long-position" || activeDrawingTool === "short-position") {
|
|
3884
3884
|
const isLong = activeDrawingTool === "long-position";
|
|
3885
3885
|
const tick = getConfiguredTickSize();
|
|
3886
|
-
const priceOffset = tick > 0 ? tick *
|
|
3887
|
-
const width2 = Math.max(
|
|
3886
|
+
const priceOffset = tick > 0 ? tick * 60 : Math.abs(point.price) * 0.025 || 1;
|
|
3887
|
+
const width2 = Math.max(8, Math.round(xSpan * 0.2));
|
|
3888
3888
|
const entryPrice = point.price;
|
|
3889
3889
|
const targetPrice = isLong ? entryPrice + priceOffset : entryPrice - priceOffset;
|
|
3890
3890
|
const stopPrice = isLong ? entryPrice - priceOffset : entryPrice + priceOffset;
|
|
@@ -4105,6 +4105,7 @@ function createChart(element, options = {}) {
|
|
|
4105
4105
|
if (region === "plot" && !activeDrawingTool) {
|
|
4106
4106
|
const drawingHit = getDrawingHit(point.x, point.y);
|
|
4107
4107
|
if (drawingHit) {
|
|
4108
|
+
selectedDrawingId = drawingHit.drawing.id;
|
|
4108
4109
|
drawingSelectHandler?.({
|
|
4109
4110
|
drawing: serializeDrawing(drawingHit.drawing),
|
|
4110
4111
|
target: drawingHit.target,
|
|
@@ -4414,6 +4415,7 @@ function createChart(element, options = {}) {
|
|
|
4414
4415
|
emitCrosshairMove(point.x, point.y, "plot");
|
|
4415
4416
|
}
|
|
4416
4417
|
} else if (!pointerDownInfo.moved) {
|
|
4418
|
+
selectedDrawingId = null;
|
|
4417
4419
|
const clickPrice = pointerDownInfo.region === "plot" ? roundToPricePrecision(priceFromCanvasY(pointerDownInfo.y)) : void 0;
|
|
4418
4420
|
chartClickHandler?.({
|
|
4419
4421
|
x: pointerDownInfo.x,
|