|
@@ -626,13 +626,15 @@ export default class StockHeatmap extends React.Component {
|
|
|
const bid1 = marketDepth.buys[0];
|
|
const bid1 = marketDepth.buys[0];
|
|
|
const ts = d.ts;
|
|
const ts = d.ts;
|
|
|
// draw buys
|
|
// draw buys
|
|
|
|
|
+ let color = d3.color('#1a506d').rgb();
|
|
|
if (marketDepth.buys && marketDepth.buys.length > 0) {
|
|
if (marketDepth.buys && marketDepth.buys.length > 0) {
|
|
|
marketDepth.buys.map(buy => {
|
|
marketDepth.buys.map(buy => {
|
|
|
- let rate = buy.qty / maxBidAskVolume;
|
|
|
|
|
- let colorIndex = Math.min(parseInt(rate / 0.25), panel.orderbookColors.length - 1);
|
|
|
|
|
- let color = d3.color(panel.orderbookColors[colorIndex]).rgb()
|
|
|
|
|
-
|
|
|
|
|
- color.opacity = 0.5 + 0.5 * (rate % 0.25) / 0.25;
|
|
|
|
|
|
|
+ // let rate = buy.qty / maxBidAskVolume;
|
|
|
|
|
+ // let colorIndex = Math.min(parseInt(rate / 0.25), panel.orderbookColors.length - 1);
|
|
|
|
|
+ // let color = d3.color(panel.orderbookColors[colorIndex]).rgb()
|
|
|
|
|
+ //
|
|
|
|
|
+ // color.opacity = 0.5 + 0.5 * (rate % 0.25) / 0.25;
|
|
|
|
|
+ color.opacity = buy.qty / maxBidAskVolume;
|
|
|
this.drawingContext.fillStyle = color.toString();
|
|
this.drawingContext.fillStyle = color.toString();
|
|
|
this.drawingContext.fillRect(
|
|
this.drawingContext.fillRect(
|
|
|
this.xScale(ts),
|
|
this.xScale(ts),
|
|
@@ -645,11 +647,12 @@ export default class StockHeatmap extends React.Component {
|
|
|
// draw sells
|
|
// draw sells
|
|
|
if (marketDepth.sells && marketDepth.sells.length > 0) {
|
|
if (marketDepth.sells && marketDepth.sells.length > 0) {
|
|
|
marketDepth.sells.map(sell => {
|
|
marketDepth.sells.map(sell => {
|
|
|
- let rate = sell.qty / maxBidAskVolume;
|
|
|
|
|
- let colorIndex = Math.min(parseInt(rate / 0.25), panel.orderbookColors.length - 1);
|
|
|
|
|
- let color = d3.color(panel.orderbookColors[colorIndex]).rgb()
|
|
|
|
|
-
|
|
|
|
|
- color.opacity = 0.5 + 0.5 * (rate % 0.25) / 0.25;
|
|
|
|
|
|
|
+ // let rate = sell.qty / maxBidAskVolume;
|
|
|
|
|
+ // let colorIndex = Math.min(parseInt(rate / 0.25), panel.orderbookColors.length - 1);
|
|
|
|
|
+ // let color = d3.color(panel.orderbookColors[colorIndex]).rgb()
|
|
|
|
|
+ //
|
|
|
|
|
+ // color.opacity = 0.5 + 0.5 * (rate % 0.25) / 0.25;
|
|
|
|
|
+ color.opacity = sell.qty / maxBidAskVolume;
|
|
|
this.drawingContext.fillStyle = color.toString();
|
|
this.drawingContext.fillStyle = color.toString();
|
|
|
this.drawingContext.fillRect(
|
|
this.drawingContext.fillRect(
|
|
|
this.xScale(ts),
|
|
this.xScale(ts),
|