// module/health/components/report-health-scheme/report-health-scheme.ts
Component({
  lifetimes: {},
  properties: {
    dataset: { type: Object },
  },
  data: {
    wrapper: { width: 'auto', height: 'auto' },
    show: false,
  },
  observers: {
    'dataset'(data) {
      const show = !!data;
      this.setData({ show })
      if (show) setTimeout(() => this._getContainerRect(), 300);
    }
  },
  methods: {
    _getContainerRect() {
      this.createSelectorQuery().select('.wrapper__bg').boundingClientRect().exec(res => {
        this.setData({
          'wrapper.width': `${res[0]?.width}px`,
          'wrapper.height': `${res[0]?.height}px`,
        })
      })
    }
  }
})