<commit_before>import Treemap from '../../../common/charts/treemap';
import completeTree from './complete-tree';

controller.$inject = ['$log', 'dataService'];
function controller($log, dataService) {
  const $ctrl = this;

  console.log('data', $ctrl.dataPackage.resources[0].data);
  // complete tree
  const tree = completeTree($ctrl.dataPackage.resources[0].data);
  console.log('tree', tree);
  // add treemap
  const paramTreemap = {
    div: 'charts',
    id: 'treemap',
    dispatch,
    title: `Treemap of ${$ctrl.dataPackage.resources[0].name}`
    // titleSize: 20,
    // width: 700,
    // height: 5000
    // shape: 'rake' // comb, curve, rake
  };
  const treemap = new Treemap(paramTreemap);

  return Object.assign($ctrl, {
    editorOptions: {
      data: $ctrl.dataPackage,
      onChange: update
    },
    $onInit() {
      draw();
    }
  });

  function draw() {
    treemap.init();
    update();
  }

  function update() {
    treemap.data(tree);
    treemap.update();
  }<commit_msg>Text displayed + text margin + rects null not displayed<commit_after>import Treemap from '../../../common/charts/treemap';
import completeTree from './complete-tree';

controller.$inject = ['$log', 'dataService'];
function controller($log, dataService) {
  const $ctrl = this;

  console.log('data', $ctrl.dataPackage.resources[0].data);
  // complete tree
  const tree = completeTree($ctrl.dataPackage.resources[0].data);
  console.log('tree', tree);
  // add treemap
  const paramTreemap = {
    div: 'charts',
    id: 'treemap',
    dispatch,
    title: `Treemap of ${$ctrl.dataPackage.resources[0].name}`,
    // titleSize: 20,
    // shape: 'rake' // comb, curve, rake
  };
  const treemap = new Treemap(paramTreemap);

  return Object.assign($ctrl, {
    editorOptions: {
      data: $ctrl.dataPackage,
      onChange: update
    },
    $onInit() {
      draw();
    }
  });

  function draw() {
    treemap.init();
    update();
  }

  function update() {
    treemap.data(tree);
    treemap.update();
  }
{'fraction_non_alphanumeric': 0.1702970297029703, 'fraction_numerical': 0.008415841584158416, 'mean_word_length': 2.994071146245059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6531334', 'n_tokens_mistral': 692, 'n_tokens_neox': 666, 'n_words': 145}