Sha256: 75f36115b2ee60a2bcae6ef6d6ae60a64d04961e0cfe2f79fda4e13fa5e46b5e

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module Playbook
  module PbTreemapChart
    class TreemapChart < Playbook::KitBase
      prop :chart_data, type: Playbook::Props::Array,
                        default: []
      prop :colors, type: Playbook::Props::Array,
                    default: []
      prop :drillable, type: Playbook::Props::Boolean, default: false
      prop :grouped, type: Playbook::Props::Boolean, default: false
      prop :height
      prop :title, default: ""
      prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">&#9679; </span>
                                      {point.name}: ' + '<b>{point.value}
                                    </b>'

      def chart_type
        "treemap"
      end

      def chart_options
        {
          chartData: chart_data,
          className: classname,
          colors:,
          dark: dark ? "dark" : "",
          drillable:,
          grouped:,
          height:,
          id:,
          title:,
          tooltipHtml: tooltip_html,
          type: chart_type,
        }
      end

      def classname
        generate_classname("pb_treemap_chart")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
playbook_ui-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb
playbook_ui-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb