<template>
<chart class="xp-treemap" :options="options" ref="treemap" auto-resize></chart>
</template>

<script>
import { setOptions } from './options'

export default {
  name: 'XpTreemap',

  data() {
    return {
      options: {},
    }
  },

  props: {
    settings: {
      type: Object,
      default: () => {}
    },
  },

  watch: {
    settings(newVal) {
      this.options = setOptions(this.settings)
    },
  },

  mounted() {
    this.options = setOptions(this.settings)
  },
}
</script>
