package com.bd.utility.correlatepop.util;

import com.bd.utility.correlatepop.Correlate;
import org.tc33.jheatchart.HeatChart;

import java.io.File;
import java.io.IOException;


public class HeatMapUtil {
    // Step 1: Create our heat map chart using our data.

//    public double[][] data;

//    public ClusterAutoClass Clac = new ClusterAutoClass();

    public boolean makeHeatmap(double[][] data, ClusterAutoClass Clac) {

        File file = new File(Clac.pluginDerFile+"/classification-" + Clac.RunID + ".png");

        try {

            HeatChart map = new HeatChart(data);

            map.setTitle(Clac.categoricalParam + " " + Clac.RunID);

            map.saveToFile(file);

        }catch(IOException e){
            System.out.println("Error: " + e);
        }

        if(file.exists()){
            return true;
        } else {
            return false;
        }

    }
// Step 2: Customise the chart.
//
//    map.
//map.set = ("This is my heat chart title");
//map.setXAxisLabel("X Axis");
//map.setYAxisLabel("Y Axis");
//
//// Step 3: Output the chart to a file.
//map.saveToFile(new File("java-heat-chart.png"));
//
//public boolean heatMap (Double[][] data) {
//
//    data = this.data;
//
//    File file = new File();
//
//    if(file.exists()){
//        return true;
//    } else {
//        return false;
//    }
//}


}
