module Ecoportal module API class V2 class Page class Component class ChartField < Page::Component passthrough :mode passthrough :relative, :relstart, :relbound passthrough :bounded, :ubound, :lbound passthrough :filter_date_input passthrough :user_id, :lock_chart_user embeds_one :series_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::SeriesConfig" embeds_one :frequency_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Frequency" embeds_one :heatmap_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Heatmap" embeds_one :sankey_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Sankey" embeds_one :indicator_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Indicator" embeds_one :faceted_series_config, klass: "Ecoportal::API::V2::Page::Component::ChartField::Multiseries" embeds_many :series, klass: "Ecoportal::API::V2::Page::Component::ChartField::Serie" MODES = ["frequency", "series", "heatmap", "sankey", "indicator", "faceted_series"] def config case mode when "frequency" frequency_config when "series" series_config when "heatmap" heatmap_config when "sankey" sankey_config when "indicator" indicator_config when "faceted_series" faceted_series_config end end end end end end end end require 'ecoportal/api/v2/page/component/chart_field/frequency' require 'ecoportal/api/v2/page/component/chart_field/series_config' require 'ecoportal/api/v2/page/component/chart_field/serie' require 'ecoportal/api/v2/page/component/chart_field/heatmap' require 'ecoportal/api/v2/page/component/chart_field/sankey' require 'ecoportal/api/v2/page/component/chart_field/indicator' require 'ecoportal/api/v2/page/component/chart_field/multiseries'