Browse Source

v1.1.6

1. 取消合并
2. 买卖颜色更正
skyffire 1 year ago
parent
commit
7e6b604e85
2 changed files with 9 additions and 8 deletions
  1. 1 1
      example/package.json
  2. 8 7
      src/index.js

+ 1 - 1
example/package.json

@@ -1,7 +1,7 @@
 {
   "name": "heatmap",
   "homepage": ".",
-  "version": "1.1.5",
+  "version": "1.1.6",
   "private": true,
   "main": "main.js",
   "scripts": {

+ 8 - 7
src/index.js

@@ -644,7 +644,7 @@ export default class StockHeatmap extends React.Component {
         const bid1 = marketDepth.buys[0];
         const ts = d.ts;
         // draw buys
-        let color = d3.color('#1a506d').rgb();
+        let color = d3.color('#339933').rgb();
         if (marketDepth.buys && marketDepth.buys.length > 0) {
           marketDepth.buys.map(buy => {
             // let rate = buy.qty / maxBidAskVolume;
@@ -663,6 +663,7 @@ export default class StockHeatmap extends React.Component {
           });
         }
         // draw sells
+        color = d3.color('#993333').rgb();
         if (marketDepth.sells && marketDepth.sells.length > 0) {
           marketDepth.sells.map(sell => {
             // let rate = sell.qty / maxBidAskVolume;
@@ -1037,12 +1038,12 @@ export default class StockHeatmap extends React.Component {
       // move position only if within valid range
       this.windowedData = this.data.slice(position, position + this.windowLength + 1);
 
-      if (this.windowedData.length > 1000) {
-        this.windowedData = this.mergeWindowedData();
-        this.isMerged = true;
-      } else {
-        this.isMerged = false;
-      }
+      // if (this.windowedData.length > 1000) {
+      //   this.windowedData = this.mergeWindowedData();
+      //   this.isMerged = true;
+      // } else {
+      //   this.isMerged = false;
+      // }
 
       // 延迟日志
       if (this.windowedData.length > 1) {