hyperprop-charting-library 0.1.157 → 0.1.158
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 +41 -20
- package/dist/hyperprop-charting-library.js +41 -20
- package/dist/index.cjs +41 -20
- package/dist/index.js +41 -20
- package/package.json +1 -1
|
@@ -5439,6 +5439,32 @@ function createChart(element, options = {}) {
|
|
|
5439
5439
|
ctx.fill();
|
|
5440
5440
|
ctx.restore();
|
|
5441
5441
|
};
|
|
5442
|
+
const drawTrashGlyph = (x, y, size, color) => {
|
|
5443
|
+
const w = size * 0.8;
|
|
5444
|
+
const h = size * 0.9;
|
|
5445
|
+
ctx.save();
|
|
5446
|
+
ctx.strokeStyle = color;
|
|
5447
|
+
ctx.lineWidth = 1.2;
|
|
5448
|
+
ctx.lineCap = "round";
|
|
5449
|
+
ctx.lineJoin = "round";
|
|
5450
|
+
ctx.beginPath();
|
|
5451
|
+
ctx.moveTo(x - w / 2, y - h * 0.28);
|
|
5452
|
+
ctx.lineTo(x + w / 2, y - h * 0.28);
|
|
5453
|
+
ctx.moveTo(x - w * 0.22, y - h * 0.28);
|
|
5454
|
+
ctx.lineTo(x - w * 0.22, y - h * 0.46);
|
|
5455
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.46);
|
|
5456
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.28);
|
|
5457
|
+
ctx.moveTo(x - w * 0.36, y - h * 0.28);
|
|
5458
|
+
ctx.lineTo(x - w * 0.28, y + h * 0.48);
|
|
5459
|
+
ctx.lineTo(x + w * 0.28, y + h * 0.48);
|
|
5460
|
+
ctx.lineTo(x + w * 0.36, y - h * 0.28);
|
|
5461
|
+
ctx.moveTo(x - w * 0.1, y - h * 0.08);
|
|
5462
|
+
ctx.lineTo(x - w * 0.1, y + h * 0.3);
|
|
5463
|
+
ctx.moveTo(x + w * 0.1, y - h * 0.08);
|
|
5464
|
+
ctx.lineTo(x + w * 0.1, y + h * 0.3);
|
|
5465
|
+
ctx.stroke();
|
|
5466
|
+
ctx.restore();
|
|
5467
|
+
};
|
|
5442
5468
|
const drawAlertLine = (alert, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
|
5443
5469
|
const lineY = getLineY(alert.price, yFromPrice, chartTop, chartBottom, false);
|
|
5444
5470
|
if (lineY === null) return;
|
|
@@ -5457,13 +5483,11 @@ function createChart(element, options = {}) {
|
|
|
5457
5483
|
ctx.restore();
|
|
5458
5484
|
const fontSize = Math.max(8, axis.fontSize);
|
|
5459
5485
|
ctx.font = `${fontSize}px ${mergedOptions.fontFamily}`;
|
|
5460
|
-
const text = alert.label ? `${formatPrice(alert.price)} ${alert.label}` : formatPrice(alert.price);
|
|
5461
5486
|
const paddingX = 6;
|
|
5462
5487
|
const bellWidth = fontSize + 2;
|
|
5463
5488
|
const labelHeight = 20;
|
|
5464
5489
|
const hovered = hoveredAlertId === alert.id;
|
|
5465
|
-
const
|
|
5466
|
-
const contentWidth = Math.ceil(measureTextWidth(text)) + bellWidth + paddingX * 3 + removeWidth;
|
|
5490
|
+
const contentWidth = bellWidth + paddingX * 2;
|
|
5467
5491
|
const labelWidth = getRightAxisLabelWidth(chartRight, contentWidth);
|
|
5468
5492
|
const labelX = getRightAxisLabelX(chartRight);
|
|
5469
5493
|
const labelY = placeRightAxisLabel(lineY - labelHeight / 2, labelHeight, chartTop, chartBottom - labelHeight);
|
|
@@ -5473,29 +5497,26 @@ function createChart(element, options = {}) {
|
|
|
5473
5497
|
fillRoundedRect(Math.round(labelX), Math.round(labelY), labelWidth, labelHeight, 3);
|
|
5474
5498
|
const inkColor = labelTextColorOn(color, "#101114");
|
|
5475
5499
|
drawBellGlyph(labelX + paddingX + bellWidth / 2, labelY + labelHeight / 2, fontSize, inkColor);
|
|
5476
|
-
|
|
5500
|
+
ctx.restore();
|
|
5477
5501
|
if (hovered) {
|
|
5478
|
-
const
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
ctx.
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
ctx.
|
|
5486
|
-
ctx.lineTo(removeX + inset, labelY + labelHeight - inset);
|
|
5487
|
-
ctx.stroke();
|
|
5502
|
+
const buttonSize = labelHeight;
|
|
5503
|
+
const buttonX = chartLeft + 10;
|
|
5504
|
+
const buttonY = lineY - buttonSize / 2;
|
|
5505
|
+
ctx.save();
|
|
5506
|
+
ctx.fillStyle = color;
|
|
5507
|
+
fillRoundedRect(Math.round(buttonX), Math.round(buttonY), buttonSize, buttonSize, 3);
|
|
5508
|
+
drawTrashGlyph(buttonX + buttonSize / 2, lineY, fontSize, inkColor);
|
|
5509
|
+
ctx.restore();
|
|
5488
5510
|
alertRegions.push({
|
|
5489
5511
|
id: alert.id,
|
|
5490
|
-
x:
|
|
5491
|
-
y:
|
|
5492
|
-
width:
|
|
5493
|
-
height:
|
|
5512
|
+
x: buttonX,
|
|
5513
|
+
y: buttonY,
|
|
5514
|
+
width: buttonSize,
|
|
5515
|
+
height: buttonSize,
|
|
5494
5516
|
part: "remove"
|
|
5495
5517
|
});
|
|
5496
5518
|
}
|
|
5497
|
-
|
|
5498
|
-
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth - removeWidth, height: labelHeight, part: "line" });
|
|
5519
|
+
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth, height: labelHeight, part: "line" });
|
|
5499
5520
|
alertRegions.push({ id: alert.id, x: chartLeft, y: lineY - 5, width: chartRight - chartLeft, height: 10, part: "line" });
|
|
5500
5521
|
};
|
|
5501
5522
|
const drawOrderLine = (line, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
|
@@ -5400,6 +5400,32 @@ function createChart(element, options = {}) {
|
|
|
5400
5400
|
ctx.fill();
|
|
5401
5401
|
ctx.restore();
|
|
5402
5402
|
};
|
|
5403
|
+
const drawTrashGlyph = (x, y, size, color) => {
|
|
5404
|
+
const w = size * 0.8;
|
|
5405
|
+
const h = size * 0.9;
|
|
5406
|
+
ctx.save();
|
|
5407
|
+
ctx.strokeStyle = color;
|
|
5408
|
+
ctx.lineWidth = 1.2;
|
|
5409
|
+
ctx.lineCap = "round";
|
|
5410
|
+
ctx.lineJoin = "round";
|
|
5411
|
+
ctx.beginPath();
|
|
5412
|
+
ctx.moveTo(x - w / 2, y - h * 0.28);
|
|
5413
|
+
ctx.lineTo(x + w / 2, y - h * 0.28);
|
|
5414
|
+
ctx.moveTo(x - w * 0.22, y - h * 0.28);
|
|
5415
|
+
ctx.lineTo(x - w * 0.22, y - h * 0.46);
|
|
5416
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.46);
|
|
5417
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.28);
|
|
5418
|
+
ctx.moveTo(x - w * 0.36, y - h * 0.28);
|
|
5419
|
+
ctx.lineTo(x - w * 0.28, y + h * 0.48);
|
|
5420
|
+
ctx.lineTo(x + w * 0.28, y + h * 0.48);
|
|
5421
|
+
ctx.lineTo(x + w * 0.36, y - h * 0.28);
|
|
5422
|
+
ctx.moveTo(x - w * 0.1, y - h * 0.08);
|
|
5423
|
+
ctx.lineTo(x - w * 0.1, y + h * 0.3);
|
|
5424
|
+
ctx.moveTo(x + w * 0.1, y - h * 0.08);
|
|
5425
|
+
ctx.lineTo(x + w * 0.1, y + h * 0.3);
|
|
5426
|
+
ctx.stroke();
|
|
5427
|
+
ctx.restore();
|
|
5428
|
+
};
|
|
5403
5429
|
const drawAlertLine = (alert, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
|
5404
5430
|
const lineY = getLineY(alert.price, yFromPrice, chartTop, chartBottom, false);
|
|
5405
5431
|
if (lineY === null) return;
|
|
@@ -5418,13 +5444,11 @@ function createChart(element, options = {}) {
|
|
|
5418
5444
|
ctx.restore();
|
|
5419
5445
|
const fontSize = Math.max(8, axis.fontSize);
|
|
5420
5446
|
ctx.font = `${fontSize}px ${mergedOptions.fontFamily}`;
|
|
5421
|
-
const text = alert.label ? `${formatPrice(alert.price)} ${alert.label}` : formatPrice(alert.price);
|
|
5422
5447
|
const paddingX = 6;
|
|
5423
5448
|
const bellWidth = fontSize + 2;
|
|
5424
5449
|
const labelHeight = 20;
|
|
5425
5450
|
const hovered = hoveredAlertId === alert.id;
|
|
5426
|
-
const
|
|
5427
|
-
const contentWidth = Math.ceil(measureTextWidth(text)) + bellWidth + paddingX * 3 + removeWidth;
|
|
5451
|
+
const contentWidth = bellWidth + paddingX * 2;
|
|
5428
5452
|
const labelWidth = getRightAxisLabelWidth(chartRight, contentWidth);
|
|
5429
5453
|
const labelX = getRightAxisLabelX(chartRight);
|
|
5430
5454
|
const labelY = placeRightAxisLabel(lineY - labelHeight / 2, labelHeight, chartTop, chartBottom - labelHeight);
|
|
@@ -5434,29 +5458,26 @@ function createChart(element, options = {}) {
|
|
|
5434
5458
|
fillRoundedRect(Math.round(labelX), Math.round(labelY), labelWidth, labelHeight, 3);
|
|
5435
5459
|
const inkColor = labelTextColorOn(color, "#101114");
|
|
5436
5460
|
drawBellGlyph(labelX + paddingX + bellWidth / 2, labelY + labelHeight / 2, fontSize, inkColor);
|
|
5437
|
-
|
|
5461
|
+
ctx.restore();
|
|
5438
5462
|
if (hovered) {
|
|
5439
|
-
const
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
ctx.
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
ctx.
|
|
5447
|
-
ctx.lineTo(removeX + inset, labelY + labelHeight - inset);
|
|
5448
|
-
ctx.stroke();
|
|
5463
|
+
const buttonSize = labelHeight;
|
|
5464
|
+
const buttonX = chartLeft + 10;
|
|
5465
|
+
const buttonY = lineY - buttonSize / 2;
|
|
5466
|
+
ctx.save();
|
|
5467
|
+
ctx.fillStyle = color;
|
|
5468
|
+
fillRoundedRect(Math.round(buttonX), Math.round(buttonY), buttonSize, buttonSize, 3);
|
|
5469
|
+
drawTrashGlyph(buttonX + buttonSize / 2, lineY, fontSize, inkColor);
|
|
5470
|
+
ctx.restore();
|
|
5449
5471
|
alertRegions.push({
|
|
5450
5472
|
id: alert.id,
|
|
5451
|
-
x:
|
|
5452
|
-
y:
|
|
5453
|
-
width:
|
|
5454
|
-
height:
|
|
5473
|
+
x: buttonX,
|
|
5474
|
+
y: buttonY,
|
|
5475
|
+
width: buttonSize,
|
|
5476
|
+
height: buttonSize,
|
|
5455
5477
|
part: "remove"
|
|
5456
5478
|
});
|
|
5457
5479
|
}
|
|
5458
|
-
|
|
5459
|
-
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth - removeWidth, height: labelHeight, part: "line" });
|
|
5480
|
+
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth, height: labelHeight, part: "line" });
|
|
5460
5481
|
alertRegions.push({ id: alert.id, x: chartLeft, y: lineY - 5, width: chartRight - chartLeft, height: 10, part: "line" });
|
|
5461
5482
|
};
|
|
5462
5483
|
const drawOrderLine = (line, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
package/dist/index.cjs
CHANGED
|
@@ -5439,6 +5439,32 @@ function createChart(element, options = {}) {
|
|
|
5439
5439
|
ctx.fill();
|
|
5440
5440
|
ctx.restore();
|
|
5441
5441
|
};
|
|
5442
|
+
const drawTrashGlyph = (x, y, size, color) => {
|
|
5443
|
+
const w = size * 0.8;
|
|
5444
|
+
const h = size * 0.9;
|
|
5445
|
+
ctx.save();
|
|
5446
|
+
ctx.strokeStyle = color;
|
|
5447
|
+
ctx.lineWidth = 1.2;
|
|
5448
|
+
ctx.lineCap = "round";
|
|
5449
|
+
ctx.lineJoin = "round";
|
|
5450
|
+
ctx.beginPath();
|
|
5451
|
+
ctx.moveTo(x - w / 2, y - h * 0.28);
|
|
5452
|
+
ctx.lineTo(x + w / 2, y - h * 0.28);
|
|
5453
|
+
ctx.moveTo(x - w * 0.22, y - h * 0.28);
|
|
5454
|
+
ctx.lineTo(x - w * 0.22, y - h * 0.46);
|
|
5455
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.46);
|
|
5456
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.28);
|
|
5457
|
+
ctx.moveTo(x - w * 0.36, y - h * 0.28);
|
|
5458
|
+
ctx.lineTo(x - w * 0.28, y + h * 0.48);
|
|
5459
|
+
ctx.lineTo(x + w * 0.28, y + h * 0.48);
|
|
5460
|
+
ctx.lineTo(x + w * 0.36, y - h * 0.28);
|
|
5461
|
+
ctx.moveTo(x - w * 0.1, y - h * 0.08);
|
|
5462
|
+
ctx.lineTo(x - w * 0.1, y + h * 0.3);
|
|
5463
|
+
ctx.moveTo(x + w * 0.1, y - h * 0.08);
|
|
5464
|
+
ctx.lineTo(x + w * 0.1, y + h * 0.3);
|
|
5465
|
+
ctx.stroke();
|
|
5466
|
+
ctx.restore();
|
|
5467
|
+
};
|
|
5442
5468
|
const drawAlertLine = (alert, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
|
5443
5469
|
const lineY = getLineY(alert.price, yFromPrice, chartTop, chartBottom, false);
|
|
5444
5470
|
if (lineY === null) return;
|
|
@@ -5457,13 +5483,11 @@ function createChart(element, options = {}) {
|
|
|
5457
5483
|
ctx.restore();
|
|
5458
5484
|
const fontSize = Math.max(8, axis.fontSize);
|
|
5459
5485
|
ctx.font = `${fontSize}px ${mergedOptions.fontFamily}`;
|
|
5460
|
-
const text = alert.label ? `${formatPrice(alert.price)} ${alert.label}` : formatPrice(alert.price);
|
|
5461
5486
|
const paddingX = 6;
|
|
5462
5487
|
const bellWidth = fontSize + 2;
|
|
5463
5488
|
const labelHeight = 20;
|
|
5464
5489
|
const hovered = hoveredAlertId === alert.id;
|
|
5465
|
-
const
|
|
5466
|
-
const contentWidth = Math.ceil(measureTextWidth(text)) + bellWidth + paddingX * 3 + removeWidth;
|
|
5490
|
+
const contentWidth = bellWidth + paddingX * 2;
|
|
5467
5491
|
const labelWidth = getRightAxisLabelWidth(chartRight, contentWidth);
|
|
5468
5492
|
const labelX = getRightAxisLabelX(chartRight);
|
|
5469
5493
|
const labelY = placeRightAxisLabel(lineY - labelHeight / 2, labelHeight, chartTop, chartBottom - labelHeight);
|
|
@@ -5473,29 +5497,26 @@ function createChart(element, options = {}) {
|
|
|
5473
5497
|
fillRoundedRect(Math.round(labelX), Math.round(labelY), labelWidth, labelHeight, 3);
|
|
5474
5498
|
const inkColor = labelTextColorOn(color, "#101114");
|
|
5475
5499
|
drawBellGlyph(labelX + paddingX + bellWidth / 2, labelY + labelHeight / 2, fontSize, inkColor);
|
|
5476
|
-
|
|
5500
|
+
ctx.restore();
|
|
5477
5501
|
if (hovered) {
|
|
5478
|
-
const
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
ctx.
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
ctx.
|
|
5486
|
-
ctx.lineTo(removeX + inset, labelY + labelHeight - inset);
|
|
5487
|
-
ctx.stroke();
|
|
5502
|
+
const buttonSize = labelHeight;
|
|
5503
|
+
const buttonX = chartLeft + 10;
|
|
5504
|
+
const buttonY = lineY - buttonSize / 2;
|
|
5505
|
+
ctx.save();
|
|
5506
|
+
ctx.fillStyle = color;
|
|
5507
|
+
fillRoundedRect(Math.round(buttonX), Math.round(buttonY), buttonSize, buttonSize, 3);
|
|
5508
|
+
drawTrashGlyph(buttonX + buttonSize / 2, lineY, fontSize, inkColor);
|
|
5509
|
+
ctx.restore();
|
|
5488
5510
|
alertRegions.push({
|
|
5489
5511
|
id: alert.id,
|
|
5490
|
-
x:
|
|
5491
|
-
y:
|
|
5492
|
-
width:
|
|
5493
|
-
height:
|
|
5512
|
+
x: buttonX,
|
|
5513
|
+
y: buttonY,
|
|
5514
|
+
width: buttonSize,
|
|
5515
|
+
height: buttonSize,
|
|
5494
5516
|
part: "remove"
|
|
5495
5517
|
});
|
|
5496
5518
|
}
|
|
5497
|
-
|
|
5498
|
-
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth - removeWidth, height: labelHeight, part: "line" });
|
|
5519
|
+
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth, height: labelHeight, part: "line" });
|
|
5499
5520
|
alertRegions.push({ id: alert.id, x: chartLeft, y: lineY - 5, width: chartRight - chartLeft, height: 10, part: "line" });
|
|
5500
5521
|
};
|
|
5501
5522
|
const drawOrderLine = (line, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
package/dist/index.js
CHANGED
|
@@ -5400,6 +5400,32 @@ function createChart(element, options = {}) {
|
|
|
5400
5400
|
ctx.fill();
|
|
5401
5401
|
ctx.restore();
|
|
5402
5402
|
};
|
|
5403
|
+
const drawTrashGlyph = (x, y, size, color) => {
|
|
5404
|
+
const w = size * 0.8;
|
|
5405
|
+
const h = size * 0.9;
|
|
5406
|
+
ctx.save();
|
|
5407
|
+
ctx.strokeStyle = color;
|
|
5408
|
+
ctx.lineWidth = 1.2;
|
|
5409
|
+
ctx.lineCap = "round";
|
|
5410
|
+
ctx.lineJoin = "round";
|
|
5411
|
+
ctx.beginPath();
|
|
5412
|
+
ctx.moveTo(x - w / 2, y - h * 0.28);
|
|
5413
|
+
ctx.lineTo(x + w / 2, y - h * 0.28);
|
|
5414
|
+
ctx.moveTo(x - w * 0.22, y - h * 0.28);
|
|
5415
|
+
ctx.lineTo(x - w * 0.22, y - h * 0.46);
|
|
5416
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.46);
|
|
5417
|
+
ctx.lineTo(x + w * 0.22, y - h * 0.28);
|
|
5418
|
+
ctx.moveTo(x - w * 0.36, y - h * 0.28);
|
|
5419
|
+
ctx.lineTo(x - w * 0.28, y + h * 0.48);
|
|
5420
|
+
ctx.lineTo(x + w * 0.28, y + h * 0.48);
|
|
5421
|
+
ctx.lineTo(x + w * 0.36, y - h * 0.28);
|
|
5422
|
+
ctx.moveTo(x - w * 0.1, y - h * 0.08);
|
|
5423
|
+
ctx.lineTo(x - w * 0.1, y + h * 0.3);
|
|
5424
|
+
ctx.moveTo(x + w * 0.1, y - h * 0.08);
|
|
5425
|
+
ctx.lineTo(x + w * 0.1, y + h * 0.3);
|
|
5426
|
+
ctx.stroke();
|
|
5427
|
+
ctx.restore();
|
|
5428
|
+
};
|
|
5403
5429
|
const drawAlertLine = (alert, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|
|
5404
5430
|
const lineY = getLineY(alert.price, yFromPrice, chartTop, chartBottom, false);
|
|
5405
5431
|
if (lineY === null) return;
|
|
@@ -5418,13 +5444,11 @@ function createChart(element, options = {}) {
|
|
|
5418
5444
|
ctx.restore();
|
|
5419
5445
|
const fontSize = Math.max(8, axis.fontSize);
|
|
5420
5446
|
ctx.font = `${fontSize}px ${mergedOptions.fontFamily}`;
|
|
5421
|
-
const text = alert.label ? `${formatPrice(alert.price)} ${alert.label}` : formatPrice(alert.price);
|
|
5422
5447
|
const paddingX = 6;
|
|
5423
5448
|
const bellWidth = fontSize + 2;
|
|
5424
5449
|
const labelHeight = 20;
|
|
5425
5450
|
const hovered = hoveredAlertId === alert.id;
|
|
5426
|
-
const
|
|
5427
|
-
const contentWidth = Math.ceil(measureTextWidth(text)) + bellWidth + paddingX * 3 + removeWidth;
|
|
5451
|
+
const contentWidth = bellWidth + paddingX * 2;
|
|
5428
5452
|
const labelWidth = getRightAxisLabelWidth(chartRight, contentWidth);
|
|
5429
5453
|
const labelX = getRightAxisLabelX(chartRight);
|
|
5430
5454
|
const labelY = placeRightAxisLabel(lineY - labelHeight / 2, labelHeight, chartTop, chartBottom - labelHeight);
|
|
@@ -5434,29 +5458,26 @@ function createChart(element, options = {}) {
|
|
|
5434
5458
|
fillRoundedRect(Math.round(labelX), Math.round(labelY), labelWidth, labelHeight, 3);
|
|
5435
5459
|
const inkColor = labelTextColorOn(color, "#101114");
|
|
5436
5460
|
drawBellGlyph(labelX + paddingX + bellWidth / 2, labelY + labelHeight / 2, fontSize, inkColor);
|
|
5437
|
-
|
|
5461
|
+
ctx.restore();
|
|
5438
5462
|
if (hovered) {
|
|
5439
|
-
const
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
ctx.
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
ctx.
|
|
5447
|
-
ctx.lineTo(removeX + inset, labelY + labelHeight - inset);
|
|
5448
|
-
ctx.stroke();
|
|
5463
|
+
const buttonSize = labelHeight;
|
|
5464
|
+
const buttonX = chartLeft + 10;
|
|
5465
|
+
const buttonY = lineY - buttonSize / 2;
|
|
5466
|
+
ctx.save();
|
|
5467
|
+
ctx.fillStyle = color;
|
|
5468
|
+
fillRoundedRect(Math.round(buttonX), Math.round(buttonY), buttonSize, buttonSize, 3);
|
|
5469
|
+
drawTrashGlyph(buttonX + buttonSize / 2, lineY, fontSize, inkColor);
|
|
5470
|
+
ctx.restore();
|
|
5449
5471
|
alertRegions.push({
|
|
5450
5472
|
id: alert.id,
|
|
5451
|
-
x:
|
|
5452
|
-
y:
|
|
5453
|
-
width:
|
|
5454
|
-
height:
|
|
5473
|
+
x: buttonX,
|
|
5474
|
+
y: buttonY,
|
|
5475
|
+
width: buttonSize,
|
|
5476
|
+
height: buttonSize,
|
|
5455
5477
|
part: "remove"
|
|
5456
5478
|
});
|
|
5457
5479
|
}
|
|
5458
|
-
|
|
5459
|
-
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth - removeWidth, height: labelHeight, part: "line" });
|
|
5480
|
+
alertRegions.push({ id: alert.id, x: labelX, y: labelY, width: labelWidth, height: labelHeight, part: "line" });
|
|
5460
5481
|
alertRegions.push({ id: alert.id, x: chartLeft, y: lineY - 5, width: chartRight - chartLeft, height: 10, part: "line" });
|
|
5461
5482
|
};
|
|
5462
5483
|
const drawOrderLine = (line, yFromPrice, chartLeft, chartTop, chartRight, chartBottom) => {
|