tvcharts 0.7.99 → 0.8.2

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.
@@ -316,6 +316,7 @@ var LinesPlotView = /** @class */function (_super) {
316
316
  lineDash: lineDash,
317
317
  stroke: visualColor_1 || color,
318
318
  lineWidth: +lineWidth,
319
+ lineCap: 'round',
319
320
  lineJoin: 'round'
320
321
  },
321
322
  z2: isDefaultColor ? LastZ2 : z2_1
@@ -147,6 +147,45 @@ var OrdinalMeta = /** @class */function () {
147
147
  OrdinalMeta.prototype.getMarksByWeight = function () {
148
148
  return this._marksByWeight;
149
149
  };
150
+ OrdinalMeta.prototype.reFillExtraCategories = function (startTime) {
151
+ var timePoints = [];
152
+ var marksByWeight = new HashMap();
153
+ var formatInterval = this.dataInterval === '1D';
154
+ var utcOffsetTime = this.utcOffsetTime;
155
+ var addItem = function (value, index) {
156
+ var d = formatInterval ? convertToUTCDayStart(value - utcOffsetTime) : value * 1000;
157
+ timePoints.push({
158
+ originalTime: value,
159
+ index: index,
160
+ timestamp: d / 1000
161
+ });
162
+ };
163
+ var categories = this.categories;
164
+ each(categories, function (val, index) {
165
+ addItem(val, index);
166
+ });
167
+ var extraCategory = this.loadMoreCategory(startTime, 300);
168
+ map(extraCategory, function (val, i) {
169
+ var index = i + categories.length;
170
+ addItem(val, index);
171
+ });
172
+ if (timePoints.length) {
173
+ fillWeightsForPoints(timePoints);
174
+ for (var index = 0; index < timePoints.length; ++index) {
175
+ var point = timePoints[index];
176
+ var marksForWeight = marksByWeight.get(point.weight);
177
+ if (marksForWeight === undefined) {
178
+ marksForWeight = [];
179
+ marksByWeight.set(point.weight, marksForWeight);
180
+ }
181
+ marksForWeight.push(point);
182
+ }
183
+ }
184
+ this.extraCategory = extraCategory;
185
+ this._marksByWeight = marksByWeight;
186
+ this._appendCount = 0;
187
+ this.cache = null;
188
+ };
150
189
  OrdinalMeta.prototype.appendData = function (data) {
151
190
  var _a;
152
191
  var _this = this;
@@ -157,6 +196,11 @@ var OrdinalMeta = /** @class */function () {
157
196
  });
158
197
  }
159
198
  (_a = this.categories).push.apply(_a, data);
199
+ var lastUpdateTime = +data[data.length - 1];
200
+ if (lastUpdateTime !== +this.extraCategory[0]) {
201
+ this.reFillExtraCategories(lastUpdateTime);
202
+ return;
203
+ }
160
204
  this.extraCategory.splice(0, data.length);
161
205
  if (this.loadMoreCategory) {
162
206
  var startTime = this.extraCategory[this.extraCategory.length - 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tvcharts",
3
- "version": "0.7.99",
3
+ "version": "0.8.02",
4
4
  "description": "基于echarts5.5.0二次开发",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -2648,7 +2648,7 @@ interface MarksCache {
2648
2648
  }
2649
2649
  declare class OrdinalMeta {
2650
2650
  readonly categories: OrdinalRawValue[];
2651
- readonly extraCategory: OrdinalRawValue[];
2651
+ extraCategory: OrdinalRawValue[];
2652
2652
  private loadMoreCategory;
2653
2653
  cache: MarksCache | null;
2654
2654
  private _marksByWeight;
@@ -2672,6 +2672,7 @@ declare class OrdinalMeta {
2672
2672
  static createByAxisModel(axisModel: Model): OrdinalMeta;
2673
2673
  getOrdinal(category: OrdinalRawValue): OrdinalNumber;
2674
2674
  getMarksByWeight(): HashMap<TimePoint[], string | number>;
2675
+ reFillExtraCategories(startTime: number): void;
2675
2676
  appendData(data: string[]): void;
2676
2677
  getCategories(): OrdinalRawValue[];
2677
2678
  getClosestTime(time: string): number;
@@ -2648,7 +2648,7 @@ interface MarksCache {
2648
2648
  }
2649
2649
  declare class OrdinalMeta {
2650
2650
  readonly categories: OrdinalRawValue[];
2651
- readonly extraCategory: OrdinalRawValue[];
2651
+ extraCategory: OrdinalRawValue[];
2652
2652
  private loadMoreCategory;
2653
2653
  cache: MarksCache | null;
2654
2654
  private _marksByWeight;
@@ -2672,6 +2672,7 @@ declare class OrdinalMeta {
2672
2672
  static createByAxisModel(axisModel: Model): OrdinalMeta;
2673
2673
  getOrdinal(category: OrdinalRawValue): OrdinalNumber;
2674
2674
  getMarksByWeight(): HashMap<TimePoint[], string | number>;
2675
+ reFillExtraCategories(startTime: number): void;
2675
2676
  appendData(data: string[]): void;
2676
2677
  getCategories(): OrdinalRawValue[];
2677
2678
  getClosestTime(time: string): number;
@@ -8,7 +8,7 @@ interface MarksCache {
8
8
  }
9
9
  declare class OrdinalMeta {
10
10
  readonly categories: OrdinalRawValue[];
11
- readonly extraCategory: OrdinalRawValue[];
11
+ extraCategory: OrdinalRawValue[];
12
12
  private loadMoreCategory;
13
13
  cache: MarksCache | null;
14
14
  private _marksByWeight;
@@ -32,6 +32,7 @@ declare class OrdinalMeta {
32
32
  static createByAxisModel(axisModel: Model): OrdinalMeta;
33
33
  getOrdinal(category: OrdinalRawValue): OrdinalNumber;
34
34
  getMarksByWeight(): HashMap<TimePoint[], string | number>;
35
+ reFillExtraCategories(startTime: number): void;
35
36
  appendData(data: string[]): void;
36
37
  getCategories(): OrdinalRawValue[];
37
38
  getClosestTime(time: string): number;