Sha256: 44e5b6ff899407a67af1a6917bae425e38ff67104fca30d1a9a4bbfc21e00b48

Contents?: true

Size: 493 Bytes

Versions: 25

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module ChartsHelper
    # @example A chart with a drilldown
    #   {
    #     "First" => {
    #       "Second" => 3,
    #       "Third" => 3
    #     }
    #   }
    # @example A chart without a drilldown
    #   {
    #     "First" => 3,
    #     "Second" => 4
    #   }
    def hash_to_chart(data)
      data = ChartData.new(data)
      {
        drilldown: { series: data.drilldown },
        series: data.series
      }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-3.0.1 app/helpers/hyrax/charts_helper.rb
hyrax-3.0.0 app/helpers/hyrax/charts_helper.rb
hyrax-3.0.0.pre.rc4 app/helpers/hyrax/charts_helper.rb
hyrax-3.0.0.pre.rc3 app/helpers/hyrax/charts_helper.rb
hyrax-3.0.0.pre.rc2 app/helpers/hyrax/charts_helper.rb