11import React , { useMemo , useState } from "react" ;
22import Chart from "../../../components/chart" ;
3- import { range } from "lodash" ;
43import { getFunctionDefaultValue } from "../../../lib" ;
54import { Row , Col , Space , Card } from "antd" ;
65import { thousandFormatter } from "../../../components/chart/options/common" ;
76import { VisualCardWrapper } from "../components" ;
7+ // import { range } from "lodash";
88
99// Withhout bin value calculation from ChartBinningHeatmapSensitivityAnalysis
1010
@@ -22,22 +22,36 @@ const getOptions = ({
2222 target = 0 ,
2323 origin = [ ] ,
2424} ) => {
25- const xAxisData = [
26- ...range (
27- xAxis . min ,
28- xAxis . max ,
29- ( xAxis . max - xAxis . min ) / ( HEATMAP_SIZE - 1 )
30- ) . map ( ( x ) => x . toFixed ( 2 ) ) ,
31- xAxis . max . toFixed ( 2 ) ,
32- ] ;
33- const yAxisData = [
34- ...range (
35- yAxis . min ,
36- yAxis . max ,
37- ( yAxis . max - yAxis . min ) / ( HEATMAP_SIZE - 1 )
38- ) . map ( ( x ) => x . toFixed ( 2 ) ) ,
39- yAxis . max . toFixed ( 2 ) ,
40- ] ;
25+ // TODO:: Remove after task ENG-2487 marked as DONE
26+ // const xAxisData = [
27+ // ...range(
28+ // xAxis.min,
29+ // xAxis.max,
30+ // (xAxis.max - xAxis.min) / (HEATMAP_SIZE - 1)
31+ // ).map((x) => x.toFixed(2)),
32+ // xAxis.max.toFixed(2),
33+ // ];
34+ // const yAxisData = [
35+ // ...range(
36+ // yAxis.min,
37+ // yAxis.max,
38+ // (yAxis.max - yAxis.min) / (HEATMAP_SIZE - 1)
39+ // ).map((x) => x.toFixed(2)),
40+ // yAxis.max.toFixed(2),
41+ // ];
42+ // EOL TODO::
43+
44+ const xAxisData = Array . from ( { length : HEATMAP_SIZE } , ( _ , i ) => {
45+ const value =
46+ xAxis . min + ( i * ( xAxis . max - xAxis . min ) ) / ( HEATMAP_SIZE - 1 ) ;
47+ return value . toFixed ( 2 ) ;
48+ } ) ;
49+
50+ const yAxisData = Array . from ( { length : HEATMAP_SIZE } , ( _ , i ) => {
51+ const value =
52+ yAxis . min + ( i * ( yAxis . max - yAxis . min ) ) / ( HEATMAP_SIZE - 1 ) ;
53+ return value . toFixed ( 2 ) ;
54+ } ) ;
4155
4256 const dt = xAxisData
4357 . map ( ( h ) => {
0 commit comments