minerva-design 1.6.0 → 1.7.0

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.
Files changed (120) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/charts/engine/data.cjs +1 -1
  3. package/dist/charts/engine/data.cjs.map +1 -1
  4. package/dist/charts/engine/data.d.cts +2 -0
  5. package/dist/charts/engine/data.d.ts +2 -0
  6. package/dist/charts/engine/data.js +6 -4
  7. package/dist/charts/engine/data.js.map +1 -1
  8. package/dist/charts/engine/defaults.cjs +1 -1
  9. package/dist/charts/engine/defaults.cjs.map +1 -1
  10. package/dist/charts/engine/defaults.js +22 -18
  11. package/dist/charts/engine/defaults.js.map +1 -1
  12. package/dist/charts/engine/graph/chart.cjs +1 -1
  13. package/dist/charts/engine/graph/chart.cjs.map +1 -1
  14. package/dist/charts/engine/graph/chart.js +532 -493
  15. package/dist/charts/engine/graph/chart.js.map +1 -1
  16. package/dist/charts/engine/graph/geometry.cjs +1 -1
  17. package/dist/charts/engine/graph/geometry.cjs.map +1 -1
  18. package/dist/charts/engine/graph/geometry.d.cts +12 -2
  19. package/dist/charts/engine/graph/geometry.d.ts +12 -2
  20. package/dist/charts/engine/graph/geometry.js +35 -31
  21. package/dist/charts/engine/graph/geometry.js.map +1 -1
  22. package/dist/charts/engine/model.cjs +1 -1
  23. package/dist/charts/engine/model.cjs.map +1 -1
  24. package/dist/charts/engine/model.js +95 -74
  25. package/dist/charts/engine/model.js.map +1 -1
  26. package/dist/charts/engine/orderbook/field.cjs +1 -1
  27. package/dist/charts/engine/orderbook/field.cjs.map +1 -1
  28. package/dist/charts/engine/orderbook/field.d.cts +15 -2
  29. package/dist/charts/engine/orderbook/field.d.ts +15 -2
  30. package/dist/charts/engine/orderbook/field.js +21 -9
  31. package/dist/charts/engine/orderbook/field.js.map +1 -1
  32. package/dist/charts/engine/orderbook/heatmap.cjs +1 -1
  33. package/dist/charts/engine/orderbook/heatmap.cjs.map +1 -1
  34. package/dist/charts/engine/orderbook/heatmap.d.cts +29 -0
  35. package/dist/charts/engine/orderbook/heatmap.d.ts +29 -0
  36. package/dist/charts/engine/orderbook/heatmap.js +576 -453
  37. package/dist/charts/engine/orderbook/heatmap.js.map +1 -1
  38. package/dist/charts/engine/orderbook/types.d.cts +36 -11
  39. package/dist/charts/engine/orderbook/types.d.ts +36 -11
  40. package/dist/charts/engine/presets.cjs +1 -1
  41. package/dist/charts/engine/presets.cjs.map +1 -1
  42. package/dist/charts/engine/presets.d.cts +16 -3
  43. package/dist/charts/engine/presets.d.ts +16 -3
  44. package/dist/charts/engine/presets.js +42 -32
  45. package/dist/charts/engine/presets.js.map +1 -1
  46. package/dist/charts/engine/scene.cjs +1 -1
  47. package/dist/charts/engine/scene.cjs.map +1 -1
  48. package/dist/charts/engine/scene.d.cts +4 -2
  49. package/dist/charts/engine/scene.d.ts +4 -2
  50. package/dist/charts/engine/scene.js +185 -107
  51. package/dist/charts/engine/scene.js.map +1 -1
  52. package/dist/charts/engine/three-d/oit.cjs +119 -34
  53. package/dist/charts/engine/three-d/oit.cjs.map +1 -1
  54. package/dist/charts/engine/three-d/oit.d.cts +65 -10
  55. package/dist/charts/engine/three-d/oit.d.ts +65 -10
  56. package/dist/charts/engine/three-d/oit.js +119 -34
  57. package/dist/charts/engine/three-d/oit.js.map +1 -1
  58. package/dist/charts/engine/three-d/render-types.cjs.map +1 -1
  59. package/dist/charts/engine/three-d/render-types.d.cts +19 -0
  60. package/dist/charts/engine/three-d/render-types.d.ts +19 -0
  61. package/dist/charts/engine/three-d/render-types.js.map +1 -1
  62. package/dist/charts/engine/three-d/shaders.cjs +14 -6
  63. package/dist/charts/engine/three-d/shaders.cjs.map +1 -1
  64. package/dist/charts/engine/three-d/shaders.d.cts +6 -1
  65. package/dist/charts/engine/three-d/shaders.d.ts +6 -1
  66. package/dist/charts/engine/three-d/shaders.js +40 -26
  67. package/dist/charts/engine/three-d/shaders.js.map +1 -1
  68. package/dist/charts/engine/three-d/webgl.cjs +1 -1
  69. package/dist/charts/engine/three-d/webgl.cjs.map +1 -1
  70. package/dist/charts/engine/three-d/webgl.js +167 -125
  71. package/dist/charts/engine/three-d/webgl.js.map +1 -1
  72. package/dist/charts/engine/three-d/webgpu.cjs +1 -1
  73. package/dist/charts/engine/three-d/webgpu.cjs.map +1 -1
  74. package/dist/charts/engine/three-d/webgpu.js +169 -140
  75. package/dist/charts/engine/three-d/webgpu.js.map +1 -1
  76. package/dist/charts/engine/trading/chart.cjs +1 -1
  77. package/dist/charts/engine/trading/chart.cjs.map +1 -1
  78. package/dist/charts/engine/trading/chart.js +1149 -1023
  79. package/dist/charts/engine/trading/chart.js.map +1 -1
  80. package/dist/charts/engine/trading/labels.cjs +1 -1
  81. package/dist/charts/engine/trading/labels.cjs.map +1 -1
  82. package/dist/charts/engine/trading/labels.js +12 -0
  83. package/dist/charts/engine/trading/labels.js.map +1 -1
  84. package/dist/charts/engine/trading/layout.cjs +2 -0
  85. package/dist/charts/engine/trading/layout.cjs.map +1 -0
  86. package/dist/charts/engine/trading/layout.d.cts +37 -0
  87. package/dist/charts/engine/trading/layout.d.ts +37 -0
  88. package/dist/charts/engine/trading/layout.js +63 -0
  89. package/dist/charts/engine/trading/layout.js.map +1 -0
  90. package/dist/charts/engine/trading/types.d.cts +24 -7
  91. package/dist/charts/engine/trading/types.d.ts +24 -7
  92. package/dist/charts/engine/types.d.cts +21 -8
  93. package/dist/charts/engine/types.d.ts +21 -8
  94. package/dist/core/contracts.cjs +1 -1
  95. package/dist/core/contracts.cjs.map +1 -1
  96. package/dist/core/contracts.js +1 -1
  97. package/dist/core/contracts.js.map +1 -1
  98. package/dist/native/charts/src/engine/data.cjs +1 -1
  99. package/dist/native/charts/src/engine/data.cjs.map +1 -1
  100. package/dist/native/charts/src/engine/data.js +6 -4
  101. package/dist/native/charts/src/engine/data.js.map +1 -1
  102. package/dist/native/charts/src/engine/model.cjs +1 -1
  103. package/dist/native/charts/src/engine/model.cjs.map +1 -1
  104. package/dist/native/charts/src/engine/model.js +104 -83
  105. package/dist/native/charts/src/engine/model.js.map +1 -1
  106. package/dist/native/charts/src/engine/presets.cjs +1 -1
  107. package/dist/native/charts/src/engine/presets.cjs.map +1 -1
  108. package/dist/native/charts/src/engine/presets.js +42 -32
  109. package/dist/native/charts/src/engine/presets.js.map +1 -1
  110. package/dist/native/charts/src/engine/scene.cjs +1 -1
  111. package/dist/native/charts/src/engine/scene.cjs.map +1 -1
  112. package/dist/native/charts/src/engine/scene.js +185 -107
  113. package/dist/native/charts/src/engine/scene.js.map +1 -1
  114. package/dist/taro/index.js +1263 -1152
  115. package/dist/vue/components/Chart/OrderBookHeatmap.vue.d.ts +11 -0
  116. package/dist/vue/components/Chart/orderbook.d.ts +7 -0
  117. package/dist/vue/components/Chart/orderbook.js +2 -0
  118. package/dist/vue/components/Chart/orderbook.js.map +1 -1
  119. package/dist/weapp/charts/canvas.js +234 -58
  120. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- var e={en:{open:`O`,high:`H`,low:`L`,close:`C`,change:``,volume:`Vol`,limit:`Limit`,position:`Position`,takeProfit:`TP`,stopLoss:`SL`,alert:`Alert`,scrollToRealtime:`Scroll to the latest bar`,toggleIndicator:`Show or hide {name}`,bars:`{count} bars`,days:`{count}d`,hours:`{count}h`,minutes:`{count}m`,chart:`{symbol} price chart`,announcement:`{time}: open {open}, high {high}, low {low}, close {close}`,ichimoku:`Ichimoku`,supertrend:`SuperTrend`,text:`Text`,color:`Color`,lineWidth:`Line width`,lineStyle:`Line style`,fill:`Fill`,editText:`Edit text`,lock:`Lock`,remove:`Delete`,target:`Target {price} ({change})`,stop:`Stop {price} ({change})`,riskReward:`R:R {ratio}`,profit:`P&L {value}`,long:`Long`,short:`Short`,replay:`Replay · {time}`,replayHint:`Click a bar to start the replay`,buyLimit:`Buy limit {price}`,sellLimit:`Sell limit {price}`,orderHint:`Arrows move the price, Enter confirms, Escape cancels`,orderCancelHint:`Delete cancels the order`,orderLine:`{title} at {price}`,orderPlaced:`Order placed at {price}`,orderCancelled:`Order cancelled`},zh:{open:`开`,high:`高`,low:`低`,close:`收`,change:`涨跌幅`,volume:`成交量`,limit:`限价`,position:`持仓`,takeProfit:`止盈`,stopLoss:`止损`,alert:`预警`,scrollToRealtime:`回到最新 K 线`,toggleIndicator:`显示或隐藏 {name}`,bars:`{count} 根 K 线`,days:`{count}天`,hours:`{count}小时`,minutes:`{count}分`,chart:`{symbol} 价格图表`,announcement:`{time}:开盘 {open},最高 {high},最低 {low},收盘 {close}`,ichimoku:`一目均衡表`,supertrend:`超级趋势`,text:`文本`,color:`颜色`,lineWidth:`线宽`,lineStyle:`线型`,fill:`填充`,editText:`编辑文本`,lock:`锁定`,remove:`删除`,target:`止盈 {price}({change})`,stop:`止损 {price}({change})`,riskReward:`盈亏比 {ratio}`,profit:`盈亏 {value}`,long:`做多`,short:`做空`,replay:`回放 · {time}`,replayHint:`点击一根 K 线开始回放`,buyLimit:`限价买入 {price}`,sellLimit:`限价卖出 {price}`,orderHint:`方向键调整价格,回车确认,Esc 取消`,orderCancelHint:`Delete 键撤销该订单`,orderLine:`{title},价格 {price}`,orderPlaced:`已在 {price} 下单`,orderCancelled:`订单已取消`},ja:{open:`始`,high:`高`,low:`安`,close:`終`,change:`騰落率`,volume:`出来高`,limit:`指値`,position:`建玉`,takeProfit:`利確`,stopLoss:`損切`,alert:`アラート`,scrollToRealtime:`最新の足へ移動`,toggleIndicator:`{name} の表示を切り替え`,bars:`{count} 本`,days:`{count}日`,hours:`{count}時間`,minutes:`{count}分`,chart:`{symbol} 価格チャート`,announcement:`{time}:始値 {open}、高値 {high}、安値 {low}、終値 {close}`,ichimoku:`一目均衡表`,supertrend:`スーパートレンド`,text:`テキスト`,color:`色`,lineWidth:`線の太さ`,lineStyle:`線の種類`,fill:`塗りつぶし`,editText:`テキストを編集`,lock:`ロック`,remove:`削除`,target:`利確 {price}({change})`,stop:`損切 {price}({change})`,riskReward:`リスクリワード {ratio}`,profit:`損益 {value}`,long:`ロング`,short:`ショート`,replay:`リプレイ · {time}`,replayHint:`足をクリックしてリプレイを開始`,buyLimit:`指値買い {price}`,sellLimit:`指値売り {price}`,orderHint:`矢印キーで価格を調整、Enter で確定、Esc で取消`,orderCancelHint:`Delete キーで注文を取消`,orderLine:`{title}、価格 {price}`,orderPlaced:`{price} で注文しました`,orderCancelled:`注文を取り消しました`},fr:{open:`O`,high:`H`,low:`B`,close:`C`,change:`Var.`,volume:`Vol`,limit:`Limite`,position:`Position`,takeProfit:`TP`,stopLoss:`SL`,alert:`Alerte`,scrollToRealtime:`Revenir à la dernière bougie`,toggleIndicator:`Afficher ou masquer {name}`,bars:`{count} barres`,days:`{count} j`,hours:`{count} h`,minutes:`{count} min`,chart:`Graphique de cours {symbol}`,announcement:`{time} : ouverture {open}, plus haut {high}, plus bas {low}, clôture {close}`,ichimoku:`Ichimoku`,supertrend:`SuperTrend`,text:`Texte`,color:`Couleur`,lineWidth:`Épaisseur`,lineStyle:`Style de trait`,fill:`Remplissage`,editText:`Modifier le texte`,lock:`Verrouiller`,remove:`Supprimer`,target:`Objectif {price} ({change})`,stop:`Stop {price} ({change})`,riskReward:`R/R {ratio}`,profit:`P&L {value}`,long:`Achat`,short:`Vente`,replay:`Relecture · {time}`,replayHint:`Cliquez sur une barre pour lancer la relecture`,buyLimit:`Achat limite {price}`,sellLimit:`Vente limite {price}`,orderHint:`Les flèches déplacent le prix, Entrée valide, Échap annule`,orderCancelHint:`Suppr annule l’ordre`,orderLine:`{title} à {price}`,orderPlaced:`Ordre placé à {price}`,orderCancelled:`Ordre annulé`}},t=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e);exports.TRADING_LABELS=e,exports.fill=t;
1
+ var e={en:{open:`O`,high:`H`,low:`L`,close:`C`,change:``,volume:`Vol`,limit:`Limit`,position:`Position`,takeProfit:`TP`,stopLoss:`SL`,alert:`Alert`,scrollToRealtime:`Scroll to the latest bar`,toggleIndicator:`Show or hide {name}`,bars:`{count} bars`,days:`{count}d`,hours:`{count}h`,minutes:`{count}m`,chart:`{symbol} price chart`,announcement:`{time}: open {open}, high {high}, low {low}, close {close}`,ichimoku:`Ichimoku`,supertrend:`SuperTrend`,text:`Text`,color:`Color`,lineWidth:`Line width`,lineStyle:`Line style`,fill:`Fill`,editText:`Edit text`,lock:`Lock`,remove:`Delete`,target:`Target {price} ({change})`,stop:`Stop {price} ({change})`,riskReward:`R:R {ratio}`,profit:`P&L {value}`,long:`Long`,short:`Short`,replay:`Replay · {time}`,replayHint:`Click a bar to start the replay`,buyLimit:`Buy limit {price}`,sellLimit:`Sell limit {price}`,buyStop:`Buy stop {price}`,sellStop:`Sell stop {price}`,orderHint:`Arrows move the price, Enter confirms, Escape cancels`,orderTypeHint:`Alt+B or Alt+S switches between limit and stop`,orderCancelHint:`Delete cancels the order`,orderLine:`{title} at {price}`,orderPlaced:`Order placed at {price}`,orderCancelled:`Order cancelled`},zh:{open:`开`,high:`高`,low:`低`,close:`收`,change:`涨跌幅`,volume:`成交量`,limit:`限价`,position:`持仓`,takeProfit:`止盈`,stopLoss:`止损`,alert:`预警`,scrollToRealtime:`回到最新 K 线`,toggleIndicator:`显示或隐藏 {name}`,bars:`{count} 根 K 线`,days:`{count}天`,hours:`{count}小时`,minutes:`{count}分`,chart:`{symbol} 价格图表`,announcement:`{time}:开盘 {open},最高 {high},最低 {low},收盘 {close}`,ichimoku:`一目均衡表`,supertrend:`超级趋势`,text:`文本`,color:`颜色`,lineWidth:`线宽`,lineStyle:`线型`,fill:`填充`,editText:`编辑文本`,lock:`锁定`,remove:`删除`,target:`止盈 {price}({change})`,stop:`止损 {price}({change})`,riskReward:`盈亏比 {ratio}`,profit:`盈亏 {value}`,long:`做多`,short:`做空`,replay:`回放 · {time}`,replayHint:`点击一根 K 线开始回放`,buyLimit:`限价买入 {price}`,sellLimit:`限价卖出 {price}`,buyStop:`止损买入 {price}`,sellStop:`止损卖出 {price}`,orderHint:`方向键调整价格,回车确认,Esc 取消`,orderTypeHint:`Alt+B 或 Alt+S 切换限价单与止损单`,orderCancelHint:`Delete 键撤销该订单`,orderLine:`{title},价格 {price}`,orderPlaced:`已在 {price} 下单`,orderCancelled:`订单已取消`},ja:{open:`始`,high:`高`,low:`安`,close:`終`,change:`騰落率`,volume:`出来高`,limit:`指値`,position:`建玉`,takeProfit:`利確`,stopLoss:`損切`,alert:`アラート`,scrollToRealtime:`最新の足へ移動`,toggleIndicator:`{name} の表示を切り替え`,bars:`{count} 本`,days:`{count}日`,hours:`{count}時間`,minutes:`{count}分`,chart:`{symbol} 価格チャート`,announcement:`{time}:始値 {open}、高値 {high}、安値 {low}、終値 {close}`,ichimoku:`一目均衡表`,supertrend:`スーパートレンド`,text:`テキスト`,color:`色`,lineWidth:`線の太さ`,lineStyle:`線の種類`,fill:`塗りつぶし`,editText:`テキストを編集`,lock:`ロック`,remove:`削除`,target:`利確 {price}({change})`,stop:`損切 {price}({change})`,riskReward:`リスクリワード {ratio}`,profit:`損益 {value}`,long:`ロング`,short:`ショート`,replay:`リプレイ · {time}`,replayHint:`足をクリックしてリプレイを開始`,buyLimit:`指値買い {price}`,sellLimit:`指値売り {price}`,buyStop:`逆指値買い {price}`,sellStop:`逆指値売り {price}`,orderHint:`矢印キーで価格を調整、Enter で確定、Esc で取消`,orderTypeHint:`Alt+B または Alt+S で指値と逆指値を切り替え`,orderCancelHint:`Delete キーで注文を取消`,orderLine:`{title}、価格 {price}`,orderPlaced:`{price} で注文しました`,orderCancelled:`注文を取り消しました`},fr:{open:`O`,high:`H`,low:`B`,close:`C`,change:`Var.`,volume:`Vol`,limit:`Limite`,position:`Position`,takeProfit:`TP`,stopLoss:`SL`,alert:`Alerte`,scrollToRealtime:`Revenir à la dernière bougie`,toggleIndicator:`Afficher ou masquer {name}`,bars:`{count} barres`,days:`{count} j`,hours:`{count} h`,minutes:`{count} min`,chart:`Graphique de cours {symbol}`,announcement:`{time} : ouverture {open}, plus haut {high}, plus bas {low}, clôture {close}`,ichimoku:`Ichimoku`,supertrend:`SuperTrend`,text:`Texte`,color:`Couleur`,lineWidth:`Épaisseur`,lineStyle:`Style de trait`,fill:`Remplissage`,editText:`Modifier le texte`,lock:`Verrouiller`,remove:`Supprimer`,target:`Objectif {price} ({change})`,stop:`Stop {price} ({change})`,riskReward:`R/R {ratio}`,profit:`P&L {value}`,long:`Achat`,short:`Vente`,replay:`Relecture · {time}`,replayHint:`Cliquez sur une barre pour lancer la relecture`,buyLimit:`Achat limite {price}`,sellLimit:`Vente limite {price}`,buyStop:`Achat stop {price}`,sellStop:`Vente stop {price}`,orderHint:`Les flèches déplacent le prix, Entrée valide, Échap annule`,orderTypeHint:`Alt+B ou Alt+S bascule entre limite et stop`,orderCancelHint:`Suppr annule l’ordre`,orderLine:`{title} à {price}`,orderPlaced:`Ordre placé à {price}`,orderCancelled:`Ordre annulé`}},t=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e);exports.TRADING_LABELS=e,exports.fill=t;
2
2
  //# sourceMappingURL=labels.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"labels.cjs","names":["TRADING_LABELS","fill","template","key","values","match"],"sources":["../../../../../charts/src/engine/trading/labels.ts"],"sourcesContent":["// Built-in texts of the trading chart, per language (see ../locale.ts).\n\nimport type { LabelDictionary } from \"../locale\";\nimport type { TradingChartLabels } from \"./types\";\n\n/** Every text of the chart but the timeframe (taken from the options) */\nexport type TradingTexts = Required<Omit<TradingChartLabels, \"timeframe\">>;\n\nexport const TRADING_LABELS: LabelDictionary<TradingTexts> = {\n en: {\n open: \"O\",\n high: \"H\",\n low: \"L\",\n close: \"C\",\n change: \"\",\n volume: \"Vol\",\n limit: \"Limit\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alert\",\n scrollToRealtime: \"Scroll to the latest bar\",\n toggleIndicator: \"Show or hide {name}\",\n bars: \"{count} bars\",\n days: \"{count}d\",\n hours: \"{count}h\",\n minutes: \"{count}m\",\n chart: \"{symbol} price chart\",\n announcement: \"{time}: open {open}, high {high}, low {low}, close {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Text\",\n color: \"Color\",\n lineWidth: \"Line width\",\n lineStyle: \"Line style\",\n fill: \"Fill\",\n editText: \"Edit text\",\n lock: \"Lock\",\n remove: \"Delete\",\n target: \"Target {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R:R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Long\",\n short: \"Short\",\n replay: \"Replay · {time}\",\n replayHint: \"Click a bar to start the replay\",\n buyLimit: \"Buy limit {price}\",\n sellLimit: \"Sell limit {price}\",\n orderHint: \"Arrows move the price, Enter confirms, Escape cancels\",\n orderCancelHint: \"Delete cancels the order\",\n orderLine: \"{title} at {price}\",\n orderPlaced: \"Order placed at {price}\",\n orderCancelled: \"Order cancelled\",\n },\n zh: {\n open: \"开\",\n high: \"高\",\n low: \"低\",\n close: \"收\",\n change: \"涨跌幅\",\n volume: \"成交量\",\n limit: \"限价\",\n position: \"持仓\",\n takeProfit: \"止盈\",\n stopLoss: \"止损\",\n alert: \"预警\",\n scrollToRealtime: \"回到最新 K 线\",\n toggleIndicator: \"显示或隐藏 {name}\",\n bars: \"{count} 根 K 线\",\n days: \"{count}天\",\n hours: \"{count}小时\",\n minutes: \"{count}分\",\n chart: \"{symbol} 价格图表\",\n announcement: \"{time}:开盘 {open},最高 {high},最低 {low},收盘 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"超级趋势\",\n text: \"文本\",\n color: \"颜色\",\n lineWidth: \"线宽\",\n lineStyle: \"线型\",\n fill: \"填充\",\n editText: \"编辑文本\",\n lock: \"锁定\",\n remove: \"删除\",\n target: \"止盈 {price}({change})\",\n stop: \"止损 {price}({change})\",\n riskReward: \"盈亏比 {ratio}\",\n profit: \"盈亏 {value}\",\n long: \"做多\",\n short: \"做空\",\n replay: \"回放 · {time}\",\n replayHint: \"点击一根 K 线开始回放\",\n buyLimit: \"限价买入 {price}\",\n sellLimit: \"限价卖出 {price}\",\n orderHint: \"方向键调整价格,回车确认,Esc 取消\",\n orderCancelHint: \"Delete 键撤销该订单\",\n orderLine: \"{title},价格 {price}\",\n orderPlaced: \"已在 {price} 下单\",\n orderCancelled: \"订单已取消\",\n },\n ja: {\n open: \"始\",\n high: \"高\",\n low: \"安\",\n close: \"終\",\n change: \"騰落率\",\n volume: \"出来高\",\n limit: \"指値\",\n position: \"建玉\",\n takeProfit: \"利確\",\n stopLoss: \"損切\",\n alert: \"アラート\",\n scrollToRealtime: \"最新の足へ移動\",\n toggleIndicator: \"{name} の表示を切り替え\",\n bars: \"{count} 本\",\n days: \"{count}日\",\n hours: \"{count}時間\",\n minutes: \"{count}分\",\n chart: \"{symbol} 価格チャート\",\n announcement: \"{time}:始値 {open}、高値 {high}、安値 {low}、終値 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"スーパートレンド\",\n text: \"テキスト\",\n color: \"色\",\n lineWidth: \"線の太さ\",\n lineStyle: \"線の種類\",\n fill: \"塗りつぶし\",\n editText: \"テキストを編集\",\n lock: \"ロック\",\n remove: \"削除\",\n target: \"利確 {price}({change})\",\n stop: \"損切 {price}({change})\",\n riskReward: \"リスクリワード {ratio}\",\n profit: \"損益 {value}\",\n long: \"ロング\",\n short: \"ショート\",\n replay: \"リプレイ · {time}\",\n replayHint: \"足をクリックしてリプレイを開始\",\n buyLimit: \"指値買い {price}\",\n sellLimit: \"指値売り {price}\",\n orderHint: \"矢印キーで価格を調整、Enter で確定、Esc で取消\",\n orderCancelHint: \"Delete キーで注文を取消\",\n orderLine: \"{title}、価格 {price}\",\n orderPlaced: \"{price} で注文しました\",\n orderCancelled: \"注文を取り消しました\",\n },\n fr: {\n open: \"O\",\n high: \"H\",\n low: \"B\",\n close: \"C\",\n change: \"Var.\",\n volume: \"Vol\",\n limit: \"Limite\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alerte\",\n scrollToRealtime: \"Revenir à la dernière bougie\",\n toggleIndicator: \"Afficher ou masquer {name}\",\n bars: \"{count} barres\",\n days: \"{count} j\",\n hours: \"{count} h\",\n minutes: \"{count} min\",\n chart: \"Graphique de cours {symbol}\",\n announcement:\n \"{time} : ouverture {open}, plus haut {high}, plus bas {low}, clôture {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Texte\",\n color: \"Couleur\",\n lineWidth: \"Épaisseur\",\n lineStyle: \"Style de trait\",\n fill: \"Remplissage\",\n editText: \"Modifier le texte\",\n lock: \"Verrouiller\",\n remove: \"Supprimer\",\n target: \"Objectif {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R/R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Achat\",\n short: \"Vente\",\n replay: \"Relecture · {time}\",\n replayHint: \"Cliquez sur une barre pour lancer la relecture\",\n buyLimit: \"Achat limite {price}\",\n sellLimit: \"Vente limite {price}\",\n orderHint: \"Les flèches déplacent le prix, Entrée valide, Échap annule\",\n orderCancelHint: \"Suppr annule l’ordre\",\n orderLine: \"{title} à {price}\",\n orderPlaced: \"Ordre placé à {price}\",\n orderCancelled: \"Ordre annulé\",\n },\n};\n\n/** `\"{count} bars\"` -> `\"24 bars\"` */\nexport const fill = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (match, key: string) =>\n key in values ? String(values[key]) : match,\n );\n"],"mappings":"AAQA,IAAaA,EAAgD,CAC3D,GAAI,CACF,KAAM,IACN,KAAM,IACN,IAAK,IACL,MAAO,IACP,OAAQ,GACR,OAAQ,MACR,MAAO,QACP,SAAU,WACV,WAAY,KACZ,SAAU,KACV,MAAO,QACP,iBAAkB,2BAClB,gBAAiB,sBACjB,KAAM,eACN,KAAM,WACN,MAAO,WACP,QAAS,WACT,MAAO,uBACP,aAAc,6DACd,SAAU,WACV,WAAY,aACZ,KAAM,OACN,MAAO,QACP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U,eACV,UAAW,eACX,UAAW,+BACX,gBAAiB,kBACjB,UAAW,qBACX,YAAa,kBACb,eAAgB,YAClB,EACA,GAAI,CACF,KAAM,IACN,KAAM,IACN,IAAK,IACL,MAAO,IACP,OAAQ,OACR,OAAQ,MACR,MAAO,SACP,SAAU,WACV,WAAY,KACZ,SAAU,KACV,MAAO,SACP,iBAAkB,+BAClB,gBAAiB,6BACjB,KAAM,iBACN,KAAM,YACN,MAAO,YACP,QAAS,cACT,MAAO,8BACP,aACE,+EACF,SAAU,WACV,WAAY,aACZ,KAAM,QACN,MAAO,UACP,UAAW,YACX,UAAW,iBACX,KAAM,cACN,SAAU,oBACV,KAAM,cACN,OAAQ,YACR,OAAQ,8BACR,KAAM,0BACN,WAAY,cACZ,OAAQ,cACR,KAAM,QACN,MAAO,QACP,OAAQ,qBACR,WAAY,iDACZ,SAAU,uBACV,UAAW,uBACX,UAAW,6DACX,gBAAiB,uBACjB,UAAW,oBACX,YAAa,wBACb,eAAgB,cAClB,CACF,EAGaC,GACX,EACA,IAEAC,EAAS,QAAQ,cAAe,EAAO,IACrCC,KAAOC,EAAS,OAAOA,EAAOD,EAAI,EAAIE,CACxC"}
1
+ {"version":3,"file":"labels.cjs","names":["TRADING_LABELS","fill","template","key","values","match"],"sources":["../../../../../charts/src/engine/trading/labels.ts"],"sourcesContent":["// Built-in texts of the trading chart, per language (see ../locale.ts).\n\nimport type { LabelDictionary } from \"../locale\";\nimport type { TradingChartLabels } from \"./types\";\n\n/** Every text of the chart but the timeframe (taken from the options) */\nexport type TradingTexts = Required<Omit<TradingChartLabels, \"timeframe\">>;\n\nexport const TRADING_LABELS: LabelDictionary<TradingTexts> = {\n en: {\n open: \"O\",\n high: \"H\",\n low: \"L\",\n close: \"C\",\n change: \"\",\n volume: \"Vol\",\n limit: \"Limit\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alert\",\n scrollToRealtime: \"Scroll to the latest bar\",\n toggleIndicator: \"Show or hide {name}\",\n bars: \"{count} bars\",\n days: \"{count}d\",\n hours: \"{count}h\",\n minutes: \"{count}m\",\n chart: \"{symbol} price chart\",\n announcement: \"{time}: open {open}, high {high}, low {low}, close {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Text\",\n color: \"Color\",\n lineWidth: \"Line width\",\n lineStyle: \"Line style\",\n fill: \"Fill\",\n editText: \"Edit text\",\n lock: \"Lock\",\n remove: \"Delete\",\n target: \"Target {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R:R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Long\",\n short: \"Short\",\n replay: \"Replay · {time}\",\n replayHint: \"Click a bar to start the replay\",\n buyLimit: \"Buy limit {price}\",\n sellLimit: \"Sell limit {price}\",\n buyStop: \"Buy stop {price}\",\n sellStop: \"Sell stop {price}\",\n orderHint: \"Arrows move the price, Enter confirms, Escape cancels\",\n orderTypeHint: \"Alt+B or Alt+S switches between limit and stop\",\n orderCancelHint: \"Delete cancels the order\",\n orderLine: \"{title} at {price}\",\n orderPlaced: \"Order placed at {price}\",\n orderCancelled: \"Order cancelled\",\n },\n zh: {\n open: \"开\",\n high: \"高\",\n low: \"低\",\n close: \"收\",\n change: \"涨跌幅\",\n volume: \"成交量\",\n limit: \"限价\",\n position: \"持仓\",\n takeProfit: \"止盈\",\n stopLoss: \"止损\",\n alert: \"预警\",\n scrollToRealtime: \"回到最新 K 线\",\n toggleIndicator: \"显示或隐藏 {name}\",\n bars: \"{count} 根 K 线\",\n days: \"{count}天\",\n hours: \"{count}小时\",\n minutes: \"{count}分\",\n chart: \"{symbol} 价格图表\",\n announcement: \"{time}:开盘 {open},最高 {high},最低 {low},收盘 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"超级趋势\",\n text: \"文本\",\n color: \"颜色\",\n lineWidth: \"线宽\",\n lineStyle: \"线型\",\n fill: \"填充\",\n editText: \"编辑文本\",\n lock: \"锁定\",\n remove: \"删除\",\n target: \"止盈 {price}({change})\",\n stop: \"止损 {price}({change})\",\n riskReward: \"盈亏比 {ratio}\",\n profit: \"盈亏 {value}\",\n long: \"做多\",\n short: \"做空\",\n replay: \"回放 · {time}\",\n replayHint: \"点击一根 K 线开始回放\",\n buyLimit: \"限价买入 {price}\",\n sellLimit: \"限价卖出 {price}\",\n buyStop: \"止损买入 {price}\",\n sellStop: \"止损卖出 {price}\",\n orderHint: \"方向键调整价格,回车确认,Esc 取消\",\n orderTypeHint: \"Alt+B 或 Alt+S 切换限价单与止损单\",\n orderCancelHint: \"Delete 键撤销该订单\",\n orderLine: \"{title},价格 {price}\",\n orderPlaced: \"已在 {price} 下单\",\n orderCancelled: \"订单已取消\",\n },\n ja: {\n open: \"始\",\n high: \"高\",\n low: \"安\",\n close: \"終\",\n change: \"騰落率\",\n volume: \"出来高\",\n limit: \"指値\",\n position: \"建玉\",\n takeProfit: \"利確\",\n stopLoss: \"損切\",\n alert: \"アラート\",\n scrollToRealtime: \"最新の足へ移動\",\n toggleIndicator: \"{name} の表示を切り替え\",\n bars: \"{count} 本\",\n days: \"{count}日\",\n hours: \"{count}時間\",\n minutes: \"{count}分\",\n chart: \"{symbol} 価格チャート\",\n announcement: \"{time}:始値 {open}、高値 {high}、安値 {low}、終値 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"スーパートレンド\",\n text: \"テキスト\",\n color: \"色\",\n lineWidth: \"線の太さ\",\n lineStyle: \"線の種類\",\n fill: \"塗りつぶし\",\n editText: \"テキストを編集\",\n lock: \"ロック\",\n remove: \"削除\",\n target: \"利確 {price}({change})\",\n stop: \"損切 {price}({change})\",\n riskReward: \"リスクリワード {ratio}\",\n profit: \"損益 {value}\",\n long: \"ロング\",\n short: \"ショート\",\n replay: \"リプレイ · {time}\",\n replayHint: \"足をクリックしてリプレイを開始\",\n buyLimit: \"指値買い {price}\",\n sellLimit: \"指値売り {price}\",\n buyStop: \"逆指値買い {price}\",\n sellStop: \"逆指値売り {price}\",\n orderHint: \"矢印キーで価格を調整、Enter で確定、Esc で取消\",\n orderTypeHint: \"Alt+B または Alt+S で指値と逆指値を切り替え\",\n orderCancelHint: \"Delete キーで注文を取消\",\n orderLine: \"{title}、価格 {price}\",\n orderPlaced: \"{price} で注文しました\",\n orderCancelled: \"注文を取り消しました\",\n },\n fr: {\n open: \"O\",\n high: \"H\",\n low: \"B\",\n close: \"C\",\n change: \"Var.\",\n volume: \"Vol\",\n limit: \"Limite\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alerte\",\n scrollToRealtime: \"Revenir à la dernière bougie\",\n toggleIndicator: \"Afficher ou masquer {name}\",\n bars: \"{count} barres\",\n days: \"{count} j\",\n hours: \"{count} h\",\n minutes: \"{count} min\",\n chart: \"Graphique de cours {symbol}\",\n announcement:\n \"{time} : ouverture {open}, plus haut {high}, plus bas {low}, clôture {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Texte\",\n color: \"Couleur\",\n lineWidth: \"Épaisseur\",\n lineStyle: \"Style de trait\",\n fill: \"Remplissage\",\n editText: \"Modifier le texte\",\n lock: \"Verrouiller\",\n remove: \"Supprimer\",\n target: \"Objectif {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R/R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Achat\",\n short: \"Vente\",\n replay: \"Relecture · {time}\",\n replayHint: \"Cliquez sur une barre pour lancer la relecture\",\n buyLimit: \"Achat limite {price}\",\n sellLimit: \"Vente limite {price}\",\n buyStop: \"Achat stop {price}\",\n sellStop: \"Vente stop {price}\",\n orderHint: \"Les flèches déplacent le prix, Entrée valide, Échap annule\",\n orderTypeHint: \"Alt+B ou Alt+S bascule entre limite et stop\",\n orderCancelHint: \"Suppr annule l’ordre\",\n orderLine: \"{title} à {price}\",\n orderPlaced: \"Ordre placé à {price}\",\n orderCancelled: \"Ordre annulé\",\n },\n};\n\n/** `\"{count} bars\"` -> `\"24 bars\"` */\nexport const fill = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (match, key: string) =>\n key in values ? String(values[key]) : match,\n );\n"],"mappings":"AAQA,IAAaA,EAAgD,CAC3D,GAAI,CACF,KAAM,IACN,KAAM,IACN,IAAK,IACL,MAAO,IACP,OAAQ,GACR,OAAQ,MACR,MAAO,QACP,SAAU,WACV,WAAY,KACZ,SAAU,KACV,MAAO,QACP,iBAAkB,2BAClB,gBAAiB,sBACjB,KAAM,eACN,KAAM,WACN,MAAO,WACP,QAAS,WACT,MAAO,uBACP,aAAc,6DACd,SAAU,WACV,WAAY,aACZ,KAAM,OACN,MAAO,QACP,UAAW,aACX,UAAW,aACX,KAAM,OACN,SAAU,YACV,KAAM,OACN,OAAQ,SACR,OAAQ,4BACR,KAAM,0BACN,WAAY,cACZ,OAAQ,cACR,KAAM,OACN,MAAO,QACP,OAAQ,kBACR,WAAY,kCACZ,SAAU,oBACV,UAAW,qBACX,QAAS,mBACT,SAAU,oBACV,UAAW,wDACX,cAAe,iDACf,gBAAiB,2BACjB,UAAW,qBACX,YAAa,0BACb,eAAgB,iBAClB,EACA,GAAI,CACF,KAAM,IACN,KAAM,IACN,IAAK,IACL,MAAO,IACP,OAAQ,MACR,OAAQ,MACR,MAAO,KACP,SAAU,KACV,WAAY,KACZ,SAAU,KACV,MAAO,KACP,iBAAkB,WAClB,gBAAiB,eACjB,KAAM,gBACN,KAAM,WACN,MAAO,YACP,QAAS,WACT,MAAO,gBACP,aAAc,iDACd,SAAU,QACV,WAAY,OACZ,KAAM,KACN,MAAO,KACP,UAAW,KACX,UAAW,KACX,KAAM,KACN,SAAU,OACV,KAAM,KACN,OAAQ,KACR,OAAQ,uBACR,KAAM,uBACN,WAAY,cACZ,OAAQ,aACR,KAAM,KACN,MAAO,KACP,OAAQ,cACR,WAAY,eACZ,SAAU,eACV,UAAW,eACX,QAAS,eACT,SAAU,eACV,UAAW,sBACX,cAAe,0BACf,gBAAiB,g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EAAO,IACrCC,KAAOC,EAAS,OAAOA,EAAOD,EAAI,EAAIE,CACxC"}
@@ -40,7 +40,10 @@ var e = {
40
40
  replayHint: "Click a bar to start the replay",
41
41
  buyLimit: "Buy limit {price}",
42
42
  sellLimit: "Sell limit {price}",
43
+ buyStop: "Buy stop {price}",
44
+ sellStop: "Sell stop {price}",
43
45
  orderHint: "Arrows move the price, Enter confirms, Escape cancels",
46
+ orderTypeHint: "Alt+B or Alt+S switches between limit and stop",
44
47
  orderCancelHint: "Delete cancels the order",
45
48
  orderLine: "{title} at {price}",
46
49
  orderPlaced: "Order placed at {price}",
@@ -86,7 +89,10 @@ var e = {
86
89
  replayHint: "点击一根 K 线开始回放",
87
90
  buyLimit: "限价买入 {price}",
88
91
  sellLimit: "限价卖出 {price}",
92
+ buyStop: "止损买入 {price}",
93
+ sellStop: "止损卖出 {price}",
89
94
  orderHint: "方向键调整价格,回车确认,Esc 取消",
95
+ orderTypeHint: "Alt+B 或 Alt+S 切换限价单与止损单",
90
96
  orderCancelHint: "Delete 键撤销该订单",
91
97
  orderLine: "{title},价格 {price}",
92
98
  orderPlaced: "已在 {price} 下单",
@@ -132,7 +138,10 @@ var e = {
132
138
  replayHint: "足をクリックしてリプレイを開始",
133
139
  buyLimit: "指値買い {price}",
134
140
  sellLimit: "指値売り {price}",
141
+ buyStop: "逆指値買い {price}",
142
+ sellStop: "逆指値売り {price}",
135
143
  orderHint: "矢印キーで価格を調整、Enter で確定、Esc で取消",
144
+ orderTypeHint: "Alt+B または Alt+S で指値と逆指値を切り替え",
136
145
  orderCancelHint: "Delete キーで注文を取消",
137
146
  orderLine: "{title}、価格 {price}",
138
147
  orderPlaced: "{price} で注文しました",
@@ -178,7 +187,10 @@ var e = {
178
187
  replayHint: "Cliquez sur une barre pour lancer la relecture",
179
188
  buyLimit: "Achat limite {price}",
180
189
  sellLimit: "Vente limite {price}",
190
+ buyStop: "Achat stop {price}",
191
+ sellStop: "Vente stop {price}",
181
192
  orderHint: "Les flèches déplacent le prix, Entrée valide, Échap annule",
193
+ orderTypeHint: "Alt+B ou Alt+S bascule entre limite et stop",
182
194
  orderCancelHint: "Suppr annule l’ordre",
183
195
  orderLine: "{title} à {price}",
184
196
  orderPlaced: "Ordre placé à {price}",
@@ -1 +1 @@
1
- {"version":3,"file":"labels.js","names":["TRADING_LABELS","fill","template","key","values","match"],"sources":["../../../../../charts/src/engine/trading/labels.ts"],"sourcesContent":["// Built-in texts of the trading chart, per language (see ../locale.ts).\n\nimport type { LabelDictionary } from \"../locale\";\nimport type { TradingChartLabels } from \"./types\";\n\n/** Every text of the chart but the timeframe (taken from the options) */\nexport type TradingTexts = Required<Omit<TradingChartLabels, \"timeframe\">>;\n\nexport const TRADING_LABELS: LabelDictionary<TradingTexts> = {\n en: {\n open: \"O\",\n high: \"H\",\n low: \"L\",\n close: \"C\",\n change: \"\",\n volume: \"Vol\",\n limit: \"Limit\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alert\",\n scrollToRealtime: \"Scroll to the latest bar\",\n toggleIndicator: \"Show or hide {name}\",\n bars: \"{count} bars\",\n days: \"{count}d\",\n hours: \"{count}h\",\n minutes: \"{count}m\",\n chart: \"{symbol} price chart\",\n announcement: \"{time}: open {open}, high {high}, low {low}, close {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Text\",\n color: \"Color\",\n lineWidth: \"Line width\",\n lineStyle: \"Line style\",\n fill: \"Fill\",\n editText: \"Edit text\",\n lock: \"Lock\",\n remove: \"Delete\",\n target: \"Target {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R:R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Long\",\n short: \"Short\",\n replay: \"Replay · {time}\",\n replayHint: \"Click a bar to start the replay\",\n buyLimit: \"Buy limit {price}\",\n sellLimit: \"Sell limit {price}\",\n orderHint: \"Arrows move the price, Enter confirms, Escape cancels\",\n orderCancelHint: \"Delete cancels the order\",\n orderLine: \"{title} at {price}\",\n orderPlaced: \"Order placed at {price}\",\n orderCancelled: \"Order cancelled\",\n },\n zh: {\n open: \"开\",\n high: \"高\",\n low: \"低\",\n close: \"收\",\n change: \"涨跌幅\",\n volume: \"成交量\",\n limit: \"限价\",\n position: \"持仓\",\n takeProfit: \"止盈\",\n stopLoss: \"止损\",\n alert: \"预警\",\n scrollToRealtime: \"回到最新 K 线\",\n toggleIndicator: \"显示或隐藏 {name}\",\n bars: \"{count} 根 K 线\",\n days: \"{count}天\",\n hours: \"{count}小时\",\n minutes: \"{count}分\",\n chart: \"{symbol} 价格图表\",\n announcement: \"{time}:开盘 {open},最高 {high},最低 {low},收盘 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"超级趋势\",\n text: \"文本\",\n color: \"颜色\",\n lineWidth: \"线宽\",\n lineStyle: \"线型\",\n fill: \"填充\",\n editText: \"编辑文本\",\n lock: \"锁定\",\n remove: \"删除\",\n target: \"止盈 {price}({change})\",\n stop: \"止损 {price}({change})\",\n riskReward: \"盈亏比 {ratio}\",\n profit: \"盈亏 {value}\",\n long: \"做多\",\n short: \"做空\",\n replay: \"回放 · {time}\",\n replayHint: \"点击一根 K 线开始回放\",\n buyLimit: \"限价买入 {price}\",\n sellLimit: \"限价卖出 {price}\",\n orderHint: \"方向键调整价格,回车确认,Esc 取消\",\n orderCancelHint: \"Delete 键撤销该订单\",\n orderLine: \"{title},价格 {price}\",\n orderPlaced: \"已在 {price} 下单\",\n orderCancelled: \"订单已取消\",\n },\n ja: {\n open: \"始\",\n high: \"高\",\n low: \"安\",\n close: \"終\",\n change: \"騰落率\",\n volume: \"出来高\",\n limit: \"指値\",\n position: \"建玉\",\n takeProfit: \"利確\",\n stopLoss: \"損切\",\n alert: \"アラート\",\n scrollToRealtime: \"最新の足へ移動\",\n toggleIndicator: \"{name} の表示を切り替え\",\n bars: \"{count} 本\",\n days: \"{count}日\",\n hours: \"{count}時間\",\n minutes: \"{count}分\",\n chart: \"{symbol} 価格チャート\",\n announcement: \"{time}:始値 {open}、高値 {high}、安値 {low}、終値 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"スーパートレンド\",\n text: \"テキスト\",\n color: \"色\",\n lineWidth: \"線の太さ\",\n lineStyle: \"線の種類\",\n fill: \"塗りつぶし\",\n editText: \"テキストを編集\",\n lock: \"ロック\",\n remove: \"削除\",\n target: \"利確 {price}({change})\",\n stop: \"損切 {price}({change})\",\n riskReward: \"リスクリワード {ratio}\",\n profit: \"損益 {value}\",\n long: \"ロング\",\n short: \"ショート\",\n replay: \"リプレイ · {time}\",\n replayHint: \"足をクリックしてリプレイを開始\",\n buyLimit: \"指値買い {price}\",\n sellLimit: \"指値売り {price}\",\n orderHint: \"矢印キーで価格を調整、Enter で確定、Esc で取消\",\n orderCancelHint: \"Delete キーで注文を取消\",\n orderLine: \"{title}、価格 {price}\",\n orderPlaced: \"{price} で注文しました\",\n orderCancelled: \"注文を取り消しました\",\n },\n fr: {\n open: \"O\",\n high: \"H\",\n low: \"B\",\n close: \"C\",\n change: \"Var.\",\n volume: \"Vol\",\n limit: \"Limite\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alerte\",\n scrollToRealtime: \"Revenir à la dernière bougie\",\n toggleIndicator: \"Afficher ou masquer {name}\",\n bars: \"{count} barres\",\n days: \"{count} j\",\n hours: \"{count} h\",\n minutes: \"{count} min\",\n chart: \"Graphique de cours {symbol}\",\n announcement:\n \"{time} : ouverture {open}, plus haut {high}, plus bas {low}, clôture {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Texte\",\n color: \"Couleur\",\n lineWidth: \"Épaisseur\",\n lineStyle: \"Style de trait\",\n fill: \"Remplissage\",\n editText: \"Modifier le texte\",\n lock: \"Verrouiller\",\n remove: \"Supprimer\",\n target: \"Objectif {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R/R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Achat\",\n short: \"Vente\",\n replay: \"Relecture · {time}\",\n replayHint: \"Cliquez sur une barre pour lancer la relecture\",\n buyLimit: \"Achat limite {price}\",\n sellLimit: \"Vente limite {price}\",\n orderHint: \"Les flèches déplacent le prix, Entrée valide, Échap annule\",\n orderCancelHint: \"Suppr annule l’ordre\",\n orderLine: \"{title} à {price}\",\n orderPlaced: \"Ordre placé à {price}\",\n orderCancelled: \"Ordre annulé\",\n },\n};\n\n/** `\"{count} bars\"` -> `\"24 bars\"` */\nexport const fill = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (match, key: string) =>\n key in values ? String(values[key]) : match,\n );\n"],"mappings":";AAQA,IAAaA,IAAgD;CAC3D,IAAI;EACF,MAAM;EACN,MAAM;EACN,KAAK;EACL,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,UAAU;EACV,YAAY;EACZ,UAAU;EACV,OAAO;EACP,kBAAkB;EAClB,iBAAiB;EACjB,MAAM;EACN,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACP,cAAc;EACd,UAAU;EACV,YAAY;EACZ,MAAM;EACN,OAAO;EACP,WAAW;EACX,WAAW;EACX,MAAM;EACN,UAAU;EACV,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,OAAO;EACP,QAAQ;EACR,YAAY;EACZ,UAAU;EACV,WAAW;EACX,WAAW;EACX,iBAAiB;EACjB,WAAW;EACX,aAAa;EACb,gBAAgB;CAClB;CACA,IAAI;EACF,MAAM;EACN,MAAM;EACN,KAAK;EACL,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,UAAU;EACV,YAAY;EACZ,UAAU;EACV,OAAO;EACP,kBAAkB;EAClB,iBAAiB;EACjB,MAAM;EACN,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACP,cAAc;EACd,UAAU;EACV,YAAY;EACZ,MAAM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,WAAW;EACX,iBAAiB;EACjB,WAAW;EACX,aAAa;EACb,gBAAgB;CAClB;AACF,GAGaC,KACX,GACA,MAEAC,EAAS,QAAQ,eAAe,GAAO,MACrCC,KAAOC,IAAS,OAAOA,EAAOD,EAAI,IAAIE,CACxC"}
1
+ {"version":3,"file":"labels.js","names":["TRADING_LABELS","fill","template","key","values","match"],"sources":["../../../../../charts/src/engine/trading/labels.ts"],"sourcesContent":["// Built-in texts of the trading chart, per language (see ../locale.ts).\n\nimport type { LabelDictionary } from \"../locale\";\nimport type { TradingChartLabels } from \"./types\";\n\n/** Every text of the chart but the timeframe (taken from the options) */\nexport type TradingTexts = Required<Omit<TradingChartLabels, \"timeframe\">>;\n\nexport const TRADING_LABELS: LabelDictionary<TradingTexts> = {\n en: {\n open: \"O\",\n high: \"H\",\n low: \"L\",\n close: \"C\",\n change: \"\",\n volume: \"Vol\",\n limit: \"Limit\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alert\",\n scrollToRealtime: \"Scroll to the latest bar\",\n toggleIndicator: \"Show or hide {name}\",\n bars: \"{count} bars\",\n days: \"{count}d\",\n hours: \"{count}h\",\n minutes: \"{count}m\",\n chart: \"{symbol} price chart\",\n announcement: \"{time}: open {open}, high {high}, low {low}, close {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Text\",\n color: \"Color\",\n lineWidth: \"Line width\",\n lineStyle: \"Line style\",\n fill: \"Fill\",\n editText: \"Edit text\",\n lock: \"Lock\",\n remove: \"Delete\",\n target: \"Target {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R:R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Long\",\n short: \"Short\",\n replay: \"Replay · {time}\",\n replayHint: \"Click a bar to start the replay\",\n buyLimit: \"Buy limit {price}\",\n sellLimit: \"Sell limit {price}\",\n buyStop: \"Buy stop {price}\",\n sellStop: \"Sell stop {price}\",\n orderHint: \"Arrows move the price, Enter confirms, Escape cancels\",\n orderTypeHint: \"Alt+B or Alt+S switches between limit and stop\",\n orderCancelHint: \"Delete cancels the order\",\n orderLine: \"{title} at {price}\",\n orderPlaced: \"Order placed at {price}\",\n orderCancelled: \"Order cancelled\",\n },\n zh: {\n open: \"开\",\n high: \"高\",\n low: \"低\",\n close: \"收\",\n change: \"涨跌幅\",\n volume: \"成交量\",\n limit: \"限价\",\n position: \"持仓\",\n takeProfit: \"止盈\",\n stopLoss: \"止损\",\n alert: \"预警\",\n scrollToRealtime: \"回到最新 K 线\",\n toggleIndicator: \"显示或隐藏 {name}\",\n bars: \"{count} 根 K 线\",\n days: \"{count}天\",\n hours: \"{count}小时\",\n minutes: \"{count}分\",\n chart: \"{symbol} 价格图表\",\n announcement: \"{time}:开盘 {open},最高 {high},最低 {low},收盘 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"超级趋势\",\n text: \"文本\",\n color: \"颜色\",\n lineWidth: \"线宽\",\n lineStyle: \"线型\",\n fill: \"填充\",\n editText: \"编辑文本\",\n lock: \"锁定\",\n remove: \"删除\",\n target: \"止盈 {price}({change})\",\n stop: \"止损 {price}({change})\",\n riskReward: \"盈亏比 {ratio}\",\n profit: \"盈亏 {value}\",\n long: \"做多\",\n short: \"做空\",\n replay: \"回放 · {time}\",\n replayHint: \"点击一根 K 线开始回放\",\n buyLimit: \"限价买入 {price}\",\n sellLimit: \"限价卖出 {price}\",\n buyStop: \"止损买入 {price}\",\n sellStop: \"止损卖出 {price}\",\n orderHint: \"方向键调整价格,回车确认,Esc 取消\",\n orderTypeHint: \"Alt+B 或 Alt+S 切换限价单与止损单\",\n orderCancelHint: \"Delete 键撤销该订单\",\n orderLine: \"{title},价格 {price}\",\n orderPlaced: \"已在 {price} 下单\",\n orderCancelled: \"订单已取消\",\n },\n ja: {\n open: \"始\",\n high: \"高\",\n low: \"安\",\n close: \"終\",\n change: \"騰落率\",\n volume: \"出来高\",\n limit: \"指値\",\n position: \"建玉\",\n takeProfit: \"利確\",\n stopLoss: \"損切\",\n alert: \"アラート\",\n scrollToRealtime: \"最新の足へ移動\",\n toggleIndicator: \"{name} の表示を切り替え\",\n bars: \"{count} 本\",\n days: \"{count}日\",\n hours: \"{count}時間\",\n minutes: \"{count}分\",\n chart: \"{symbol} 価格チャート\",\n announcement: \"{time}:始値 {open}、高値 {high}、安値 {low}、終値 {close}\",\n ichimoku: \"一目均衡表\",\n supertrend: \"スーパートレンド\",\n text: \"テキスト\",\n color: \"色\",\n lineWidth: \"線の太さ\",\n lineStyle: \"線の種類\",\n fill: \"塗りつぶし\",\n editText: \"テキストを編集\",\n lock: \"ロック\",\n remove: \"削除\",\n target: \"利確 {price}({change})\",\n stop: \"損切 {price}({change})\",\n riskReward: \"リスクリワード {ratio}\",\n profit: \"損益 {value}\",\n long: \"ロング\",\n short: \"ショート\",\n replay: \"リプレイ · {time}\",\n replayHint: \"足をクリックしてリプレイを開始\",\n buyLimit: \"指値買い {price}\",\n sellLimit: \"指値売り {price}\",\n buyStop: \"逆指値買い {price}\",\n sellStop: \"逆指値売り {price}\",\n orderHint: \"矢印キーで価格を調整、Enter で確定、Esc で取消\",\n orderTypeHint: \"Alt+B または Alt+S で指値と逆指値を切り替え\",\n orderCancelHint: \"Delete キーで注文を取消\",\n orderLine: \"{title}、価格 {price}\",\n orderPlaced: \"{price} で注文しました\",\n orderCancelled: \"注文を取り消しました\",\n },\n fr: {\n open: \"O\",\n high: \"H\",\n low: \"B\",\n close: \"C\",\n change: \"Var.\",\n volume: \"Vol\",\n limit: \"Limite\",\n position: \"Position\",\n takeProfit: \"TP\",\n stopLoss: \"SL\",\n alert: \"Alerte\",\n scrollToRealtime: \"Revenir à la dernière bougie\",\n toggleIndicator: \"Afficher ou masquer {name}\",\n bars: \"{count} barres\",\n days: \"{count} j\",\n hours: \"{count} h\",\n minutes: \"{count} min\",\n chart: \"Graphique de cours {symbol}\",\n announcement:\n \"{time} : ouverture {open}, plus haut {high}, plus bas {low}, clôture {close}\",\n ichimoku: \"Ichimoku\",\n supertrend: \"SuperTrend\",\n text: \"Texte\",\n color: \"Couleur\",\n lineWidth: \"Épaisseur\",\n lineStyle: \"Style de trait\",\n fill: \"Remplissage\",\n editText: \"Modifier le texte\",\n lock: \"Verrouiller\",\n remove: \"Supprimer\",\n target: \"Objectif {price} ({change})\",\n stop: \"Stop {price} ({change})\",\n riskReward: \"R/R {ratio}\",\n profit: \"P&L {value}\",\n long: \"Achat\",\n short: \"Vente\",\n replay: \"Relecture · {time}\",\n replayHint: \"Cliquez sur une barre pour lancer la relecture\",\n buyLimit: \"Achat limite {price}\",\n sellLimit: \"Vente limite {price}\",\n buyStop: \"Achat stop {price}\",\n sellStop: \"Vente stop {price}\",\n orderHint: \"Les flèches déplacent le prix, Entrée valide, Échap annule\",\n orderTypeHint: \"Alt+B ou Alt+S bascule entre limite et stop\",\n orderCancelHint: \"Suppr annule l’ordre\",\n orderLine: \"{title} à {price}\",\n orderPlaced: \"Ordre placé à {price}\",\n orderCancelled: \"Ordre annulé\",\n },\n};\n\n/** `\"{count} bars\"` -> `\"24 bars\"` */\nexport const fill = (\n template: string,\n values: Record<string, string | number>,\n): string =>\n template.replace(/\\{(\\w+)\\}/g, (match, key: string) =>\n key in values ? String(values[key]) : match,\n );\n"],"mappings":";AAQA,IAAaA,IAAgD;CAC3D,IAAI;EACF,MAAM;EACN,MAAM;EACN,KAAK;EACL,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,UAAU;EACV,YAAY;EACZ,UAAU;EACV,OAAO;EACP,kBAAkB;EAClB,iBAAiB;EACjB,MAAM;EACN,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACP,cAAc;EACd,UAAU;EACV,YAAY;EACZ,MAAM;EACN,OAAO;EACP,WAAW;EACX,WAAW;EACX,MAAM;EACN,UAAU;EACV,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,OAAO;EACP,QAAQ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ClB;CACA,IAAI;EACF,MAAM;EACN,MAAM;EACN,KAAK;EACL,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,UAAU;EACV,YAAY;EACZ,UAAU;EACV,OAAO;EACP,kBAAkB;EAClB,iBAAiB;EACjB,MAAM;EACN,MAAM;EACN,OAAO;EACP,SAAS;EACT,OAAO;EACP,cACE;EACF,UAAU;EACV,YAAY;EACZ,MAAM;EACN,OAAO;EACP,WAAW;EACX,WAAW;EACX,MAAM;EACN,UAAU;EACV,MAAM;EACN,QAAQ;EACR,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,OAAO;EACP,QAAQ;EACR,YAAY;EACZ,UAAU;EACV,WAAW;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX,eAAe;EACf,iBAAiB;EACjB,WAAW;EACX,aAAa;EACb,gBAAgB;CAClB;AACF,GAGaC,KACX,GACA,MAEAC,EAAS,QAAQ,eAAe,GAAO,MACrCC,KAAOC,IAAS,OAAOA,EAAOD,EAAI,IAAIE,CACxC"}
@@ -0,0 +1,2 @@
1
+ var e=(e,t,n=0)=>e.left-n<t.right&&e.right+n>t.left&&e.top-n<t.bottom&&e.bottom+n>t.top,t=(e,t,n,r=1)=>{let i=e.map(()=>null),a=e.map((e,t)=>({label:e,index:t})).filter(({label:e})=>Number.isFinite(e.top)&&e.height>0),o=n-t,s=()=>a.reduce((e,{label:t})=>e+t.height,0)+r*Math.max(0,a.length-1);for(;a.length>1&&s()>o;){let e=0;for(let t=1;t<a.length;t++)(a[t]?.label.priority??0)<=(a[e]?.label.priority??0)&&(e=t);a.splice(e,1)}a.sort((e,t)=>e.label.top-t.label.top||e.index-t.index);let c=[],l=e=>{let r=e.last-e.first+1;e.top=Math.max(t,Math.min(n-e.height,e.wish/r))};a.forEach(({label:e},t)=>{let n={first:t,last:t,top:0,height:e.height,wish:e.top};l(n);let i=c[c.length-1];for(;i&&i.top+i.height+r>n.top;)i.wish+=n.wish-(n.last-n.first+1)*(i.height+r),i.height+=r+n.height,i.last=n.last,c.pop(),n.first=i.first,n.last=i.last,n.height=i.height,n.wish=i.wish,l(n),i=c[c.length-1];c.push(n)});for(let e of c){let t=e.top;for(let n=e.first;n<=e.last;n++){let e=a[n];e&&(i[e.index]=t,t+=e.label.height+r)}}return i},n=(t,n=[],r=4)=>{let i=[...n];return t.map(t=>{let n=t.right-t.width;for(let a=0;a<=i.length;a++){let a={left:n,top:t.top,right:n+t.width,bottom:t.top+t.height},o=i.filter(t=>e(a,t,r/2));if(!o.length)break;n=Math.min(...o.map(e=>e.left))-r-t.width}return i.push({left:n,top:t.top,right:n+t.width,bottom:t.top+t.height}),n})},r=(t,n,r=2)=>t.findIndex(t=>!n.some(n=>e(t,n,r)));exports.boxesOverlap=e,exports.firstFree=r,exports.placeTags=n,exports.stackLabels=t;
2
+ //# sourceMappingURL=layout.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.cjs","names":["boxesOverlap","a","pad","b","stackLabels","result","labels","kept","label","space","max","min","needed","sum","gap","drop","k","blocks","place","count","block","previous","top","m","item","placeTags","placed","fixed","tags","left","tag","guard","box","hit","other","firstFree","candidates","obstacles"],"sources":["../../../../../charts/src/engine/trading/layout.ts"],"sourcesContent":["// Placement of the labels painted over the chart, so that they never overlap\n\n/** A rectangle in CSS pixels */\nexport interface LabelBox {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\n/** Whether two boxes overlap, with `pad` pixels of margin around `a` */\nexport const boxesOverlap = (a: LabelBox, b: LabelBox, pad = 0) =>\n a.left - pad < b.right &&\n a.right + pad > b.left &&\n a.top - pad < b.bottom &&\n a.bottom + pad > b.top;\n\n/** A label of a vertical stack: its wished top, its height and its priority */\nexport interface StackedLabel {\n top: number;\n height: number;\n /** Higher is kept first when the labels do not all fit @default 0 */\n priority?: number;\n}\n\n/**\n * Lays labels out in a column (e.g. the price axis) without overlaps,\n * moving each label as little as possible from its wished position: labels\n * that would overlap are grouped and centred on their wished positions, then\n * kept between `min` and `max`. When they cannot all fit, the ones of lowest\n * priority are dropped. Returns the top of each label, `null` when dropped.\n */\nexport const stackLabels = (\n labels: readonly StackedLabel[],\n min: number,\n max: number,\n gap = 1,\n): (number | null)[] => {\n const result: (number | null)[] = labels.map(() => null);\n const kept = labels\n .map((label, index) => ({ label, index }))\n .filter(({ label }) => Number.isFinite(label.top) && label.height > 0);\n const space = max - min;\n const needed = () =>\n kept.reduce((sum, { label }) => sum + label.height, 0) +\n gap * Math.max(0, kept.length - 1);\n while (kept.length > 1 && needed() > space) {\n let drop = 0;\n for (let k = 1; k < kept.length; k++) {\n const a = kept[k]?.label.priority ?? 0;\n const b = kept[drop]?.label.priority ?? 0;\n if (a <= b) drop = k;\n }\n kept.splice(drop, 1);\n }\n kept.sort((a, b) => a.label.top - b.label.top || a.index - b.index);\n\n // blocks of labels packed together; each block sits where the mean of its\n // members' wishes puts it\n interface Block {\n first: number;\n last: number;\n top: number;\n height: number;\n /** Sum of the wished tops, each minus its offset in the block */\n wish: number;\n }\n const blocks: Block[] = [];\n const place = (block: Block) => {\n const count = block.last - block.first + 1;\n block.top = Math.max(min, Math.min(max - block.height, block.wish / count));\n };\n kept.forEach(({ label }, k) => {\n const block: Block = {\n first: k,\n last: k,\n top: 0,\n height: label.height,\n wish: label.top,\n };\n place(block);\n let previous = blocks[blocks.length - 1];\n while (previous && previous.top + previous.height + gap > block.top) {\n // merge: the members of `block` move down by the height of `previous`\n previous.wish +=\n block.wish - (block.last - block.first + 1) * (previous.height + gap);\n previous.height += gap + block.height;\n previous.last = block.last;\n blocks.pop();\n block.first = previous.first;\n block.last = previous.last;\n block.height = previous.height;\n block.wish = previous.wish;\n place(block);\n previous = blocks[blocks.length - 1];\n }\n blocks.push(block);\n });\n for (const block of blocks) {\n let top = block.top;\n for (let m = block.first; m <= block.last; m++) {\n const item = kept[m];\n if (!item) continue;\n result[item.index] = top;\n top += item.label.height + gap;\n }\n }\n return result;\n};\n\n/**\n * Lays out labels anchored by their right edge on a row (e.g. the tags of\n * the order lines): a label that would overlap an earlier one (or one of\n * the `fixed` boxes) moves left of it. Returns the left of each label.\n */\nexport const placeTags = (\n tags: readonly {\n right: number;\n top: number;\n width: number;\n height: number;\n }[],\n fixed: readonly LabelBox[] = [],\n gap = 4,\n): number[] => {\n const placed: LabelBox[] = [...fixed];\n return tags.map((tag) => {\n let left = tag.right - tag.width;\n for (let guard = 0; guard <= placed.length; guard++) {\n const box = {\n left,\n top: tag.top,\n right: left + tag.width,\n bottom: tag.top + tag.height,\n };\n const hit = placed.filter((other) => boxesOverlap(box, other, gap / 2));\n if (!hit.length) break;\n left = Math.min(...hit.map((other) => other.left)) - gap - tag.width;\n }\n placed.push({\n left,\n top: tag.top,\n right: left + tag.width,\n bottom: tag.top + tag.height,\n });\n return left;\n });\n};\n\n/** The first candidate box that overlaps none of the obstacles, or -1 */\nexport const firstFree = (\n candidates: readonly LabelBox[],\n obstacles: readonly LabelBox[],\n pad = 2,\n) =>\n candidates.findIndex(\n (box) => !obstacles.some((other) => boxesOverlap(box, other, pad)),\n );\n"],"mappings":"AAWA,IAAaA,GAAgB,EAAa,EAAa,EAAM,IAC3DC,EAAE,KAAOC,EAAMC,EAAE,OACjBF,EAAE,MAAQC,EAAMC,EAAE,MAClBF,EAAE,IAAMC,EAAMC,EAAE,QAChBF,EAAE,OAASC,EAAMC,EAAE,IAiBRC,GACX,EACA,EACA,EACA,EAAM,IACgB,CACtB,IAAMC,EAA4BC,EAAO,QAAU,IAAI,EACjDC,EAAOD,EACV,KAAK,EAAO,KAAW,CAAE,QAAO,OAAM,EAAE,CAAC,CACzC,QAAQ,CAAE,WAAY,OAAO,SAASE,EAAM,GAAG,GAAKA,EAAM,OAAS,CAAC,EACjEC,EAAQC,EAAMC,EACdC,MACJL,EAAK,QAAQ,EAAK,CAAE,WAAYM,EAAML,EAAM,OAAQ,CAAC,EACrDM,EAAM,KAAK,IAAI,EAAGP,EAAK,OAAS,CAAC,EACnC,KAAOA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G,GAAKH,EAAM,KAAM,IAAK,CAC9C,IAAMI,EAAOjB,EAAKgB,GACbC,IACL,EAAOA,EAAK,OAASF,EACrB,GAAOE,EAAK,MAAM,OAASV,EAC7B,CACF,CACA,OAAOT,CACT,EAOaoB,GACX,EAMA,EAA6B,CAAC,EAC9B,EAAM,IACO,CACb,IAAMC,EAAqB,CAAC,GAAGC,CAAK,EACpC,OAAOC,EAAK,IAAK,GAAQ,CACvB,IAAIC,EAAOC,EAAI,MAAQA,EAAI,MAC3B,IAAK,IAAIC,EAAQ,EAAGA,GAASL,EAAO,OAAQ,IAAS,CACnD,IAAMM,EAAM,CACV,OACA,IAAKF,EAAI,IACT,MAAOD,EAAOC,EAAI,MAClB,OAAQA,EAAI,IAAMA,EAAI,MACxB,EACMG,EAAMP,EAAO,OAAQ,GAAU1B,EAAagC,EAAKE,EAAOpB,EAAM,CAAC,CAAC,EACtE,GAAI,CAACmB,EAAI,OAAQ,MACjB,EAAO,KAAK,IAAI,GAAGA,EAAI,IAAK,GAAUC,EAAM,IAAI,CAAC,EAAIpB,EAAMgB,EAAI,KACjE,CAOA,OANAJ,EAAO,KAAK,CACV,OACA,IAAKI,EAAI,IACT,MAAOD,EAAOC,EAAI,MAClB,OAAQA,EAAI,IAAMA,EAAI,MACxB,CAAC,EACMD,CACT,CAAC,CACH,EAGaM,GACX,EACA,EACA,EAAM,IAENC,EAAW,UACR,GAAQ,CAACC,EAAU,KAAM,GAAUrC,EAAagC,EAAKE,EAAOhC,CAAG,CAAC,CACnE"}
@@ -0,0 +1,37 @@
1
+ /** A rectangle in CSS pixels */
2
+ export interface LabelBox {
3
+ left: number;
4
+ top: number;
5
+ right: number;
6
+ bottom: number;
7
+ }
8
+ /** Whether two boxes overlap, with `pad` pixels of margin around `a` */
9
+ export declare const boxesOverlap: (a: LabelBox, b: LabelBox, pad?: number) => boolean;
10
+ /** A label of a vertical stack: its wished top, its height and its priority */
11
+ export interface StackedLabel {
12
+ top: number;
13
+ height: number;
14
+ /** Higher is kept first when the labels do not all fit @default 0 */
15
+ priority?: number;
16
+ }
17
+ /**
18
+ * Lays labels out in a column (e.g. the price axis) without overlaps,
19
+ * moving each label as little as possible from its wished position: labels
20
+ * that would overlap are grouped and centred on their wished positions, then
21
+ * kept between `min` and `max`. When they cannot all fit, the ones of lowest
22
+ * priority are dropped. Returns the top of each label, `null` when dropped.
23
+ */
24
+ export declare const stackLabels: (labels: readonly StackedLabel[], min: number, max: number, gap?: number) => (number | null)[];
25
+ /**
26
+ * Lays out labels anchored by their right edge on a row (e.g. the tags of
27
+ * the order lines): a label that would overlap an earlier one (or one of
28
+ * the `fixed` boxes) moves left of it. Returns the left of each label.
29
+ */
30
+ export declare const placeTags: (tags: readonly {
31
+ right: number;
32
+ top: number;
33
+ width: number;
34
+ height: number;
35
+ }[], fixed?: readonly LabelBox[], gap?: number) => number[];
36
+ /** The first candidate box that overlaps none of the obstacles, or -1 */
37
+ export declare const firstFree: (candidates: readonly LabelBox[], obstacles: readonly LabelBox[], pad?: number) => number;
@@ -0,0 +1,37 @@
1
+ /** A rectangle in CSS pixels */
2
+ export interface LabelBox {
3
+ left: number;
4
+ top: number;
5
+ right: number;
6
+ bottom: number;
7
+ }
8
+ /** Whether two boxes overlap, with `pad` pixels of margin around `a` */
9
+ export declare const boxesOverlap: (a: LabelBox, b: LabelBox, pad?: number) => boolean;
10
+ /** A label of a vertical stack: its wished top, its height and its priority */
11
+ export interface StackedLabel {
12
+ top: number;
13
+ height: number;
14
+ /** Higher is kept first when the labels do not all fit @default 0 */
15
+ priority?: number;
16
+ }
17
+ /**
18
+ * Lays labels out in a column (e.g. the price axis) without overlaps,
19
+ * moving each label as little as possible from its wished position: labels
20
+ * that would overlap are grouped and centred on their wished positions, then
21
+ * kept between `min` and `max`. When they cannot all fit, the ones of lowest
22
+ * priority are dropped. Returns the top of each label, `null` when dropped.
23
+ */
24
+ export declare const stackLabels: (labels: readonly StackedLabel[], min: number, max: number, gap?: number) => (number | null)[];
25
+ /**
26
+ * Lays out labels anchored by their right edge on a row (e.g. the tags of
27
+ * the order lines): a label that would overlap an earlier one (or one of
28
+ * the `fixed` boxes) moves left of it. Returns the left of each label.
29
+ */
30
+ export declare const placeTags: (tags: readonly {
31
+ right: number;
32
+ top: number;
33
+ width: number;
34
+ height: number;
35
+ }[], fixed?: readonly LabelBox[], gap?: number) => number[];
36
+ /** The first candidate box that overlaps none of the obstacles, or -1 */
37
+ export declare const firstFree: (candidates: readonly LabelBox[], obstacles: readonly LabelBox[], pad?: number) => number;
@@ -0,0 +1,63 @@
1
+ //#region src/engine/trading/layout.ts
2
+ var e = (e, t, n = 0) => e.left - n < t.right && e.right + n > t.left && e.top - n < t.bottom && e.bottom + n > t.top, t = (e, t, n, r = 1) => {
3
+ let i = e.map(() => null), a = e.map((e, t) => ({
4
+ label: e,
5
+ index: t
6
+ })).filter(({ label: e }) => Number.isFinite(e.top) && e.height > 0), o = n - t, s = () => a.reduce((e, { label: t }) => e + t.height, 0) + r * Math.max(0, a.length - 1);
7
+ for (; a.length > 1 && s() > o;) {
8
+ let e = 0;
9
+ for (let t = 1; t < a.length; t++) (a[t]?.label.priority ?? 0) <= (a[e]?.label.priority ?? 0) && (e = t);
10
+ a.splice(e, 1);
11
+ }
12
+ a.sort((e, t) => e.label.top - t.label.top || e.index - t.index);
13
+ let c = [], l = (e) => {
14
+ let r = e.last - e.first + 1;
15
+ e.top = Math.max(t, Math.min(n - e.height, e.wish / r));
16
+ };
17
+ a.forEach(({ label: e }, t) => {
18
+ let n = {
19
+ first: t,
20
+ last: t,
21
+ top: 0,
22
+ height: e.height,
23
+ wish: e.top
24
+ };
25
+ l(n);
26
+ let i = c[c.length - 1];
27
+ for (; i && i.top + i.height + r > n.top;) i.wish += n.wish - (n.last - n.first + 1) * (i.height + r), i.height += r + n.height, i.last = n.last, c.pop(), n.first = i.first, n.last = i.last, n.height = i.height, n.wish = i.wish, l(n), i = c[c.length - 1];
28
+ c.push(n);
29
+ });
30
+ for (let e of c) {
31
+ let t = e.top;
32
+ for (let n = e.first; n <= e.last; n++) {
33
+ let e = a[n];
34
+ e && (i[e.index] = t, t += e.label.height + r);
35
+ }
36
+ }
37
+ return i;
38
+ }, n = (t, n = [], r = 4) => {
39
+ let i = [...n];
40
+ return t.map((t) => {
41
+ let n = t.right - t.width;
42
+ for (let a = 0; a <= i.length; a++) {
43
+ let a = {
44
+ left: n,
45
+ top: t.top,
46
+ right: n + t.width,
47
+ bottom: t.top + t.height
48
+ }, o = i.filter((t) => e(a, t, r / 2));
49
+ if (!o.length) break;
50
+ n = Math.min(...o.map((e) => e.left)) - r - t.width;
51
+ }
52
+ return i.push({
53
+ left: n,
54
+ top: t.top,
55
+ right: n + t.width,
56
+ bottom: t.top + t.height
57
+ }), n;
58
+ });
59
+ }, r = (t, n, r = 2) => t.findIndex((t) => !n.some((n) => e(t, n, r)));
60
+ //#endregion
61
+ export { e as boxesOverlap, r as firstFree, n as placeTags, t as stackLabels };
62
+
63
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","names":["boxesOverlap","a","pad","b","stackLabels","result","labels","kept","label","space","max","min","needed","sum","gap","drop","k","blocks","place","count","block","previous","top","m","item","placeTags","placed","fixed","tags","left","tag","guard","box","hit","other","firstFree","candidates","obstacles"],"sources":["../../../../../charts/src/engine/trading/layout.ts"],"sourcesContent":["// Placement of the labels painted over the chart, so that they never overlap\n\n/** A rectangle in CSS pixels */\nexport interface LabelBox {\n left: number;\n top: number;\n right: number;\n bottom: number;\n}\n\n/** Whether two boxes overlap, with `pad` pixels of margin around `a` */\nexport const boxesOverlap = (a: LabelBox, b: LabelBox, pad = 0) =>\n a.left - pad < b.right &&\n a.right + pad > b.left &&\n a.top - pad < b.bottom &&\n a.bottom + pad > b.top;\n\n/** A label of a vertical stack: its wished top, its height and its priority */\nexport interface StackedLabel {\n top: number;\n height: number;\n /** Higher is kept first when the labels do not all fit @default 0 */\n priority?: number;\n}\n\n/**\n * Lays labels out in a column (e.g. the price axis) without overlaps,\n * moving each label as little as possible from its wished position: labels\n * that would overlap are grouped and centred on their wished positions, then\n * kept between `min` and `max`. When they cannot all fit, the ones of lowest\n * priority are dropped. Returns the top of each label, `null` when dropped.\n */\nexport const stackLabels = (\n labels: readonly StackedLabel[],\n min: number,\n max: number,\n gap = 1,\n): (number | null)[] => {\n const result: (number | null)[] = labels.map(() => null);\n const kept = labels\n .map((label, index) => ({ label, index }))\n .filter(({ label }) => Number.isFinite(label.top) && label.height > 0);\n const space = max - min;\n const needed = () =>\n kept.reduce((sum, { label }) => sum + label.height, 0) +\n gap * Math.max(0, kept.length - 1);\n while (kept.length > 1 && needed() > space) {\n let drop = 0;\n for (let k = 1; k < kept.length; k++) {\n const a = kept[k]?.label.priority ?? 0;\n const b = kept[drop]?.label.priority ?? 0;\n if (a <= b) drop = k;\n }\n kept.splice(drop, 1);\n }\n kept.sort((a, b) => a.label.top - b.label.top || a.index - b.index);\n\n // blocks of labels packed together; each block sits where the mean of its\n // members' wishes puts it\n interface Block {\n first: number;\n last: number;\n top: number;\n height: number;\n /** Sum of the wished tops, each minus its offset in the block */\n wish: number;\n }\n const blocks: Block[] = [];\n const place = (block: Block) => {\n const count = block.last - block.first + 1;\n block.top = Math.max(min, Math.min(max - block.height, block.wish / count));\n };\n kept.forEach(({ label }, k) => {\n const block: Block = {\n first: k,\n last: k,\n top: 0,\n height: label.height,\n wish: label.top,\n };\n place(block);\n let previous = blocks[blocks.length - 1];\n while (previous && previous.top + previous.height + gap > block.top) {\n // merge: the members of `block` move down by the height of `previous`\n previous.wish +=\n block.wish - (block.last - block.first + 1) * (previous.height + gap);\n previous.height += gap + block.height;\n previous.last = block.last;\n blocks.pop();\n block.first = previous.first;\n block.last = previous.last;\n block.height = previous.height;\n block.wish = previous.wish;\n place(block);\n previous = blocks[blocks.length - 1];\n }\n blocks.push(block);\n });\n for (const block of blocks) {\n let top = block.top;\n for (let m = block.first; m <= block.last; m++) {\n const item = kept[m];\n if (!item) continue;\n result[item.index] = top;\n top += item.label.height + gap;\n }\n }\n return result;\n};\n\n/**\n * Lays out labels anchored by their right edge on a row (e.g. the tags of\n * the order lines): a label that would overlap an earlier one (or one of\n * the `fixed` boxes) moves left of it. Returns the left of each label.\n */\nexport const placeTags = (\n tags: readonly {\n right: number;\n top: number;\n width: number;\n height: number;\n }[],\n fixed: readonly LabelBox[] = [],\n gap = 4,\n): number[] => {\n const placed: LabelBox[] = [...fixed];\n return tags.map((tag) => {\n let left = tag.right - tag.width;\n for (let guard = 0; guard <= placed.length; guard++) {\n const box = {\n left,\n top: tag.top,\n right: left + tag.width,\n bottom: tag.top + tag.height,\n };\n const hit = placed.filter((other) => boxesOverlap(box, other, gap / 2));\n if (!hit.length) break;\n left = Math.min(...hit.map((other) => other.left)) - gap - tag.width;\n }\n placed.push({\n left,\n top: tag.top,\n right: left + tag.width,\n bottom: tag.top + tag.height,\n });\n return left;\n });\n};\n\n/** The first candidate box that overlaps none of the obstacles, or -1 */\nexport const firstFree = (\n candidates: readonly LabelBox[],\n obstacles: readonly LabelBox[],\n pad = 2,\n) =>\n candidates.findIndex(\n (box) => !obstacles.some((other) => boxesOverlap(box, other, pad)),\n );\n"],"mappings":";AAWA,IAAaA,KAAgB,GAAa,GAAa,IAAM,MAC3DC,EAAE,OAAOC,IAAMC,EAAE,SACjBF,EAAE,QAAQC,IAAMC,EAAE,QAClBF,EAAE,MAAMC,IAAMC,EAAE,UAChBF,EAAE,SAASC,IAAMC,EAAE,KAiBRC,KACX,GACA,GACA,GACA,IAAM,MACgB;CACtB,IAAMC,IAA4BC,EAAO,UAAU,IAAI,GACjDC,IAAOD,EACV,KAAK,GAAO,OAAW;EAAE;EAAO;CAAM,EAAE,CAAC,CACzC,QAAQ,EAAE,eAAY,OAAO,SAASE,EAAM,GAAG,KAAKA,EAAM,SAAS,CAAC,GACjEC,IAAQC,IAAMC,GACdC,UACJL,EAAK,QAAQ,GAAK,EAAE,eAAYM,IAAML,EAAM,QAAQ,CAAC,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Q;EAC1B,IAAIK,IAAMF,EAAM;EAChB,KAAK,IAAIG,IAAIH,EAAM,OAAOG,KAAKH,EAAM,MAAM,KAAK;GAC9C,IAAMI,IAAOjB,EAAKgB;GAClB,AAAKC,MACL,EAAOA,EAAK,SAASF,GACrB,KAAOE,EAAK,MAAM,SAASV;EAC7B;CACF;CACA,OAAOT;AACT,GAOaoB,KACX,GAMA,IAA6B,CAAC,GAC9B,IAAM,MACO;CACb,IAAMC,IAAqB,CAAC,GAAGC,CAAK;CACpC,OAAOC,EAAK,KAAK,MAAQ;EACvB,IAAIC,IAAOC,EAAI,QAAQA,EAAI;EAC3B,KAAK,IAAIC,IAAQ,GAAGA,KAASL,EAAO,QAAQ,KAAS;GACnD,IAAMM,IAAM;IACV;IACA,KAAKF,EAAI;IACT,OAAOD,IAAOC,EAAI;IAClB,QAAQA,EAAI,MAAMA,EAAI;GACxB,GACMG,IAAMP,EAAO,QAAQ,MAAU1B,EAAagC,GAAKE,GAAOpB,IAAM,CAAC,CAAC;GACtE,IAAI,CAACmB,EAAI,QAAQ;GACjB,IAAO,KAAK,IAAI,GAAGA,EAAI,KAAK,MAAUC,EAAM,IAAI,CAAC,IAAIpB,IAAMgB,EAAI;EACjE;EAOA,OANAJ,EAAO,KAAK;GACV;GACA,KAAKI,EAAI;GACT,OAAOD,IAAOC,EAAI;GAClB,QAAQA,EAAI,MAAMA,EAAI;EACxB,CAAC,GACMD;CACT,CAAC;AACH,GAGaM,KACX,GACA,GACA,IAAM,MAENC,EAAW,WACR,MAAQ,CAACC,EAAU,MAAM,MAAUrC,EAAagC,GAAKE,GAAOhC,CAAG,CAAC,CACnE"}
@@ -711,12 +711,18 @@ export interface TradingChartLabels {
711
711
  replay?: string;
712
712
  /** Hint while picking the first bar of a replay @default "Click a bar to start the replay" */
713
713
  replayHint?: string;
714
- /** Order entry button, below the last price; `{price}` is replaced @default "Buy limit {price}" */
714
+ /** Buy limit order (at or below the last price); `{price}` is replaced @default "Buy limit {price}" */
715
715
  buyLimit?: string;
716
- /** Order entry button, above the last price; `{price}` is replaced @default "Sell limit {price}" */
716
+ /** Sell limit order (at or above the last price); `{price}` is replaced @default "Sell limit {price}" */
717
717
  sellLimit?: string;
718
+ /** Buy stop order (above the last price); `{price}` is replaced @default "Buy stop {price}" */
719
+ buyStop?: string;
720
+ /** Sell stop order (below the last price); `{price}` is replaced @default "Sell stop {price}" */
721
+ sellStop?: string;
718
722
  /** Read aloud while a keyboard order is armed or a line is selected @default "Arrows move the price, Enter confirms, Escape cancels" */
719
723
  orderHint?: string;
724
+ /** Read aloud when a keyboard order is armed @default "Alt+B or Alt+S switches between limit and stop" */
725
+ orderTypeHint?: string;
720
726
  /** Read aloud when the line selected by the keyboard can be cancelled @default "Delete cancels the order" */
721
727
  orderCancelHint?: string;
722
728
  /** Price line selected by the keyboard; `{title}` and `{price}` are replaced @default "{title} at {price}" */
@@ -811,11 +817,15 @@ export interface TradingChartOptions {
811
817
  priceLines?: readonly TradingPriceLine[];
812
818
  /**
813
819
  * A "+" button at the crosshair price, on the right of the price pane:
814
- * clicking it reports a limit order (`orderCreate`) at that price. With the
815
- * chart focused, `B` / `S` arm a buy / sell order at the crosshair price
816
- * (or the last price), the arrows move it (Shift: ten ticks), Enter
817
- * confirms and Escape cancels; `O` selects the draggable lines in turn to
818
- * move them the same way, Delete cancels the `cancellable` ones
820
+ * clicking it reports a limit order (`orderCreate`) at that price, a buy
821
+ * below the last price and a sell above it (with Alt / Option held: the
822
+ * stop order of the other side). With the chart focused, `B` / `S` arm a
823
+ * buy / sell order at the crosshair price (or the last price), the arrows
824
+ * move it (Shift: ten ticks), Enter confirms and Escape cancels. The order
825
+ * is a limit when it waits for a better price (a buy at or below the last
826
+ * price, a sell at or above it), else a stop; `Alt+B` / `Alt+S` switch
827
+ * between limit and stop explicitly. `O` selects the draggable lines in
828
+ * turn to move them the same way, Delete cancels the `cancellable` ones
819
829
  * @default false
820
830
  */
821
831
  orderEntry?: boolean;
@@ -947,7 +957,14 @@ export interface TradingOrderCreateEvent {
947
957
  price: number;
948
958
  /** `buy` below the last price, `sell` above it (`B` / `S` with the keyboard) */
949
959
  side: "buy" | "sell";
960
+ /**
961
+ * `limit` for a buy at or below the last price or a sell at or above it,
962
+ * `stop` otherwise (or as switched with Alt)
963
+ */
964
+ orderType: TradingOrderType;
950
965
  }
966
+ /** Type of an order created on the chart */
967
+ export type TradingOrderType = "limit" | "stop";
951
968
  /** The close button of a `cancellable` price line was clicked (or Delete pressed on it) */
952
969
  export interface TradingOrderCancelEvent {
953
970
  /** Id of the line */
@@ -711,12 +711,18 @@ export interface TradingChartLabels {
711
711
  replay?: string;
712
712
  /** Hint while picking the first bar of a replay @default "Click a bar to start the replay" */
713
713
  replayHint?: string;
714
- /** Order entry button, below the last price; `{price}` is replaced @default "Buy limit {price}" */
714
+ /** Buy limit order (at or below the last price); `{price}` is replaced @default "Buy limit {price}" */
715
715
  buyLimit?: string;
716
- /** Order entry button, above the last price; `{price}` is replaced @default "Sell limit {price}" */
716
+ /** Sell limit order (at or above the last price); `{price}` is replaced @default "Sell limit {price}" */
717
717
  sellLimit?: string;
718
+ /** Buy stop order (above the last price); `{price}` is replaced @default "Buy stop {price}" */
719
+ buyStop?: string;
720
+ /** Sell stop order (below the last price); `{price}` is replaced @default "Sell stop {price}" */
721
+ sellStop?: string;
718
722
  /** Read aloud while a keyboard order is armed or a line is selected @default "Arrows move the price, Enter confirms, Escape cancels" */
719
723
  orderHint?: string;
724
+ /** Read aloud when a keyboard order is armed @default "Alt+B or Alt+S switches between limit and stop" */
725
+ orderTypeHint?: string;
720
726
  /** Read aloud when the line selected by the keyboard can be cancelled @default "Delete cancels the order" */
721
727
  orderCancelHint?: string;
722
728
  /** Price line selected by the keyboard; `{title}` and `{price}` are replaced @default "{title} at {price}" */
@@ -811,11 +817,15 @@ export interface TradingChartOptions {
811
817
  priceLines?: readonly TradingPriceLine[];
812
818
  /**
813
819
  * A "+" button at the crosshair price, on the right of the price pane:
814
- * clicking it reports a limit order (`orderCreate`) at that price. With the
815
- * chart focused, `B` / `S` arm a buy / sell order at the crosshair price
816
- * (or the last price), the arrows move it (Shift: ten ticks), Enter
817
- * confirms and Escape cancels; `O` selects the draggable lines in turn to
818
- * move them the same way, Delete cancels the `cancellable` ones
820
+ * clicking it reports a limit order (`orderCreate`) at that price, a buy
821
+ * below the last price and a sell above it (with Alt / Option held: the
822
+ * stop order of the other side). With the chart focused, `B` / `S` arm a
823
+ * buy / sell order at the crosshair price (or the last price), the arrows
824
+ * move it (Shift: ten ticks), Enter confirms and Escape cancels. The order
825
+ * is a limit when it waits for a better price (a buy at or below the last
826
+ * price, a sell at or above it), else a stop; `Alt+B` / `Alt+S` switch
827
+ * between limit and stop explicitly. `O` selects the draggable lines in
828
+ * turn to move them the same way, Delete cancels the `cancellable` ones
819
829
  * @default false
820
830
  */
821
831
  orderEntry?: boolean;
@@ -947,7 +957,14 @@ export interface TradingOrderCreateEvent {
947
957
  price: number;
948
958
  /** `buy` below the last price, `sell` above it (`B` / `S` with the keyboard) */
949
959
  side: "buy" | "sell";
960
+ /**
961
+ * `limit` for a buy at or below the last price or a sell at or above it,
962
+ * `stop` otherwise (or as switched with Alt)
963
+ */
964
+ orderType: TradingOrderType;
950
965
  }
966
+ /** Type of an order created on the chart */
967
+ export type TradingOrderType = "limit" | "stop";
951
968
  /** The close button of a `cancellable` price line was clicked (or Delete pressed on it) */
952
969
  export interface TradingOrderCancelEvent {
953
970
  /** Id of the line */
@@ -85,6 +85,11 @@ export interface ChartPointDatum {
85
85
  value?: number | null;
86
86
  /** Extra rows of the default tooltip of this point, after its values */
87
87
  details?: readonly ChartTooltipDetail[];
88
+ /**
89
+ * Identifier of the point, referenced by the `dependencies` of the chart
90
+ * (Gantt tasks sharing a row); unique across the series
91
+ */
92
+ id?: string;
88
93
  }
89
94
  /** Column-oriented data: the fastest form for large data sets (typed arrays are used as is) */
90
95
  export interface ChartColumnData {
@@ -257,7 +262,11 @@ export interface ChartAxisOptions {
257
262
  zero?: boolean;
258
263
  /** Reverses the direction of the axis */
259
264
  reverse?: boolean;
260
- /** Rounds the automatic range to tick values; on by default except for category axes */
265
+ /**
266
+ * Rounds the automatic range to tick values; on by default except for
267
+ * category axes. Log axes: whole decades on y, the closest 1, 2 or 5 × 10^k
268
+ * bounds around the data on x
269
+ */
261
270
  nice?: boolean;
262
271
  /**
263
272
  * Calendar of a `time` axis: steps and labels of the ticks and tooltips in
@@ -328,14 +337,17 @@ export interface ChartTextAnnotation {
328
337
  /** Background area, reference line or text */
329
338
  export type ChartAnnotation = ChartRectAnnotation | ChartLineAnnotation | ChartTextAnnotation;
330
339
  /**
331
- * Arrow from one category to another (Gantt dependencies): an elbow
332
- * connector from the end of the `from` bar (or dot) to the start of the
333
- * `to` bar, with a filled arrowhead
340
+ * Arrow from one bar (or dot) to another (Gantt dependencies): an elbow
341
+ * connector from the end of the `from` bar to the start of the `to` bar,
342
+ * with a filled arrowhead, routed around the bars of the rows it crosses
334
343
  */
335
344
  export interface ChartDependency {
336
- /** Category (x value) of the predecessor */
345
+ /**
346
+ * Predecessor: the `id` of a point, or else a category of the x axis (its
347
+ * first visible bar; the x value written as text on numeric axes)
348
+ */
337
349
  from: string;
338
- /** Category (x value) of the successor, where the arrow points */
350
+ /** Successor, where the arrow points (an `id` or a category, like `from`) */
339
351
  to: string;
340
352
  /** Color of the arrow (any CSS color); the secondary text color by default */
341
353
  color?: string;
@@ -517,8 +529,9 @@ export interface ChartOptions {
517
529
  /** Background areas and reference lines */
518
530
  annotations?: readonly ChartAnnotation[];
519
531
  /**
520
- * Arrows between categories (category x axis), e.g. the dependencies of
521
- * a Gantt chart: from the end of a bar to the start of another
532
+ * Arrows between bars, e.g. the dependencies of a Gantt chart: from the
533
+ * end of a bar to the start of another, matched by point `id` (or by
534
+ * category); hidden or missing points are skipped
522
535
  */
523
536
  dependencies?: readonly ChartDependency[];
524
537
  /** Zoom / pan / keyboard; `false` makes the chart static */
@@ -85,6 +85,11 @@ export interface ChartPointDatum {
85
85
  value?: number | null;
86
86
  /** Extra rows of the default tooltip of this point, after its values */
87
87
  details?: readonly ChartTooltipDetail[];
88
+ /**
89
+ * Identifier of the point, referenced by the `dependencies` of the chart
90
+ * (Gantt tasks sharing a row); unique across the series
91
+ */
92
+ id?: string;
88
93
  }
89
94
  /** Column-oriented data: the fastest form for large data sets (typed arrays are used as is) */
90
95
  export interface ChartColumnData {
@@ -257,7 +262,11 @@ export interface ChartAxisOptions {
257
262
  zero?: boolean;
258
263
  /** Reverses the direction of the axis */
259
264
  reverse?: boolean;
260
- /** Rounds the automatic range to tick values; on by default except for category axes */
265
+ /**
266
+ * Rounds the automatic range to tick values; on by default except for
267
+ * category axes. Log axes: whole decades on y, the closest 1, 2 or 5 × 10^k
268
+ * bounds around the data on x
269
+ */
261
270
  nice?: boolean;
262
271
  /**
263
272
  * Calendar of a `time` axis: steps and labels of the ticks and tooltips in
@@ -328,14 +337,17 @@ export interface ChartTextAnnotation {
328
337
  /** Background area, reference line or text */
329
338
  export type ChartAnnotation = ChartRectAnnotation | ChartLineAnnotation | ChartTextAnnotation;
330
339
  /**
331
- * Arrow from one category to another (Gantt dependencies): an elbow
332
- * connector from the end of the `from` bar (or dot) to the start of the
333
- * `to` bar, with a filled arrowhead
340
+ * Arrow from one bar (or dot) to another (Gantt dependencies): an elbow
341
+ * connector from the end of the `from` bar to the start of the `to` bar,
342
+ * with a filled arrowhead, routed around the bars of the rows it crosses
334
343
  */
335
344
  export interface ChartDependency {
336
- /** Category (x value) of the predecessor */
345
+ /**
346
+ * Predecessor: the `id` of a point, or else a category of the x axis (its
347
+ * first visible bar; the x value written as text on numeric axes)
348
+ */
337
349
  from: string;
338
- /** Category (x value) of the successor, where the arrow points */
350
+ /** Successor, where the arrow points (an `id` or a category, like `from`) */
339
351
  to: string;
340
352
  /** Color of the arrow (any CSS color); the secondary text color by default */
341
353
  color?: string;
@@ -517,8 +529,9 @@ export interface ChartOptions {
517
529
  /** Background areas and reference lines */
518
530
  annotations?: readonly ChartAnnotation[];
519
531
  /**
520
- * Arrows between categories (category x axis), e.g. the dependencies of
521
- * a Gantt chart: from the end of a bar to the start of another
532
+ * Arrows between bars, e.g. the dependencies of a Gantt chart: from the
533
+ * end of a bar to the start of another, matched by point `id` (or by
534
+ * category); hidden or missing points are skipped
522
535
  */
523
536
  dependencies?: readonly ChartDependency[];
524
537
  /** Zoom / pan / keyboard; `false` makes the chart static */