hyperprop-charting-library 0.1.78 → 0.1.79
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 +9 -14
- package/dist/hyperprop-charting-library.js +9 -14
- package/dist/index.cjs +9 -14
- package/dist/index.js +9 -14
- package/package.json +1 -1
|
@@ -2429,22 +2429,17 @@ function createChart(element, options = {}) {
|
|
|
2429
2429
|
ctx.fillStyle = lossFill;
|
|
2430
2430
|
ctx.fillRect(boxX0, Math.min(entryY, stopY), boxW, Math.abs(stopY - entryY));
|
|
2431
2431
|
ctx.restore();
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
const hi = Math.max(target.price, stop.price);
|
|
2438
|
-
const clampedLive = Math.min(hi, Math.max(lo, livePrice));
|
|
2439
|
-
const dir = target.price - entry.price;
|
|
2440
|
-
const moved = clampedLive - entry.price;
|
|
2441
|
-
if (dir !== 0 && Math.abs(moved) > 0) {
|
|
2442
|
-
const towardTarget = moved * dir > 0;
|
|
2443
|
-
const liveY = yFromPrice(clampedLive);
|
|
2432
|
+
if (data.length > 0) {
|
|
2433
|
+
const nowX = xFromDrawingPoint({ index: data.length - 1, price: 0 });
|
|
2434
|
+
const darkRight = clamp(nowX, boxX0, boxX1);
|
|
2435
|
+
if (darkRight - boxX0 > 0.5) {
|
|
2436
|
+
const darkW = darkRight - boxX0;
|
|
2444
2437
|
ctx.save();
|
|
2445
2438
|
ctx.globalAlpha = draft ? 0.5 : 1;
|
|
2446
|
-
ctx.fillStyle = hexToRgba(
|
|
2447
|
-
ctx.fillRect(boxX0, Math.min(entryY,
|
|
2439
|
+
ctx.fillStyle = hexToRgba(profitColor, 0.18);
|
|
2440
|
+
ctx.fillRect(boxX0, Math.min(entryY, targetY), darkW, Math.abs(targetY - entryY));
|
|
2441
|
+
ctx.fillStyle = hexToRgba(lossColor, 0.18);
|
|
2442
|
+
ctx.fillRect(boxX0, Math.min(entryY, stopY), darkW, Math.abs(stopY - entryY));
|
|
2448
2443
|
ctx.restore();
|
|
2449
2444
|
}
|
|
2450
2445
|
}
|
|
@@ -2403,22 +2403,17 @@ function createChart(element, options = {}) {
|
|
|
2403
2403
|
ctx.fillStyle = lossFill;
|
|
2404
2404
|
ctx.fillRect(boxX0, Math.min(entryY, stopY), boxW, Math.abs(stopY - entryY));
|
|
2405
2405
|
ctx.restore();
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
const
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
const hi = Math.max(target.price, stop.price);
|
|
2412
|
-
const clampedLive = Math.min(hi, Math.max(lo, livePrice));
|
|
2413
|
-
const dir = target.price - entry.price;
|
|
2414
|
-
const moved = clampedLive - entry.price;
|
|
2415
|
-
if (dir !== 0 && Math.abs(moved) > 0) {
|
|
2416
|
-
const towardTarget = moved * dir > 0;
|
|
2417
|
-
const liveY = yFromPrice(clampedLive);
|
|
2406
|
+
if (data.length > 0) {
|
|
2407
|
+
const nowX = xFromDrawingPoint({ index: data.length - 1, price: 0 });
|
|
2408
|
+
const darkRight = clamp(nowX, boxX0, boxX1);
|
|
2409
|
+
if (darkRight - boxX0 > 0.5) {
|
|
2410
|
+
const darkW = darkRight - boxX0;
|
|
2418
2411
|
ctx.save();
|
|
2419
2412
|
ctx.globalAlpha = draft ? 0.5 : 1;
|
|
2420
|
-
ctx.fillStyle = hexToRgba(
|
|
2421
|
-
ctx.fillRect(boxX0, Math.min(entryY,
|
|
2413
|
+
ctx.fillStyle = hexToRgba(profitColor, 0.18);
|
|
2414
|
+
ctx.fillRect(boxX0, Math.min(entryY, targetY), darkW, Math.abs(targetY - entryY));
|
|
2415
|
+
ctx.fillStyle = hexToRgba(lossColor, 0.18);
|
|
2416
|
+
ctx.fillRect(boxX0, Math.min(entryY, stopY), darkW, Math.abs(stopY - entryY));
|
|
2422
2417
|
ctx.restore();
|
|
2423
2418
|
}
|
|
2424
2419
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -2429,22 +2429,17 @@ function createChart(element, options = {}) {
|
|
|
2429
2429
|
ctx.fillStyle = lossFill;
|
|
2430
2430
|
ctx.fillRect(boxX0, Math.min(entryY, stopY), boxW, Math.abs(stopY - entryY));
|
|
2431
2431
|
ctx.restore();
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
const hi = Math.max(target.price, stop.price);
|
|
2438
|
-
const clampedLive = Math.min(hi, Math.max(lo, livePrice));
|
|
2439
|
-
const dir = target.price - entry.price;
|
|
2440
|
-
const moved = clampedLive - entry.price;
|
|
2441
|
-
if (dir !== 0 && Math.abs(moved) > 0) {
|
|
2442
|
-
const towardTarget = moved * dir > 0;
|
|
2443
|
-
const liveY = yFromPrice(clampedLive);
|
|
2432
|
+
if (data.length > 0) {
|
|
2433
|
+
const nowX = xFromDrawingPoint({ index: data.length - 1, price: 0 });
|
|
2434
|
+
const darkRight = clamp(nowX, boxX0, boxX1);
|
|
2435
|
+
if (darkRight - boxX0 > 0.5) {
|
|
2436
|
+
const darkW = darkRight - boxX0;
|
|
2444
2437
|
ctx.save();
|
|
2445
2438
|
ctx.globalAlpha = draft ? 0.5 : 1;
|
|
2446
|
-
ctx.fillStyle = hexToRgba(
|
|
2447
|
-
ctx.fillRect(boxX0, Math.min(entryY,
|
|
2439
|
+
ctx.fillStyle = hexToRgba(profitColor, 0.18);
|
|
2440
|
+
ctx.fillRect(boxX0, Math.min(entryY, targetY), darkW, Math.abs(targetY - entryY));
|
|
2441
|
+
ctx.fillStyle = hexToRgba(lossColor, 0.18);
|
|
2442
|
+
ctx.fillRect(boxX0, Math.min(entryY, stopY), darkW, Math.abs(stopY - entryY));
|
|
2448
2443
|
ctx.restore();
|
|
2449
2444
|
}
|
|
2450
2445
|
}
|
package/dist/index.js
CHANGED
|
@@ -2403,22 +2403,17 @@ function createChart(element, options = {}) {
|
|
|
2403
2403
|
ctx.fillStyle = lossFill;
|
|
2404
2404
|
ctx.fillRect(boxX0, Math.min(entryY, stopY), boxW, Math.abs(stopY - entryY));
|
|
2405
2405
|
ctx.restore();
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
const
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
const hi = Math.max(target.price, stop.price);
|
|
2412
|
-
const clampedLive = Math.min(hi, Math.max(lo, livePrice));
|
|
2413
|
-
const dir = target.price - entry.price;
|
|
2414
|
-
const moved = clampedLive - entry.price;
|
|
2415
|
-
if (dir !== 0 && Math.abs(moved) > 0) {
|
|
2416
|
-
const towardTarget = moved * dir > 0;
|
|
2417
|
-
const liveY = yFromPrice(clampedLive);
|
|
2406
|
+
if (data.length > 0) {
|
|
2407
|
+
const nowX = xFromDrawingPoint({ index: data.length - 1, price: 0 });
|
|
2408
|
+
const darkRight = clamp(nowX, boxX0, boxX1);
|
|
2409
|
+
if (darkRight - boxX0 > 0.5) {
|
|
2410
|
+
const darkW = darkRight - boxX0;
|
|
2418
2411
|
ctx.save();
|
|
2419
2412
|
ctx.globalAlpha = draft ? 0.5 : 1;
|
|
2420
|
-
ctx.fillStyle = hexToRgba(
|
|
2421
|
-
ctx.fillRect(boxX0, Math.min(entryY,
|
|
2413
|
+
ctx.fillStyle = hexToRgba(profitColor, 0.18);
|
|
2414
|
+
ctx.fillRect(boxX0, Math.min(entryY, targetY), darkW, Math.abs(targetY - entryY));
|
|
2415
|
+
ctx.fillStyle = hexToRgba(lossColor, 0.18);
|
|
2416
|
+
ctx.fillRect(boxX0, Math.min(entryY, stopY), darkW, Math.abs(stopY - entryY));
|
|
2422
2417
|
ctx.restore();
|
|
2423
2418
|
}
|
|
2424
2419
|
}
|