Sha256: f7227ba7247c3a3ea15782bf6f7966c0700a2f82dae10cc48541f1e0bf705e82

Contents?: true

Size: 1.5 KB

Versions: 69

Compression:

Stored size: 1.5 KB

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'

import { globalProps } from '../utilities/globalProps'
import pbChart from '../plugins/pb_chart'

type TreemapChartProps = {
  chartData: array<{
    name: string,
    parent?: string | number,
    value: number,
    color?: string,
    id?: string | number,
  }>,
  className?: string,
  colors: array,
  dark?: boolean,
  drillable: boolean,
  grouped: boolean,
  height?: string,
  id: number,
  title: string,
  tooltipHtml: string,
  type?: string,
}

export default class TreemapChart extends React.Component<TreemapChartProps> {
  static defaultProps = {
    className: 'pb_treemap_chart',
    dark: false,
    drillable: false,
    grouped: false,
    type: 'treemap',
  }

  componentDidMount() {
    const {
      chartData,
      className,
      colors  = [],
      dark,
      drillable,
      grouped,
      height,
      id,
      title = "",
      tooltipHtml = '<span style="font-weight: bold; color:{point.color};">&#9679; </span>{point.name}: <b>{point.value}</b>',
      type,
    } = this.props

    new pbChart(`.${className}`, {
      chartData: chartData,
      colors: colors,
      dark,
      drillable,
      grouped,
      height: height,
      id: id,
      title: title,
      tooltipHtml,
      type,
    })
  }

  props: TreemapChartProps

  render() {
    const { className, id } = this.props

    return (
      <div
          className={classnames(globalProps(this.props), className)}
          id={id}
      />
    )
  }
}

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.16.0.pre.alpha.reactupgrade1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.15.0.pre.alpha.table1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.15.0 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.14.0 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.13.0.pre.alpha.fontawesome1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.13.0 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.12.1.pre.alpha.passphrase1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.12.1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.13.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.12.0 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.11.0.pre.alpha.paginate2 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.11.0.pre.alpha.dialog2 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.11.0.pre.alpha.paginate1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.11.0.pre.alpha.renderer1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.11.0.pre.alpha.dialog1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.11.0 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx