tvcharts 0.6.51 → 0.6.52

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/echarts.js CHANGED
@@ -22287,6 +22287,33 @@ var ArrowUp = Path_default.extend({
22287
22287
  ctx.closePath();
22288
22288
  }
22289
22289
  });
22290
+ var ArrowUpClose = Path_default.extend({
22291
+ type: "arrowUpClose",
22292
+ shape: {
22293
+ cx: 0,
22294
+ cy: 0,
22295
+ width: 0,
22296
+ height: 0,
22297
+ rectWidth: 0,
22298
+ triangleHeight: 0
22299
+ },
22300
+ buildPath: function(ctx, shape) {
22301
+ const {cx, cy, rectWidth, triangleHeight} = shape;
22302
+ const width = shape.width / 2;
22303
+ const height = shape.height / 2;
22304
+ const triangleY = cy - height + triangleHeight;
22305
+ const rectHeight = 3;
22306
+ ctx.moveTo(cx, cy - height);
22307
+ ctx.lineTo(cx + width, triangleY);
22308
+ ctx.lineTo(cx + width - rectWidth, triangleY);
22309
+ ctx.lineTo(cx + width - rectWidth, cy + height);
22310
+ ctx.lineTo(cx - width + rectWidth, cy + height);
22311
+ ctx.lineTo(cx - width + rectWidth, triangleY);
22312
+ ctx.lineTo(cx - width, triangleY);
22313
+ ctx.closePath();
22314
+ ctx.rect(cx - width + 0.5, cy - height - 0.5 - rectHeight, shape.width - 0.5, rectHeight);
22315
+ }
22316
+ });
22290
22317
  var ArrowDown = Path_default.extend({
22291
22318
  type: "arrowDown",
22292
22319
  shape: {
@@ -22312,6 +22339,33 @@ var ArrowDown = Path_default.extend({
22312
22339
  ctx.closePath();
22313
22340
  }
22314
22341
  });
22342
+ var ArrowDownClose = Path_default.extend({
22343
+ type: "arrowDownClose",
22344
+ shape: {
22345
+ cx: 0,
22346
+ cy: 0,
22347
+ width: 0,
22348
+ height: 0,
22349
+ rectWidth: 0,
22350
+ triangleHeight: 0
22351
+ },
22352
+ buildPath: function(ctx, shape) {
22353
+ const {cx, cy, rectWidth, triangleHeight} = shape;
22354
+ const width = shape.width / 2;
22355
+ const height = shape.height / 2;
22356
+ const triangleY = cy + height - triangleHeight;
22357
+ const rectHeight = 3;
22358
+ ctx.moveTo(cx, cy + height);
22359
+ ctx.lineTo(cx + width, triangleY);
22360
+ ctx.lineTo(cx + width - rectWidth, triangleY);
22361
+ ctx.lineTo(cx + width - rectWidth, cy - height);
22362
+ ctx.lineTo(cx - width + rectWidth, cy - height);
22363
+ ctx.lineTo(cx - width + rectWidth, triangleY);
22364
+ ctx.lineTo(cx - width, triangleY);
22365
+ ctx.closePath();
22366
+ ctx.rect(cx - width + 0.5, cy + height + 0.5, shape.width - 0.5, rectHeight);
22367
+ }
22368
+ });
22315
22369
  var symbolCtors = {
22316
22370
  line: Line_default,
22317
22371
  rect: Rect_default,
@@ -22339,7 +22393,9 @@ var symbolCtors = {
22339
22393
  triangleDown: TriangleDown,
22340
22394
  triangleLeft: TriangleLeft,
22341
22395
  triangleRight: TriangleRight,
22342
- arrowDown: ArrowDown
22396
+ arrowDown: ArrowDown,
22397
+ arrowUpClose: ArrowUpClose,
22398
+ arrowDownClose: ArrowDownClose
22343
22399
  };
22344
22400
  var symbolShapeMakers = {
22345
22401
  line: function(x, y, w, h, shape) {
@@ -22556,6 +22612,22 @@ var symbolShapeMakers = {
22556
22612
  shape.cy = y;
22557
22613
  shape.width = w;
22558
22614
  shape.height = h;
22615
+ },
22616
+ arrowUpClose: function(x, y, w, h, shape, parentShape) {
22617
+ shape.rectWidth = parentShape.triangleWidth;
22618
+ shape.triangleHeight = parentShape.triangleHeight;
22619
+ shape.cx = x;
22620
+ shape.cy = y;
22621
+ shape.width = w;
22622
+ shape.height = h;
22623
+ },
22624
+ arrowDownClose: function(x, y, w, h, shape, parentShape) {
22625
+ shape.rectWidth = parentShape.triangleWidth;
22626
+ shape.triangleHeight = parentShape.triangleHeight;
22627
+ shape.cx = x;
22628
+ shape.cy = y;
22629
+ shape.width = w;
22630
+ shape.height = h;
22559
22631
  }
22560
22632
  };
22561
22633
  var symbolBuildProxies = {};
@@ -24538,7 +24610,7 @@ var ECharts = class extends Eventful_default {
24538
24610
  barSpace: scale4.barSpace,
24539
24611
  lastBarRightSideDiffBarCount: startLastBarRightSideDiffBarCount - distanceBarCount
24540
24612
  };
24541
- doDispatchAction.call(this, payload, true);
24613
+ doDispatchAction.call(this, payload, false);
24542
24614
  }
24543
24615
  }
24544
24616
  scrollToDataIndex(dataIndex, animationDuration) {
@@ -24554,7 +24626,6 @@ var ECharts = class extends Eventful_default {
24554
24626
  const size = ordinalMeta.getCategoriesSize();
24555
24627
  const distance2 = (scale4.lastBarRightSideDiffBarCount + (size - centerOffset - 1 - dataIndex)) * scale4.barSpace;
24556
24628
  this.scrollByDistance(distance2, animationDuration);
24557
- console.log("%c [ xAxisModal ]-1751", "font-size:13px; background:pink; color:#bf2c9f;", xAxisModal);
24558
24629
  }
24559
24630
  scrollToTimestamp(timestamp, animationDuration) {
24560
24631
  if (this._disposed) {
@@ -55617,6 +55688,13 @@ function install24(registers) {
55617
55688
  registers.registerLayout(linesPlotLayout_default);
55618
55689
  }
55619
55690
 
55691
+ // src/chart/strategy/constants.ts
55692
+ var LongColor = "rgb(41, 98, 255)";
55693
+ var ShortColor = "rgb(255, 23, 68)";
55694
+ var CloseColor = "rgb(213, 0, 249)";
55695
+ var ArrowSize = [12, 16];
55696
+ var TriangleSize = [6, 10];
55697
+
55620
55698
  // src/chart/strategy/SymbolPath.ts
55621
55699
  var LargeSymbolPathShape3 = class {
55622
55700
  };
@@ -55649,8 +55727,6 @@ var SymbolPath2 = class extends Path_default {
55649
55727
  var SymbolPath_default2 = SymbolPath2;
55650
55728
 
55651
55729
  // src/chart/strategy/StrategyView.ts
55652
- var LongColor = "rgb(41, 98, 255)";
55653
- var ShortColor = "rgb(255, 23, 68)";
55654
55730
  var StrategyView2 = class extends Chart_default {
55655
55731
  constructor() {
55656
55732
  super(...arguments);
@@ -55688,7 +55764,7 @@ var StrategyView2 = class extends Chart_default {
55688
55764
  const upTriangleEl = new SymbolPath_default2({
55689
55765
  shape: {
55690
55766
  points: upTriangle,
55691
- size: [6, 10]
55767
+ size: TriangleSize
55692
55768
  },
55693
55769
  style: {
55694
55770
  fill: LongColor
@@ -55701,7 +55777,7 @@ var StrategyView2 = class extends Chart_default {
55701
55777
  const arrowUpEl = new SymbolPath_default2({
55702
55778
  shape: {
55703
55779
  points: upArrow,
55704
- size: [12, 16]
55780
+ size: ArrowSize
55705
55781
  },
55706
55782
  style: {
55707
55783
  fill: LongColor
@@ -55715,11 +55791,29 @@ var StrategyView2 = class extends Chart_default {
55715
55791
  triangleHeight: 6
55716
55792
  };
55717
55793
  symbolGroup.add(arrowUpEl);
55794
+ const closeUpArrow = data.getLayout("closeUpArrow");
55795
+ const closeUpArrowEl = new SymbolPath_default2({
55796
+ shape: {
55797
+ points: upArrow,
55798
+ size: ArrowSize
55799
+ },
55800
+ style: {
55801
+ fill: CloseColor
55802
+ },
55803
+ z2
55804
+ });
55805
+ closeUpArrowEl.symbolProxy = createSymbol("arrowUpClose", 0, 0, 0, 0);
55806
+ closeUpArrowEl.symbolProxy.shape = {
55807
+ ...arrowUpEl.symbolProxy.shape,
55808
+ triangleWidth: 4,
55809
+ triangleHeight: 6
55810
+ };
55811
+ symbolGroup.add(closeUpArrow);
55718
55812
  const downTriangle = data.getLayout("downTriangle");
55719
55813
  const downTriangleEl = new SymbolPath_default2({
55720
55814
  shape: {
55721
55815
  points: downTriangle,
55722
- size: [6, 10]
55816
+ size: TriangleSize
55723
55817
  },
55724
55818
  style: {
55725
55819
  fill: ShortColor
@@ -55732,7 +55826,7 @@ var StrategyView2 = class extends Chart_default {
55732
55826
  const arrowDownEl = new SymbolPath_default2({
55733
55827
  shape: {
55734
55828
  points: downArrow,
55735
- size: [12, 16]
55829
+ size: ArrowSize
55736
55830
  },
55737
55831
  style: {
55738
55832
  fill: ShortColor
@@ -55813,7 +55907,7 @@ StrategySeriesModel.defaultOption = {
55813
55907
  var StrategySeries_default = StrategySeriesModel;
55814
55908
 
55815
55909
  // src/chart/strategy/StrategyLayout.ts
55816
- var arrowHeight = 16;
55910
+ var arrowHeight = ArrowSize[1];
55817
55911
  var arrowMargin = 10;
55818
55912
  var textMargin = 6;
55819
55913
  var textHeight = 26;
@@ -55847,6 +55941,10 @@ var StrategyLayout = {
55847
55941
  const downTriangle = [];
55848
55942
  const upArrow = [];
55849
55943
  const downArrow = [];
55944
+ const closeDownArrow = [];
55945
+ const closeUpArrow = [];
55946
+ const closeUpTriangle = [];
55947
+ const closeDownTriangle = [];
55850
55948
  const texts = [];
55851
55949
  for (let i = params.start; i < params.end; i++) {
55852
55950
  const x = store.get(dimIdx0, i);
@@ -55859,8 +55957,9 @@ var StrategyLayout = {
55859
55957
  const baseDownPoint = coordSys.dataToPoint([x, baseDown]);
55860
55958
  const optimizeX = baseUpPoint[0] + 0.5;
55861
55959
  each(upOrders, function(item) {
55862
- upTriangle.push(coordSys.dataToPoint([x, item.price]));
55863
- upArrow.push([optimizeX, baseUpPoint[1] + arrowMargin + arrowHeight / 2]);
55960
+ (item.isClose ? closeUpTriangle : upTriangle).push(coordSys.dataToPoint([x, item.price]));
55961
+ const arrowY = baseUpPoint[1] + arrowMargin + arrowHeight / 2;
55962
+ (item.isClose ? closeUpArrow : upArrow).push([optimizeX, arrowY]);
55864
55963
  if (!allInVisible) {
55865
55964
  const count2 = countVisible ? "+" + item.count : "";
55866
55965
  const comment = signVisible ? item.comment : "";
@@ -55875,8 +55974,9 @@ var StrategyLayout = {
55875
55974
  baseUpPoint[1] = baseUpPoint[1] + arrowMargin + arrowHeight + visibleTextMargin + visibleTextHeight;
55876
55975
  });
55877
55976
  each(downOrders, function(item) {
55878
- downTriangle.push(coordSys.dataToPoint([x, item.price]));
55879
- downArrow.push([optimizeX, baseDownPoint[1] - arrowMargin - arrowHeight / 2]);
55977
+ (item.isClose ? closeDownTriangle : downTriangle).push(coordSys.dataToPoint([x, item.price]));
55978
+ const arrowY = baseDownPoint[1] - arrowMargin - arrowHeight / 2;
55979
+ (item.isClose ? closeDownArrow : downArrow).push([optimizeX, arrowY]);
55880
55980
  if (!allInVisible) {
55881
55981
  const count2 = countVisible ? "-" + item.count : "";
55882
55982
  const comment = signVisible ? item.comment : "";
@@ -55893,7 +55993,11 @@ var StrategyLayout = {
55893
55993
  downTriangle,
55894
55994
  upArrow,
55895
55995
  downArrow,
55896
- texts
55996
+ texts,
55997
+ closeDownArrow,
55998
+ closeUpArrow,
55999
+ closeUpTriangle,
56000
+ closeDownTriangle
55897
56001
  });
55898
56002
  }
55899
56003
  };