Sha256: b8b4932df26d03299a48f7616cd1e0d36273ba0748f6490cd7b1c5cc5443b13b

Contents?: true

Size: 1006 Bytes

Versions: 20

Compression:

Stored size: 1006 Bytes

Contents

require 'omf-web/widget/abstract_data_widget'

module OMF::Web::Widget::Graph
  
  # Maintains the context for a particular graph rendering within a specific session.
  # It is primarily called upon maintaining communication with the browser and will
  # create the necessary html and javascript code for that.
  #
  class GraphWidget < OMF::Web::Widget::AbstractDataWidget
    
    def initialize(opts)
      unless opts
        raise "Missing widget options."
      end
      @name = opts[:name] || 'Unknown'
      
      wopts = opts[:wopts] || {}
      unless vizType = (wopts[:viz_type] || opts[:type].split('/')[-1])
        raise "Missing widget option ':viz_type' for widget '#{name}' (#{opts.inspect})"
      end
      opts[:name] = name
      opts[:js_url] = "graph/#{vizType}.js"
      opts[:js_class] = "OML.#{vizType}"
      #opts[:widget_class] = OMF::Web::Widget::AbstractDataWidget 
      
      super opts      
      @widget_type = vizType
    end
    



    
  end # GraphWidget
  
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
omf_web-1.2.9 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.8 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.7 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.6 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.5 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.4 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.3 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.2 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.1 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.2.0 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-1.0.0 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.9 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.8 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.7 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.6 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.5 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.4 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.3 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9.1 lib/omf-web/widget/UNUSED/graph/graph_widget.rb
omf_web-0.9 lib/omf-web/widget/UNUSED/graph/graph_widget.rb