hyperprop-charting-library 0.1.18 → 0.1.19
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 +11 -1
- package/dist/hyperprop-charting-library.d.ts +1 -0
- package/dist/hyperprop-charting-library.js +11 -1
- package/dist/index.cjs +11 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -1
- package/docs/API.md +1 -0
- package/package.json +1 -1
|
@@ -104,6 +104,7 @@ var DEFAULT_ORDER_LINE_OPTIONS = {
|
|
|
104
104
|
labelBorderRadius: 3,
|
|
105
105
|
showCloseButton: true,
|
|
106
106
|
widgetPosition: "left",
|
|
107
|
+
widgetPaddingRight: 10,
|
|
107
108
|
draggable: false,
|
|
108
109
|
actionButtonAction: "execute",
|
|
109
110
|
actionButtonTextColor: "#dbeafe",
|
|
@@ -630,7 +631,16 @@ function createChart(element, options = {}) {
|
|
|
630
631
|
const closeWidth = showCloseButton ? 24 : 0;
|
|
631
632
|
const mainWidgetWidth = qtyWidth + centerWidth + closeWidth;
|
|
632
633
|
const totalWidth = mainWidgetWidth + actionButtonsGap + actionButtonsTotalWidth;
|
|
633
|
-
const
|
|
634
|
+
const crosshair = { ...DEFAULT_CROSSHAIR_OPTIONS, ...mergedOptions.crosshair ?? {} };
|
|
635
|
+
const crosshairActionInset = crosshair.visible && crosshair.showPriceLabel && crosshair.showPriceActionButton ? Math.max(
|
|
636
|
+
0,
|
|
637
|
+
Math.round(crosshair.priceActionButtonGap) + (clamp(Math.round(crosshair.priceActionButtonSize), 12, Math.max(12, labelHeight - 4)) + 10) - 4
|
|
638
|
+
) + 6 : 0;
|
|
639
|
+
const rightMarginInsideChart = Math.max(
|
|
640
|
+
0,
|
|
641
|
+
mergedLine.widgetPaddingRight,
|
|
642
|
+
crosshairActionInset
|
|
643
|
+
);
|
|
634
644
|
const maxWidgetX = chartRight - totalWidth - rightMarginInsideChart;
|
|
635
645
|
const leftWidgetXBase = chartLeft + 8;
|
|
636
646
|
let leftWidgetX = leftWidgetXBase;
|
|
@@ -126,6 +126,7 @@ interface OrderLineOptions {
|
|
|
126
126
|
labelBorderRadius?: number;
|
|
127
127
|
showCloseButton?: boolean;
|
|
128
128
|
widgetPosition?: "left" | "center" | "right";
|
|
129
|
+
widgetPaddingRight?: number;
|
|
129
130
|
draggable?: boolean;
|
|
130
131
|
actionButtonText?: string;
|
|
131
132
|
actionButtonAction?: "execute" | "cancel" | "close" | string;
|
|
@@ -80,6 +80,7 @@ var DEFAULT_ORDER_LINE_OPTIONS = {
|
|
|
80
80
|
labelBorderRadius: 3,
|
|
81
81
|
showCloseButton: true,
|
|
82
82
|
widgetPosition: "left",
|
|
83
|
+
widgetPaddingRight: 10,
|
|
83
84
|
draggable: false,
|
|
84
85
|
actionButtonAction: "execute",
|
|
85
86
|
actionButtonTextColor: "#dbeafe",
|
|
@@ -606,7 +607,16 @@ function createChart(element, options = {}) {
|
|
|
606
607
|
const closeWidth = showCloseButton ? 24 : 0;
|
|
607
608
|
const mainWidgetWidth = qtyWidth + centerWidth + closeWidth;
|
|
608
609
|
const totalWidth = mainWidgetWidth + actionButtonsGap + actionButtonsTotalWidth;
|
|
609
|
-
const
|
|
610
|
+
const crosshair = { ...DEFAULT_CROSSHAIR_OPTIONS, ...mergedOptions.crosshair ?? {} };
|
|
611
|
+
const crosshairActionInset = crosshair.visible && crosshair.showPriceLabel && crosshair.showPriceActionButton ? Math.max(
|
|
612
|
+
0,
|
|
613
|
+
Math.round(crosshair.priceActionButtonGap) + (clamp(Math.round(crosshair.priceActionButtonSize), 12, Math.max(12, labelHeight - 4)) + 10) - 4
|
|
614
|
+
) + 6 : 0;
|
|
615
|
+
const rightMarginInsideChart = Math.max(
|
|
616
|
+
0,
|
|
617
|
+
mergedLine.widgetPaddingRight,
|
|
618
|
+
crosshairActionInset
|
|
619
|
+
);
|
|
610
620
|
const maxWidgetX = chartRight - totalWidth - rightMarginInsideChart;
|
|
611
621
|
const leftWidgetXBase = chartLeft + 8;
|
|
612
622
|
let leftWidgetX = leftWidgetXBase;
|
package/dist/index.cjs
CHANGED
|
@@ -104,6 +104,7 @@ var DEFAULT_ORDER_LINE_OPTIONS = {
|
|
|
104
104
|
labelBorderRadius: 3,
|
|
105
105
|
showCloseButton: true,
|
|
106
106
|
widgetPosition: "left",
|
|
107
|
+
widgetPaddingRight: 10,
|
|
107
108
|
draggable: false,
|
|
108
109
|
actionButtonAction: "execute",
|
|
109
110
|
actionButtonTextColor: "#dbeafe",
|
|
@@ -630,7 +631,16 @@ function createChart(element, options = {}) {
|
|
|
630
631
|
const closeWidth = showCloseButton ? 24 : 0;
|
|
631
632
|
const mainWidgetWidth = qtyWidth + centerWidth + closeWidth;
|
|
632
633
|
const totalWidth = mainWidgetWidth + actionButtonsGap + actionButtonsTotalWidth;
|
|
633
|
-
const
|
|
634
|
+
const crosshair = { ...DEFAULT_CROSSHAIR_OPTIONS, ...mergedOptions.crosshair ?? {} };
|
|
635
|
+
const crosshairActionInset = crosshair.visible && crosshair.showPriceLabel && crosshair.showPriceActionButton ? Math.max(
|
|
636
|
+
0,
|
|
637
|
+
Math.round(crosshair.priceActionButtonGap) + (clamp(Math.round(crosshair.priceActionButtonSize), 12, Math.max(12, labelHeight - 4)) + 10) - 4
|
|
638
|
+
) + 6 : 0;
|
|
639
|
+
const rightMarginInsideChart = Math.max(
|
|
640
|
+
0,
|
|
641
|
+
mergedLine.widgetPaddingRight,
|
|
642
|
+
crosshairActionInset
|
|
643
|
+
);
|
|
634
644
|
const maxWidgetX = chartRight - totalWidth - rightMarginInsideChart;
|
|
635
645
|
const leftWidgetXBase = chartLeft + 8;
|
|
636
646
|
let leftWidgetX = leftWidgetXBase;
|
package/dist/index.d.cts
CHANGED
|
@@ -126,6 +126,7 @@ interface OrderLineOptions {
|
|
|
126
126
|
labelBorderRadius?: number;
|
|
127
127
|
showCloseButton?: boolean;
|
|
128
128
|
widgetPosition?: "left" | "center" | "right";
|
|
129
|
+
widgetPaddingRight?: number;
|
|
129
130
|
draggable?: boolean;
|
|
130
131
|
actionButtonText?: string;
|
|
131
132
|
actionButtonAction?: "execute" | "cancel" | "close" | string;
|
package/dist/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ interface OrderLineOptions {
|
|
|
126
126
|
labelBorderRadius?: number;
|
|
127
127
|
showCloseButton?: boolean;
|
|
128
128
|
widgetPosition?: "left" | "center" | "right";
|
|
129
|
+
widgetPaddingRight?: number;
|
|
129
130
|
draggable?: boolean;
|
|
130
131
|
actionButtonText?: string;
|
|
131
132
|
actionButtonAction?: "execute" | "cancel" | "close" | string;
|
package/dist/index.js
CHANGED
|
@@ -80,6 +80,7 @@ var DEFAULT_ORDER_LINE_OPTIONS = {
|
|
|
80
80
|
labelBorderRadius: 3,
|
|
81
81
|
showCloseButton: true,
|
|
82
82
|
widgetPosition: "left",
|
|
83
|
+
widgetPaddingRight: 10,
|
|
83
84
|
draggable: false,
|
|
84
85
|
actionButtonAction: "execute",
|
|
85
86
|
actionButtonTextColor: "#dbeafe",
|
|
@@ -606,7 +607,16 @@ function createChart(element, options = {}) {
|
|
|
606
607
|
const closeWidth = showCloseButton ? 24 : 0;
|
|
607
608
|
const mainWidgetWidth = qtyWidth + centerWidth + closeWidth;
|
|
608
609
|
const totalWidth = mainWidgetWidth + actionButtonsGap + actionButtonsTotalWidth;
|
|
609
|
-
const
|
|
610
|
+
const crosshair = { ...DEFAULT_CROSSHAIR_OPTIONS, ...mergedOptions.crosshair ?? {} };
|
|
611
|
+
const crosshairActionInset = crosshair.visible && crosshair.showPriceLabel && crosshair.showPriceActionButton ? Math.max(
|
|
612
|
+
0,
|
|
613
|
+
Math.round(crosshair.priceActionButtonGap) + (clamp(Math.round(crosshair.priceActionButtonSize), 12, Math.max(12, labelHeight - 4)) + 10) - 4
|
|
614
|
+
) + 6 : 0;
|
|
615
|
+
const rightMarginInsideChart = Math.max(
|
|
616
|
+
0,
|
|
617
|
+
mergedLine.widgetPaddingRight,
|
|
618
|
+
crosshairActionInset
|
|
619
|
+
);
|
|
610
620
|
const maxWidgetX = chartRight - totalWidth - rightMarginInsideChart;
|
|
611
621
|
const leftWidgetXBase = chartLeft + 8;
|
|
612
622
|
let leftWidgetX = leftWidgetXBase;
|
package/docs/API.md
CHANGED
|
@@ -205,6 +205,7 @@ Common optional fields:
|
|
|
205
205
|
- `labelBorderRadius?: number` (default `3`)
|
|
206
206
|
- `showCloseButton?: boolean` (default `true`)
|
|
207
207
|
- `widgetPosition?: "left" | "center" | "right"` (default `"left"`)
|
|
208
|
+
- `widgetPaddingRight?: number` (default `10`, extra right margin when `widgetPosition` is `"right"`)
|
|
208
209
|
- `draggable?: boolean` (default `false`)
|
|
209
210
|
|
|
210
211
|
Legacy single action button:
|