skutac / InCHlib.js

InCHlib (Interactive Cluster Heatmap library)
http://openscreen.cz/software/inchlib
37 stars 15 forks source link

Overlapping rows #19

Closed Mesya82 closed 3 years ago

Mesya82 commented 7 years ago

Hello! Just started using this library and got into a problem. image As you can see the graph is not looking as pretty as it supposed to be.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>InCHlib test</title>
</head>
<body>

<style>
  html, body {
    height: 100%;
  }

  .diagram-container {
    /*width: 1000px;*/
    /*margin: 0 auto;*/
    /*height: 100%;*/
    /*position: relative;*/
  }

  .upload-container {
    text-align: center;
  }
</style>

<div class="upload-container">
  <input type="file" id="file">
  <button id="upload-btn">Upload</button>
</div>

<div class="diagram-container" id="diagram"></div>

<script src="jquery-2.0.3.min.js"></script>
<script src="kinetic-v5.1.0.min.js"></script>
<script src="inchlib-1.2.0.js"></script>
<script>
  $(document).ready(function () {

    window.inchlib = new InCHlib({
      target: "diagram",
      max_height: 1200,
      width: 1000,
      height: 1000,
      heatmap_colors: "Greens",
      metadata_colors: "Reds"
    });

    $('#upload-btn').click(function () {
      var $file = $('#file')[0];
      console.log('upload', $file);

      if ($file.files.length !== 1)
        return;

      var data = new FormData();
      var file = $file.files[0];
      data.append('uploaded_file', file);
      console.log('to upload file', data);

      $.ajax({
        url: 'http://%ip_here%/heatmap/generate-from-file',
        method: 'POST',
        data: data,
        contentType: false,
        processData: false,
        success: function (response) {
          var inchlibData = {
            data: response,
            feature_names: ['Test', 'Test', 'Test', 'Test', 'Test', 'Test', 'Test', 'Test', 'Test', 'Test', 'Test']
          };

          console.log('res', inchlibData);

          inchlib.read_data(inchlibData);
          inchlib.draw();
          inchlib.redraw();
        }
      })
    });

  });
</script>

</body>
</html>

The result object, that i'm loading is:

{
   "data":{
      "nodes":{
         "node_1":{
            "count":2,
            "distance":292804.2452509868,
            "left_child":"node_1_1",
            "right_child":"node_1_2"
         },
         "node_1_1":{
            "count":2,
            "distance":98700.97925552714,
            "parent":"node_1",
            "left_child":"leaf_1_1",
            "right_child":"leaf_1_2"
         },
         "leaf_1_1":{
            "count":1,
            "distance":0,
            "features":[
               29206,
               33861,
               72097,
               77531,
               58481,
               105518,
               92070,
               78355,
               70405,
               92637,
               108015,
               134736
            ],
            "parent":"node_1_1",
            "objects":[

            ]
         },
         "leaf_1_2":{
            "count":1,
            "distance":0,
            "features":[
               40846,
               42283,
               47661,
               51234,
               40695,
               67824,
               49854,
               49842,
               47694,
               69840,
               76302,
               91455
            ],
            "parent":"node_1_1",
            "objects":[

            ]
         },
         "node_1_2":{
            "count":2,
            "distance":93388.76946935322,
            "parent":"node_1",
            "left_child":"node_2_1",
            "right_child":"node_2_2"
         },
         "node_2_1":{
            "count":2,
            "distance":38637.842667519624,
            "parent":"node_1_2",
            "left_child":"leaf_2_1",
            "right_child":"leaf_2_2"
         },
         "leaf_2_1":{
            "count":1,
            "distance":0,
            "features":[
               12528,
               12332,
               10870,
               13678,
               12223,
               27685,
               20601,
               11839,
               14087,
               18218,
               27248,
               22959
            ],
            "parent":"node_2_1",
            "objects":[

            ]
         },
         "leaf_2_2":{
            "count":1,
            "distance":0,
            "features":[
               25015,
               27241,
               26155,
               25232,
               27315,
               27817,
               27768,
               28620,
               24512,
               24822,
               30568,
               27805
            ],
            "parent":"node_2_1",
            "objects":[

            ]
         },
         "node_2_2":{
            "count":2,
            "distance":33938.640824287584,
            "parent":"node_1_2",
            "left_child":"node_3_1",
            "right_child":"leaf_3_1"
         },
         "leaf_3_1":{
            "count":1,
            "distance":0,
            "features":[
               5425,
               5855,
               15135,
               918,
               4191,
               13009,
               12942,
               6703,
               12273,
               1247,
               17477,
               1343
            ],
            "parent":"node_2_2",
            "objects":[

            ]
         },
         "node_3_1":{
            "count":2,
            "distance":21084.552117604966,
            "parent":"node_2_2",
            "left_child":"node_4_1",
            "right_child":"node_4_2"
         },
         "node_4_1":{
            "count":2,
            "distance":12906.087982033905,
            "parent":"node_3_1",
            "left_child":"node_5_1",
            "right_child":"leaf_4_1"
         },
         "leaf_4_1":{
            "count":1,
            "distance":0,
            "features":[
               4895,
               9788,
               1243,
               418,
               687,
               941,
               2161,
               1223,
               837,
               300,
               3289,
               496
            ],
            "parent":"node_4_1",
            "objects":[

            ]
         },
         "node_4_2":{
            "count":2,
            "distance":11573.417127192815,
            "parent":"node_3_1",
            "left_child":"node_6_1",
            "right_child":"node_6_2"
         },
         "node_5_1":{
            "count":2,
            "distance":10627.845783600738,
            "parent":"node_4_1",
            "left_child":"node_7_1",
            "right_child":"leaf_5_1"
         },
         "leaf_5_1":{
            "count":1,
            "distance":0,
            "features":[
               7976,
               8084,
               4059,
               7933,
               8309,
               6473,
               1067,
               1382,
               849,
               1635,
               3595,
               2633
            ],
            "parent":"node_5_1",
            "objects":[

            ]
         },
         "node_6_1":{
            "count":2,
            "distance":10035.805697600965,
            "parent":"node_4_2",
            "left_child":"node_8_1",
            "right_child":"leaf_6_1"
         },
         "leaf_6_1":{
            "count":1,
            "distance":0,
            "features":[
               760,
               738,
               439,
               390,
               825,
               1153,
               3477,
               6772,
               5891,
               1443,
               1008,
               1255
            ],
            "parent":"node_6_1",
            "objects":[

            ]
         },
         "node_6_2":{
            "count":2,
            "distance":9509.302287760127,
            "parent":"node_4_2",
            "left_child":"node_9_1",
            "right_child":"leaf_7_1"
         },
         "leaf_7_1":{
            "count":1,
            "distance":0,
            "features":[
               5312,
               6411,
               5839,
               6215,
               6002,
               9093,
               4214,
               5131,
               4498,
               4162,
               7607,
               6685
            ],
            "parent":"node_6_2",
            "objects":[

            ]
         },
         "node_7_1":{
            "count":2,
            "distance":8039.358743083928,
            "parent":"node_5_1",
            "left_child":"node_10_1",
            "right_child":"node_10_2"
         },
         "node_8_1":{
            "count":2,
            "distance":6769.381803385003,
            "parent":"node_6_1",
            "left_child":"leaf_8_1",
            "right_child":"leaf_8_2"
         },
         "leaf_8_1":{
            "count":1,
            "distance":0,
            "features":[
               259,
               358,
               223,
               625,
               2636,
               805,
               1362,
               84,
               1438,
               6604,
               274,
               147
            ],
            "parent":"node_8_1",
            "objects":[

            ]
         },
         "leaf_8_2":{
            "count":1,
            "distance":0,
            "features":[
               1083,
               2476,
               1700,
               3830,
               4926,
               3326,
               3684,
               1267,
               1533,
               6688,
               2179,
               2631
            ],
            "parent":"node_8_1",
            "objects":[

            ]
         },
         "node_9_1":{
            "count":2,
            "distance":5949.069254933917,
            "parent":"node_6_2",
            "left_child":"node_11_1",
            "right_child":"leaf_9_1"
         },
         "leaf_9_1":{
            "count":1,
            "distance":0,
            "features":[
               2233,
               2155,
               5320,
               6391,
               5489,
               3529,
               1641,
               2516,
               2428,
               5404,
               4695,
               4802
            ],
            "parent":"node_9_1",
            "objects":[

            ]
         },
         "node_10_1":{
            "count":2,
            "distance":4426.900721723947,
            "parent":"node_7_1",
            "left_child":"node_12_1",
            "right_child":"leaf_10_1"
         },
         "leaf_10_1":{
            "count":1,
            "distance":0,
            "features":[
               2750,
               3245,
               1053,
               1236,
               1583,
               3565,
               1460,
               1915,
               1447,
               1836,
               1967,
               3701
            ],
            "parent":"node_10_1",
            "objects":[

            ]
         },
         "node_10_2":{
            "count":2,
            "distance":3866.5610043034367,
            "parent":"node_7_1",
            "left_child":"leaf_11_1",
            "right_child":"leaf_11_2"
         },
         "leaf_11_1":{
            "count":1,
            "distance":0,
            "features":[
               3788,
               4508,
               2732,
               4263,
               2505,
               4462,
               2511,
               2612,
               2311,
               3295,
               4461,
               3728
            ],
            "parent":"node_10_2",
            "objects":[

            ]
         },
         "leaf_11_2":{
            "count":1,
            "distance":0,
            "features":[
               3863,
               4265,
               3992,
               3872,
               4268,
               4187,
               4359,
               4569,
               3765,
               3805,
               4537,
               4308
            ],
            "parent":"node_10_2",
            "objects":[

            ]
         },
         "node_11_1":{
            "count":2,
            "distance":3753.0796687520506,
            "parent":"node_9_1",
            "left_child":"node_13_1",
            "right_child":"leaf_12_1"
         },
         "leaf_12_1":{
            "count":1,
            "distance":0,
            "features":[
               1558,
               1805,
               569,
               1386,
               1567,
               2211,
               337,
               503,
               414,
               700,
               849,
               1027
            ],
            "parent":"node_11_1",
            "objects":[

            ]
         },
         "node_12_1":{
            "count":2,
            "distance":2595.5305815959864,
            "parent":"node_10_1",
            "left_child":"node_14_1",
            "right_child":"leaf_13_1"
         },
         "leaf_13_1":{
            "count":1,
            "distance":0,
            "features":[
               1827,
               1966,
               1870,
               1889,
               2023,
               2088,
               2079,
               2218,
               1774,
               1809,
               2141,
               2073
            ],
            "parent":"node_12_1",
            "objects":[

            ]
         },
         "node_13_1":{
            "count":2,
            "distance":2269.164603989759,
            "parent":"node_11_1",
            "left_child":"node_15_1",
            "right_child":"node_15_2"
         },
         "node_14_1":{
            "count":2,
            "distance":1727.6376934994212,
            "parent":"node_12_1",
            "left_child":"node_16_1",
            "right_child":"leaf_14_1"
         },
         "leaf_14_1":{
            "count":1,
            "distance":0,
            "features":[
               532,
               810,
               543,
               573,
               845,
               859,
               555,
               464,
               467,
               697,
               737,
               637
            ],
            "parent":"node_14_1",
            "objects":[

            ]
         },
         "node_15_1":{
            "count":2,
            "distance":1538.9434687473092,
            "parent":"node_13_1",
            "left_child":"leaf_15_1",
            "right_child":"leaf_15_2"
         },
         "leaf_15_1":{
            "count":1,
            "distance":0,
            "features":[
               717,
               869,
               1174,
               1809,
               2098,
               2547,
               1398,
               877,
               822,
               1661,
               1558,
               1820
            ],
            "parent":"node_15_1",
            "objects":[

            ]
         },
         "leaf_15_2":{
            "count":1,
            "distance":0,
            "features":[
               1153,
               1200,
               1425,
               1415,
               1470,
               1744,
               1577,
               1640,
               1247,
               1603,
               1652,
               1885
            ],
            "parent":"node_15_1",
            "objects":[

            ]
         },
         "node_15_2":{
            "count":2,
            "distance":1244.0088424123037,
            "parent":"node_13_1",
            "left_child":"node_17_1",
            "right_child":"node_17_2"
         },
         "node_16_1":{
            "count":2,
            "distance":914.9923496947939,
            "parent":"node_14_1",
            "left_child":"leaf_16_1",
            "right_child":"leaf_16_2"
         },
         "leaf_16_1":{
            "count":1,
            "distance":0,
            "features":[
               256,
               319,
               476,
               273,
               1261,
               909,
               205,
               71,
               75,
               139,
               184,
               185
            ],
            "parent":"node_16_1",
            "objects":[

            ]
         },
         "leaf_16_2":{
            "count":1,
            "distance":0,
            "features":[
               539,
               748,
               497,
               162,
               589,
               623,
               112,
               107,
               85,
               212,
               130,
               92
            ],
            "parent":"node_16_1",
            "objects":[

            ]
         },
         "node_17_1":{
            "count":2,
            "distance":810.4406208970526,
            "parent":"node_15_2",
            "left_child":"node_18_1",
            "right_child":"node_18_2"
         },
         "node_17_2":{
            "count":2,
            "distance":672.1435858505234,
            "parent":"node_15_2",
            "left_child":"leaf_17_1",
            "right_child":"leaf_17_2"
         },
         "leaf_17_1":{
            "count":1,
            "distance":0,
            "features":[
               53,
               100,
               108,
               118,
               283,
               822,
               110,
               49,
               48,
               118,
               161,
               67
            ],
            "parent":"node_17_2",
            "objects":[

            ]
         },
         "leaf_17_2":{
            "count":1,
            "distance":0,
            "features":[
               326,
               378,
               343,
               211,
               430,
               912,
               341,
               210,
               208,
               299,
               334,
               264
            ],
            "parent":"node_17_2",
            "objects":[

            ]
         },
         "node_18_1":{
            "count":2,
            "distance":510.41845577917735,
            "parent":"node_17_1",
            "left_child":"node_19_1",
            "right_child":"node_19_2"
         },
         "node_18_2":{
            "count":2,
            "distance":472.79699660636595,
            "parent":"node_17_1",
            "left_child":"node_20_1",
            "right_child":"leaf_18_1"
         },
         "leaf_18_1":{
            "count":1,
            "distance":0,
            "features":[
               415,
               374,
               180,
               326,
               256,
               291,
               133,
               142,
               139,
               285,
               204,
               156
            ],
            "parent":"node_18_2",
            "objects":[

            ]
         },
         "node_19_1":{
            "count":2,
            "distance":356.90054637111444,
            "parent":"node_18_1",
            "left_child":"node_21_1",
            "right_child":"node_21_2"
         },
         "node_19_2":{
            "count":2,
            "distance":294.25329225006135,
            "parent":"node_18_1",
            "left_child":"node_22_1",
            "right_child":"node_22_2"
         },
         "node_20_1":{
            "count":2,
            "distance":274.22618401604177,
            "parent":"node_18_2",
            "left_child":"leaf_19_1",
            "right_child":"leaf_19_2"
         },
         "leaf_19_1":{
            "count":1,
            "distance":0,
            "features":[
               118,
               165,
               216,
               264,
               311,
               419,
               72,
               84,
               69,
               112,
               121,
               121
            ],
            "parent":"node_20_1",
            "objects":[

            ]
         },
         "leaf_19_2":{
            "count":1,
            "distance":0,
            "features":[
               138,
               302,
               57,
               128,
               373,
               365,
               92,
               40,
               53,
               94,
               94,
               164
            ],
            "parent":"node_20_1",
            "objects":[

            ]
         },
         "node_21_1":{
            "count":2,
            "distance":206.80183751601436,
            "parent":"node_19_1",
            "left_child":"node_23_1",
            "right_child":"node_23_2"
         },
         "node_21_2":{
            "count":2,
            "distance":191.35830266805775,
            "parent":"node_19_1",
            "left_child":"leaf_20_1",
            "right_child":"leaf_20_2"
         },
         "leaf_20_1":{
            "count":1,
            "distance":0,
            "features":[
               152,
               146,
               156,
               137,
               132,
               168,
               146,
               157,
               136,
               147,
               150,
               167
            ],
            "parent":"node_21_2",
            "objects":[

            ]
         },
         "leaf_20_2":{
            "count":1,
            "distance":0,
            "features":[
               41,
               55,
               100,
               97,
               72,
               166,
               114,
               103,
               84,
               121,
               160,
               183
            ],
            "parent":"node_21_2",
            "objects":[

            ]
         },
         "node_22_1":{
            "count":2,
            "distance":167.9017569890202,
            "parent":"node_19_2",
            "left_child":"node_24_1",
            "right_child":"leaf_21_1"
         },
         "leaf_21_1":{
            "count":1,
            "distance":0,
            "features":[
               48,
               86,
               85,
               111,
               231,
               255,
               176,
               50,
               67,
               91,
               119,
               62
            ],
            "parent":"node_22_1",
            "objects":[

            ]
         },
         "node_22_2":{
            "count":2,
            "distance":150.449327017438,
            "parent":"node_19_2",
            "left_child":"node_25_1",
            "right_child":"leaf_22_1"
         },
         "leaf_22_1":{
            "count":1,
            "distance":0,
            "features":[
               5,
               2,
               2,
               125,
               71,
               44,
               12,
               8,
               4,
               9,
               38,
               10
            ],
            "parent":"node_22_2",
            "objects":[

            ]
         },
         "node_23_1":{
            "count":2,
            "distance":138.787607515945,
            "parent":"node_21_1",
            "left_child":"node_26_1",
            "right_child":"leaf_23_1"
         },
         "leaf_23_1":{
            "count":1,
            "distance":0,
            "features":[
               90,
               109,
               113,
               90,
               100,
               108,
               117,
               111,
               86,
               95,
               96,
               100
            ],
            "parent":"node_23_1",
            "objects":[

            ]
         },
         "node_23_2":{
            "count":2,
            "distance":136.0367597379473,
            "parent":"node_21_1",
            "left_child":"node_27_1",
            "right_child":"node_27_2"
         },
         "node_24_1":{
            "count":2,
            "distance":129.3599628942433,
            "parent":"node_22_1",
            "left_child":"leaf_24_1",
            "right_child":"leaf_24_2"
         },
         "leaf_24_1":{
            "count":1,
            "distance":0,
            "features":[
               110,
               83,
               80,
               115,
               169,
               219,
               64,
               54,
               38,
               81,
               113,
               84
            ],
            "parent":"node_24_1",
            "objects":[

            ]
         },
         "leaf_24_2":{
            "count":1,
            "distance":0,
            "features":[
               37,
               48,
               46,
               51,
               192,
               254,
               44,
               41,
               54,
               73,
               75,
               55
            ],
            "parent":"node_24_1",
            "objects":[

            ]
         },
         "node_25_1":{
            "count":2,
            "distance":111.45402639653715,
            "parent":"node_22_2",
            "left_child":"node_28_1",
            "right_child":"leaf_25_1"
         },
         "leaf_25_1":{
            "count":1,
            "distance":0,
            "features":[
               17,
               56,
               27,
               66,
               147,
               86,
               60,
               11,
               24,
               65,
               69,
               35
            ],
            "parent":"node_25_1",
            "objects":[

            ]
         },
         "node_26_1":{
            "count":2,
            "distance":103.19883720275146,
            "parent":"node_23_1",
            "left_child":"node_29_1",
            "right_child":"leaf_26_1"
         },
         "leaf_26_1":{
            "count":1,
            "distance":0,
            "features":[
               20,
               17,
               10,
               24,
               34,
               77,
               25,
               6,
               9,
               102,
               15,
               16
            ],
            "parent":"node_26_1",
            "objects":[

            ]
         },
         "node_27_1":{
            "count":2,
            "distance":98.8736567544662,
            "parent":"node_23_2",
            "left_child":"node_30_1",
            "right_child":"leaf_27_1"
         },
         "leaf_27_1":{
            "count":1,
            "distance":0,
            "features":[
               27,
               59,
               39,
               54,
               91,
               173,
               58,
               31,
               22,
               73,
               41,
               43
            ],
            "parent":"node_27_1",
            "objects":[

            ]
         },
         "node_27_2":{
            "count":2,
            "distance":73.3007503372237,
            "parent":"node_23_2",
            "left_child":"leaf_28_1",
            "right_child":"leaf_28_2"
         },
         "leaf_28_1":{
            "count":1,
            "distance":0,
            "features":[
               46,
               58,
               41,
               37,
               74,
               97,
               37,
               43,
               45,
               31,
               54,
               46
            ],
            "parent":"node_27_2",
            "objects":[

            ]
         },
         "leaf_28_2":{
            "count":1,
            "distance":0,
            "features":[
               19,
               16,
               33,
               31,
               99,
               125,
               43,
               33,
               32,
               40,
               70,
               73
            ],
            "parent":"node_27_2",
            "objects":[

            ]
         },
         "node_28_1":{
            "count":2,
            "distance":72.98630008433089,
            "parent":"node_25_1",
            "left_child":"node_31_1",
            "right_child":"node_31_2"
         },
         "node_29_1":{
            "count":2,
            "distance":48.010415536631214,
            "parent":"node_26_1",
            "left_child":"node_32_1",
            "right_child":"leaf_29_1"
         },
         "leaf_29_1":{
            "count":1,
            "distance":0,
            "features":[
               68,
               82,
               74,
               72,
               58,
               62,
               61,
               69,
               44,
               60,
               72,
               70
            ],
            "parent":"node_29_1",
            "objects":[

            ]
         },
         "node_30_1":{
            "count":2,
            "distance":47.45524207081869,
            "parent":"node_27_1",
            "left_child":"node_33_1",
            "right_child":"leaf_30_1"
         },
         "leaf_30_1":{
            "count":1,
            "distance":0,
            "features":[
               10,
               15,
               15,
               20,
               78,
               60,
               22,
               3,
               2,
               12,
               23,
               23
            ],
            "parent":"node_30_1",
            "objects":[

            ]
         },
         "node_31_1":{
            "count":2,
            "distance":42.74342054632502,
            "parent":"node_28_1",
            "left_child":"leaf_31_1",
            "right_child":"leaf_31_2"
         },
         "leaf_31_1":{
            "count":1,
            "distance":0,
            "features":[
               57,
               69,
               66,
               68,
               61,
               81,
               66,
               61,
               77,
               64,
               59,
               73
            ],
            "parent":"node_31_1",
            "objects":[

            ]
         },
         "leaf_31_2":{
            "count":1,
            "distance":0,
            "features":[
               47,
               68,
               61,
               60,
               58,
               80,
               76,
               62,
               44,
               78,
               55,
               58
            ],
            "parent":"node_31_1",
            "objects":[

            ]
         },
         "node_31_2":{
            "count":2,
            "distance":31.28897569432403,
            "parent":"node_28_1",
            "left_child":"node_34_1",
            "right_child":"node_34_2"
         },
         "node_32_1":{
            "count":2,
            "distance":29.916550603303182,
            "parent":"node_29_1",
            "left_child":"leaf_32_1",
            "right_child":"leaf_32_2"
         },
         "leaf_32_1":{
            "count":1,
            "distance":0,
            "features":[
               11,
               10,
               28,
               26,
               51,
               29,
               22,
               16,
               12,
               17,
               22,
               29
            ],
            "parent":"node_32_1",
            "objects":[

            ]
         },
         "leaf_32_2":{
            "count":1,
            "distance":0,
            "features":[
               6,
               5,
               10,
               19,
               57,
               39,
               13,
               7,
               11,
               21,
               16,
               18
            ],
            "parent":"node_32_1",
            "objects":[

            ]
         },
         "node_33_1":{
            "count":2,
            "distance":26.795522013948524,
            "parent":"node_30_1",
            "left_child":"leaf_33_1",
            "right_child":"leaf_33_2"
         },
         "leaf_33_1":{
            "count":1,
            "distance":0,
            "features":[
               11,
               7,
               23,
               11,
               14,
               21,
               14,
               9,
               20,
               17,
               26,
               29
            ],
            "parent":"node_33_1",
            "objects":[

            ]
         },
         "leaf_33_2":{
            "count":1,
            "distance":0,
            "features":[
               4,
               13,
               23,
               10,
               20,
               17,
               29,
               22,
               19,
               24,
               36,
               35
            ],
            "parent":"node_33_1",
            "objects":[

            ]
         },
         "node_34_1":{
            "count":2,
            "distance":18,
            "parent":"node_31_2",
            "left_child":"leaf_34_1",
            "right_child":"leaf_34_2"
         },
         "leaf_34_1":{
            "count":1,
            "distance":0,
            "features":[
               14,
               8,
               7,
               4,
               10,
               9,
               6,
               11,
               8,
               11,
               5,
               13
            ],
            "parent":"node_34_1",
            "objects":[

            ]
         },
         "leaf_34_2":{
            "count":1,
            "distance":0,
            "features":[
               3,
               6,
               6,
               6,
               11,
               9,
               14,
               9,
               14,
               9,
               11,
               20
            ],
            "parent":"node_34_1",
            "objects":[

            ]
         },
         "node_34_2":{
            "count":2,
            "distance":11.180339887498949,
            "parent":"node_31_2",
            "left_child":"leaf_35_1",
            "right_child":"leaf_35_2"
         },
         "leaf_35_1":{
            "count":1,
            "distance":0,
            "features":[
               4,
               6,
               3,
               4,
               3,
               3,
               1,
               1,
               2,
               1,
               1,
               2
            ],
            "parent":"node_34_2",
            "objects":[

            ]
         },
         "leaf_35_2":{
            "count":1,
            "distance":0,
            "features":[
               3,
               9,
               1,
               7,
               2,
               4,
               4,
               6,
               1,
               3,
               7,
               7
            ],
            "parent":"node_34_2",
            "objects":[

            ]
         }
      }
   },
   "feature_names":[
      "Test",
      "Test",
      "Test",
      "Test",
      "Test",
      "Test",
      "Test",
      "Test",
      "Test",
      "Test",
      "Test"
   ]
}

The thing is that I'm trying to figure out input format, so I can generate it from my already clustered data from Java code

Looking for you help!

skutac commented 7 years ago

Hi, there is most probably some problem with your left/right child references.

I've just quickly tried to take your data and cluster them with inchlib_clust and there seems to be no problem.

test

Do you need to user your Java code instead of the inchlib_clust?

Mesya82 commented 7 years ago

Do you need to user your Java code instead of the inchlib_clust?

Yes. I do not have opportunity to use python. Clustering is done by Renjin library.

there is most probably some problem with your left/right child references.

Might it be the problem with "count" attribute?

skutac commented 7 years ago

You are right, I haven't noticed it in the data, but the count attribute represents the number of leaves contained in a certain part of the dendrogram. For root node, it should be the total number of leaves etc.

Mesya82 commented 7 years ago

Yes. Problem was with count. Now it's working perfectly. Thank you for fast response!

skutac commented 3 years ago

Resolved.