diff --git a/lib/daru/view/adapters/googlecharts.rb b/lib/daru/view/adapters/googlecharts.rb index b750960..a9d8282 100644 --- a/lib/daru/view/adapters/googlecharts.rb +++ b/lib/daru/view/adapters/googlecharts.rb @@ -1,6 +1,6 @@ require 'google_visualr' require_relative 'googlecharts/iruby_notebook' -require_relative 'googlecharts/display' +require_relative 'googlecharts/google_visualr' require 'daru' require 'bigdecimal' require 'daru/view/constants' @@ -58,6 +58,16 @@ module GooglechartsAdapter # options = {type: :area} # chart = Daru::View::Plot.new(data, options) # + # @example ChartEditor + # data = [ + # ['Year', 'Sales', 'Expenses'], + # ['2013', 1000, 400], + # ['2014', 1170, 460], + # ['2015', 660, 1120], + # ['2016', 1030, 540] + # ] + # plot = Daru::View::Plot.new(data, {}, chart_class: 'Charteditor') + # # @example Multiple Charts in a row # Draw the Daru::View::PlotList object with the data as an array of # Daru::View::Plots(s) or Daru::View::Table(s) or both @@ -115,6 +125,16 @@ def init(data=[], options={}, user_options={}) # query = 'SELECT A, H, O, Q, R, U LIMIT 5 OFFSET 8' # data << query # chart = Daru::View::Table.new(data) + # + # @example ChartEditor + # data = [ + # ['Year', 'Sales', 'Expenses'], + # ['2013', 1000, 400], + # ['2014', 1170, 460], + # ['2015', 660, 1120], + # ['2016', 1030, 540] + # ] + # table = Daru::View::Table.new(data, {}, chart_class: 'Charteditor') def init_table(data=[], options={}, user_options={}) # if `options` is something like this : # { @@ -141,23 +161,6 @@ def init_table(data=[], options={}, user_options={}) @table end - # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table] - # The data provided by the user to generate the google datatable. - # Data in String format represents the URL of the google spreadsheet - # from which data has to invoked - # @return [GoogleVisualr::DataTable] the table object will the data - # filled - def get_table(data) - if data.is_a?(Daru::View::Table) && - data.table.is_a?(GoogleVisualr::DataTable) - data.table - elsif data.is_a?(GoogleVisualr::DataTable) - data - else - add_data_in_table(data) - end - end - # @param data [String] URL of the google spreadsheet from which data # has to invoked # @return [Boolean, void] returns true for valid URL and raises error @@ -216,6 +219,23 @@ def add_series(plot, opts={}) private + # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table] + # The data provided by the user to generate the google datatable. + # Data in String format represents the URL of the google spreadsheet + # from which data has to invoked + # @return [GoogleVisualr::DataTable] the table object with the data + # filled + def get_table(data) + if data.is_a?(Daru::View::Table) && + data.table.is_a?(GoogleVisualr::DataTable) + data.table + elsif data.is_a?(GoogleVisualr::DataTable) + data + else + add_data_in_table(data) + end + end + def extract_chart_type(options) # TODO: Imprvoe this method. chart_type = options[:type].nil? ? 'Line' : options.delete(:type) diff --git a/lib/daru/view/adapters/googlecharts/base_chart.rb b/lib/daru/view/adapters/googlecharts/base_chart.rb index bbdb8f2..9226957 100644 --- a/lib/daru/view/adapters/googlecharts/base_chart.rb +++ b/lib/daru/view/adapters/googlecharts/base_chart.rb @@ -18,6 +18,18 @@ def extract_option_view '\'\'' end + # @param element_id [String] The ID of the DIV element that the Google + # ChartEditor should be rendered in + # @return [String] Generates JavaScript for loading the charteditor package, + # with callback to render ChartEditor + def load_js_chart_editor(element_id) + js = '' + js << "\n google.load('visualization', '#{version}', " + js << " {packages: ['charteditor'], callback:" + js << " #{chart_function_name(element_id)}});" + js + end + # Generates JavaScript function for rendering the chart when data is URL of # the google spreadsheet # diff --git a/lib/daru/view/adapters/googlecharts/data_table_iruby.rb b/lib/daru/view/adapters/googlecharts/data_table_iruby.rb index 91a5367..1db145c 100644 --- a/lib/daru/view/adapters/googlecharts/data_table_iruby.rb +++ b/lib/daru/view/adapters/googlecharts/data_table_iruby.rb @@ -72,7 +72,9 @@ def google_table_version end def package_name - 'table' + return 'table' unless + user_options && user_options[:chart_class].to_s.capitalize == 'Charteditor' + 'charteditor' end # @return [String] Returns value of the view option provided by the user @@ -91,8 +93,8 @@ def extract_option_view def load_js(element_id) js = '' js << "\n google.load('visualization', #{google_table_version}, " - js << "\n {packages: ['#{package_name}'], callback:" - js << "\n #{chart_function_name(element_id)}});" + js << " {packages: ['#{package_name}'], callback:" + js << " #{chart_function_name(element_id)}});" js end diff --git a/lib/daru/view/adapters/googlecharts/display.rb b/lib/daru/view/adapters/googlecharts/display.rb index badac85..39209af 100644 --- a/lib/daru/view/adapters/googlecharts/display.rb +++ b/lib/daru/view/adapters/googlecharts/display.rb @@ -2,356 +2,259 @@ require 'erb' require_relative 'data_table_iruby' require_relative 'base_chart' -require 'daru/view/constants' +require_relative 'generate_javascript' require_relative 'formatters' -module GoogleVisualr - def self.init_script( - dependent_js=GOOGLECHARTS_DEPENDENCIES_WEB - ) - js = '' - js << "\n" - js - end - - module Display - # Holds a value only when to_html method is invoked - # @return [String] The ID of the DIV element that the Google Chart or - # Google DataTable should be rendered in - attr_accessor :html_id - attr_accessor :formatters - - def show_script(dom=SecureRandom.uuid, options={}) - script_tag = options.fetch(:script_tag) { true } - # To understand different formatters see: - # https://developers.google.com/chart/interactive/docs/reference#formatters - apply_formatters if is_a?(GoogleVisualr::DataTable) - if script_tag - show_script_with_script_tag(dom) - # Without checking for user_options, data as hash was not working! - elsif user_options && - user_options[:chart_class].to_s.capitalize == 'Chartwrapper' - get_html_chart_wrapper(data, dom) - elsif data.is_a?(String) - get_html_spreadsheet(data, dom) - else - get_html(dom) - end - end - - # @param dom [String] The ID of the DIV element that the Google - # Chart should be rendered in - # @return [String] js code to render the chart with script tag - def show_script_with_script_tag(dom=SecureRandom.uuid) - # if it is data table - if user_options && - user_options[:chart_class].to_s.capitalize == 'Chartwrapper' - to_js_chart_wrapper(data, dom) - elsif data.is_a?(String) - to_js_spreadsheet(data, dom) - elsif is_a?(GoogleVisualr::DataTable) - to_js_full_script(dom) - else - to_js(dom) - end - end - - # @param dom [String] The ID of the DIV element that the Google - # Chart should be rendered in - # @return [String] js code to render the chart - def get_html(dom) - html = '' - html << load_js(dom) - html << if is_a?(GoogleVisualr::DataTable) - draw_js(dom) - else - draw_chart_js(dom) - end - html - end - - # @param data [String] URL of the google spreadsheet in the specified - # format: https://developers.google.com/chart/interactive/docs - # /spreadsheets - # Query string can be appended to retrieve the data accordingly - # @param dom [String] The ID of the DIV element that the Google - # Chart should be rendered in when data is the the URL of the google - # spreadsheet - # @return [String] js code to render the chart when data is the URL of - # the google spreadsheet - def get_html_spreadsheet(data, dom) - html = '' - html << load_js(dom) - html << draw_js_spreadsheet(data, dom) - html - end +module Display + # Holds a value only when to_html method is invoked + # @return [String] The ID of the DIV element that the Google Chart or + # Google DataTable should be rendered in + attr_accessor :html_id + attr_accessor :formatters - def get_html_chart_wrapper(data, dom) - html = '' - html << load_js(dom) - html << draw_js_chart_wrapper(data, dom) - html - end - - def to_html(id=nil, options={}) - path = File.expand_path( - '../../templates/googlecharts/chart_div.erb', __dir__ - ) - template = File.read(path) - id ||= SecureRandom.uuid - @html_id = id - add_listener_to_chart - chart_script = show_script(id, script_tag: false) - ERB.new(template).result(binding) - end - - def show_in_iruby(dom=SecureRandom.uuid) - IRuby.html to_html(dom) + def show_script(dom=SecureRandom.uuid, options={}) + script_tag = options.fetch(:script_tag) { true } + # To understand different formatters see: + # https://developers.google.com/chart/interactive/docs/reference#formatters + apply_formatters if is_a?(GoogleVisualr::DataTable) + if script_tag + show_script_with_script_tag(dom) + # Without checking for user_options, data as hash was not working! + elsif user_options && user_options[:chart_class] + extract_chart_wrapper_editor_js(dom) + elsif data.is_a?(String) + get_html_spreadsheet(data, dom) + else + get_html(dom) end + end - # @return [void] Adds listener to the chart from the - # user_options[:listeners] - def add_listener_to_chart - return unless user_options && user_options[:listeners] - user_options[:listeners].each do |event, callback| - add_listener(event.to_s.downcase, callback) - end + # @param dom [String] The ID of the DIV element that the Google + # Chart should be rendered in + # @return [String] js code to render the chart with script tag + def show_script_with_script_tag(dom=SecureRandom.uuid) + # if it is data table + if user_options && + user_options[:chart_class].to_s.capitalize == 'Chartwrapper' + to_js_chart_wrapper(data, dom) + elsif data.is_a?(String) + to_js_spreadsheet(data, dom) + elsif is_a?(GoogleVisualr::DataTable) + to_js_full_script(dom) + else + to_js(dom) end + end - # @return [String] js function to add the listener to the chart - def add_listeners_js(type) - js = '' - @listeners.each do |listener| - js << "\n google.visualization.events.addListener(" - js << "#{type}, '#{listener[:event]}', function (e) {" - js << "\n #{listener[:callback]}" - js << "\n });" - end - js + # ChartEditor and ChartWrapper works for both Google Charts and DataTables + # @see dummy_rails examples for ChartEditor in shekharrajak/demo_daru-view + # + # @param dom [String] The ID of the DIV element that the Google + # Chart should be rendered in + # @return [String] JS to draw ChartWrapper or ChartEditor + def extract_chart_wrapper_editor_js(dom) + case user_options[:chart_class].to_s.capitalize + when 'Chartwrapper' + get_html_chart_wrapper(data, dom) + when 'Charteditor' + get_html_chart_editor(data, dom) end + end - # @param (see #draw_js_chart_editor) - # @return [String] options of the ChartWrapper - def extract_chart_wrapper_options(data, element_id) - js = '' - js << if is_a?(GoogleVisualr::DataTable) - "\n \t\tchartType: 'Table'," + # @param dom [String] The ID of the DIV element that the Google + # Chart should be rendered in + # @return [String] js code to render the chart + def get_html(dom) + html = '' + html << load_js(dom) + html << if is_a?(GoogleVisualr::DataTable) + draw_js(dom) else - "\n \t\tchartType: '#{chart_name}'," + draw_chart_js(dom) end - js << append_data(data) - js << "\n \t\toptions: #{js_parameters(@options)}," - js << "\n \t\tcontainerId: '#{element_id}'," - js << "\n \t\tview: #{extract_option_view}" - js - end + html + end - # @param element_id [String] The ID of the DIV element that the Google - # Chart/DataTable should be rendered in - # @return [String] unique function name to handle query response - def query_response_function_name(element_id) - "handleQueryResponse_#{element_id.tr('-', '_')}" - end + # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] + # Data of GoogleVisualr Chart or GoogleVisualr DataTable + # @param dom [String] The ID of the DIV element that the Google + # Chart should be rendered in + # @return [String] js code to render the chart + def get_html_chart_wrapper(data, dom) + html = '' + html << load_js(dom) + html << draw_js_chart_wrapper(data, dom) + html + end - # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] - # Data of GoogleVisualr DataTable/Chart - # @return [String] Data option (dataSourceUrl or dataTable) required to - # draw the Chartwrapper based upon the data provided. - def append_data(data) - return "\n \t\tdataSourceUrl: '#{data}'," if data.is_a? String - "\n \t\tdataTable: data_table," - end + # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] + # Data of GoogleVisualr Chart or GoogleVisualr DataTable + # @param dom [String] The ID of the DIV element that the Google + # Chart should be rendered in + # @return [String] js code to render the charteditor + def get_html_chart_editor(data, dom) + html = '' + html << if is_a?(GoogleVisualr::DataTable) + load_js(dom) + else + load_js_chart_editor(dom) + end + html << draw_js_chart_editor(data, dom) + html + end - # So that it can be used in ChartEditor also - # - # @return [String] Returns string to draw the Chartwrapper and '' otherwise - def draw_wrapper - return "\n \twrapper.draw();" if - user_options[:chart_class].to_s.capitalize == 'Chartwrapper' - '' - end + # @param data [String] URL of the google spreadsheet in the specified + # format: https://developers.google.com/chart/interactive/docs + # /spreadsheets + # Query string can be appended to retrieve the data accordingly + # @param dom [String] The ID of the DIV element that the Google + # Chart should be rendered in when data is the the URL of the google + # spreadsheet + # @return [String] js code to render the chart when data is the URL of + # the google spreadsheet + def get_html_spreadsheet(data, dom) + html = '' + html << load_js(dom) + html << draw_js_spreadsheet(data, dom) + html + end - # Generates JavaScript and renders the Google Chartwrapper in the - # final HTML output. - # - # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] - # Data of GoogleVisualr Chart/DataTable - # @param element_id [String] The ID of the DIV element that the Google - # Chartwrapper should be rendered in - # @return [String] Javascript code to render the Google Chartwrapper - def to_js_chart_wrapper(data, element_id=SecureRandom.uuid) - js = '' - js << "\n" - js - end + def to_html(id=nil, options={}) + path = File.expand_path( + '../../templates/googlecharts/chart_div.erb', __dir__ + ) + template = File.read(path) + id ||= SecureRandom.uuid + @html_id = id + add_listener_to_chart + chart_script = show_script(id, script_tag: false) + ERB.new(template).result(binding) + end - # Generates JavaScript when data is imported from spreadsheet and renders - # the Google Chart/Table in the final HTML output when data is URL of the - # google spreadsheet - # - # @param data [String] URL of the google spreadsheet in the specified - # format: https://developers.google.com/chart/interactive/docs - # /spreadsheets - # Query string can be appended to retrieve the data accordingly - # @param element_id [String] The ID of the DIV element that the Google - # Chart/Table should be rendered in - # @return [String] Javascript code to render the Google Chart/Table when - # data is given as the URL of the google spreadsheet - def to_js_spreadsheet(data, element_id=SecureRandom.uuid) - js = '' - js << "\n" - js - end + def show_in_iruby(dom=SecureRandom.uuid) + IRuby.html to_html(dom) + end - # Generates JavaScript function for rendering the chartwrapper - # - # @param (see #to_js_chart_wrapper) - # @return [String] JS function to render the chartwrapper - def draw_js_chart_wrapper(data, element_id) - js = '' - js << "\n function #{chart_function_name(element_id)}() {" - js << if is_a?(GoogleVisualr::DataTable) - "\n \t#{to_js}" - else - "\n \t#{@data_table.to_js}" - end - js << "\n \tvar wrapper = new google.visualization.ChartWrapper({" - js << extract_chart_wrapper_options(data, element_id) - js << "\n \t});" - js << draw_wrapper - js << add_listeners_js('wrapper') - js << "\n };" - js + # @return [void] Adds listener to the chart from the + # user_options[:listeners] + def add_listener_to_chart + return unless user_options && user_options[:listeners] + user_options[:listeners].each do |event, callback| + add_listener(event.to_s.downcase, callback) end + end - private - - # @return [void] applies formatters provided by the user in the - # third parameter - def apply_formatters - return unless user_options && user_options[:formatters] - @formatters = [] - user_options[:formatters].each_value do |formatter| - frmttr = case formatter[:type].to_s.capitalize - when 'Color' - apply_color_formatter(formatter) - when 'Pattern' - apply_pattern_formatter(formatter) - else - apply_date_arrow_bar_number_formatter(formatter) - end - @formatters << frmttr - end - end + private - # @param formatter [Hash] formatter hash provided by the user - # @return [GoogleVisualr::ColorFormat] adds the ColorFormat to - # defined columns - # @example Color Formatter - # df = Daru::DataFrame.new({b: [11,12,13,14,15], a: [1,2,3,4,5], - # c: [11,22,33,44,55]}, - # order: [:a, :b, :c], - # index: [:one, :two, :three, :four, :five]) - # - # user_options = { - # formatters: { - # formatter: { - # type: 'Color', - # range: [[1, 3, 'yellow', 'red'], - # [20, 50, 'green', 'pink']], - # columns: [0,2] - # }, - # formatter2: { - # type: 'Color', - # range: [[14, 15, 'blue', 'orange']], - # columns: 1 - # } - # } - # } - # - # # option `allowHtml: true` is necessary to make this work - # table = Daru::View::Table.new(df, {allowHtml: true}, user_options) - def apply_color_formatter(formatter) - initialize_default_values(formatter) - frmttr = GoogleVisualr::ColorFormat.new - formatter[:range].each do |range| - # add_range parameters: (from, to, color, bgcolor) - frmttr.add_range(range[0], range[1], range[2], range[3]) - end - formatter[:gradient_range].each do |gr| - # add_range parameters: (from, to, color, fromBgColor, toBgColor) - frmttr.add_gradient_range(gr[0], gr[1], gr[2], gr[3], gr[4]) - end - frmttr.columns(formatter[:columns]) - frmttr + # @return [void] applies formatters provided by the user in the + # third parameter + def apply_formatters + return unless user_options && user_options[:formatters] + @formatters = [] + user_options[:formatters].each_value do |formatter| + frmttr = case formatter[:type].to_s.capitalize + when 'Color' + apply_color_formatter(formatter) + when 'Pattern' + apply_pattern_formatter(formatter) + else + apply_date_arrow_bar_number_formatter(formatter) + end + @formatters << frmttr end + end - # @param formatter [Hash] formatter hash provided by the user - # @return [void] initializes default values for the color format - def initialize_default_values(formatter) - formatter[:range] ||= [] - formatter[:gradient_range] ||= [] - formatter[:columns] ||= 0 + # @param formatter [Hash] formatter hash provided by the user + # @return [GoogleVisualr::ColorFormat] adds the ColorFormat to + # defined columns + # @example Color Formatter + # df = Daru::DataFrame.new({b: [11,12,13,14,15], a: [1,2,3,4,5], + # c: [11,22,33,44,55]}, + # order: [:a, :b, :c], + # index: [:one, :two, :three, :four, :five]) + # + # user_options = { + # formatters: { + # formatter: { + # type: 'Color', + # range: [[1, 3, 'yellow', 'red'], + # [20, 50, 'green', 'pink']], + # columns: [0,2] + # }, + # formatter2: { + # type: 'Color', + # range: [[14, 15, 'blue', 'orange']], + # columns: 1 + # } + # } + # } + # + # # option `allowHtml: true` is necessary to make this work + # table = Daru::View::Table.new(df, {allowHtml: true}, user_options) + def apply_color_formatter(formatter) + initialize_default_values(formatter) + frmttr = GoogleVisualr::ColorFormat.new + formatter[:range].each do |range| + # add_range parameters: (from, to, color, bgcolor) + frmttr.add_range(range[0], range[1], range[2], range[3]) end - - # @param formatter [Hash] formatter hash provided by the user - # @return [GoogleVisualr::PatternFormat] adds the PatternFormat to - # destined columns - def apply_pattern_formatter(formatter) - formatter[:format_string] ||= '' - formatter[:src_cols] ||= 0 - formatter[:des_col] ||= 0 - frmttr = GoogleVisualr::PatternFormat.new(formatter[:format_string].to_s) - frmttr.src_cols = formatter[:src_cols] - frmttr.des_col = formatter[:des_col] - frmttr + formatter[:gradient_range].each do |gr| + # add_range parameters: (from, to, color, fromBgColor, toBgColor) + frmttr.add_gradient_range(gr[0], gr[1], gr[2], gr[3], gr[4]) end + frmttr.columns(formatter[:columns]) + frmttr + end - # @param formatter [Hash] formatter hash provided by the user - # @return [GoogleVisualr::DateFormat, GoogleVisualr::NumberFormat, - # GoogleVisualr::BarFormat, GoogleVisualr::ArrowFormat] adds the required - # format to the destined columns - # @example - # df = Daru::DataFrame.new({b: [11,-12,13,14,-15], a: [-1,2,3,4,5], - # c: [11,22,-33,-44,55]}, - # order: [:a, :b, :c], - # index: [:one, :two, :three, :four, :five]) - # - # user_options = { - # formatters: { - # formatter: { - # type: 'Number', - # options: {negativeParens: true}, - # columns: [0,1,2] - # } - # } - # } - # - # table = Daru::View::Table.new(df, {}, user_options) - def apply_date_arrow_bar_number_formatter(formatter) - formatter[:options] ||= {} - formatter[:columns] ||= 0 - frmttr = GoogleVisualr.const_get( - formatter[:type].to_s.capitalize + 'Format' - ).new(formatter[:options]) - frmttr.columns(formatter[:columns]) - frmttr - end + # @param formatter [Hash] formatter hash provided by the user + # @return [void] initializes default values for the color format + def initialize_default_values(formatter) + formatter[:range] ||= [] + formatter[:gradient_range] ||= [] + formatter[:columns] ||= 0 end - class DataTable - include Display + # @param formatter [Hash] formatter hash provided by the user + # @return [GoogleVisualr::PatternFormat] adds the PatternFormat to + # destined columns + def apply_pattern_formatter(formatter) + formatter[:format_string] ||= '' + formatter[:src_cols] ||= 0 + formatter[:des_col] ||= 0 + frmttr = GoogleVisualr::PatternFormat.new(formatter[:format_string].to_s) + frmttr.src_cols = formatter[:src_cols] + frmttr.des_col = formatter[:des_col] + frmttr end - class BaseChart - include Display + # @param formatter [Hash] formatter hash provided by the user + # @return [GoogleVisualr::DateFormat, GoogleVisualr::NumberFormat, + # GoogleVisualr::BarFormat, GoogleVisualr::ArrowFormat] adds the required + # format to the destined columns + # @example + # df = Daru::DataFrame.new({b: [11,-12,13,14,-15], a: [-1,2,3,4,5], + # c: [11,22,-33,-44,55]}, + # order: [:a, :b, :c], + # index: [:one, :two, :three, :four, :five]) + # + # user_options = { + # formatters: { + # formatter: { + # type: 'Number', + # options: {negativeParens: true}, + # columns: [0,1,2] + # } + # } + # } + # + # table = Daru::View::Table.new(df, {}, user_options) + def apply_date_arrow_bar_number_formatter(formatter) + formatter[:options] ||= {} + formatter[:columns] ||= 0 + frmttr = GoogleVisualr.const_get( + formatter[:type].to_s.capitalize + 'Format' + ).new(formatter[:options]) + frmttr.columns(formatter[:columns]) + frmttr end end diff --git a/lib/daru/view/adapters/googlecharts/generate_javascript.rb b/lib/daru/view/adapters/googlecharts/generate_javascript.rb new file mode 100644 index 0000000..07dbcd9 --- /dev/null +++ b/lib/daru/view/adapters/googlecharts/generate_javascript.rb @@ -0,0 +1,148 @@ +module GenerateJavascript + # @return [String] js function to add the listener to the chart + def add_listeners_js(type) + js = '' + @listeners.each do |listener| + js << "\n google.visualization.events.addListener(" + js << "#{type}, '#{listener[:event]}', function (e) {" + js << "\n #{listener[:callback]}" + js << "\n });" + end + js + end + + # @param element_id [String] The ID of the DIV element that the Google + # Chart/DataTable should be rendered in + # @return [String] unique function name to handle query response + def query_response_function_name(element_id) + "handleQueryResponse_#{element_id.tr('-', '_')}" + end + + # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] + # Data of GoogleVisualr DataTable/Chart + # @return [String] Data option (dataSourceUrl or dataTable) required to + # draw the Chartwrapper based upon the data provided. + def append_data(data) + return "\n \t\tdataSourceUrl: '#{data}'," if data.is_a? String + "\n \t\tdataTable: data_table," + end + + # @param element_id [String] The ID of the DIV element that the Google + # Chart should be rendered in + # @return [String] unique function name to save the chart + def save_chart_function_name(element_id) + "saveChart_#{element_id.tr('-', '_')}" + end + + # @param (see #draw_js_chart_editor) + # @return [String] options of the ChartWrapper + def extract_chart_wrapper_options(data, element_id) + js = '' + js << if is_a?(GoogleVisualr::DataTable) + "\n \t\tchartType: 'Table'," + else + "\n \t\tchartType: '#{chart_name}'," + end + js << append_data(data) + js << "\n \t\toptions: #{js_parameters(@options)}," + js << "\n \t\tcontainerId: '#{element_id}'," + js << "\n \t\tview: #{extract_option_view}" + js + end + + # So that it can be used in ChartEditor also + # + # @return [String] Returns string to draw the Chartwrapper and '' otherwise + def draw_wrapper(element_id) + js = '' + js << "\n \twrapper_#{element_id.tr('-', '_')}.draw();" + unless user_options[:chart_class].to_s.capitalize == 'Chartwrapper' + js << "\n \tchartEditor_#{element_id.tr('-', '_')} = "\ + 'new google.visualization.ChartEditor();' + js << "\n \tgoogle.visualization.events.addListener("\ + "chartEditor_#{element_id.tr('-', '_')},"\ + " 'ok', #{save_chart_function_name(element_id)});" + end + js + end + + # Generates JavaScript and renders the Google Chartwrapper in the + # final HTML output. + # + # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] + # Data of GoogleVisualr Chart/DataTable + # @param element_id [String] The ID of the DIV element that the Google + # Chartwrapper should be rendered in + # @return [String] Javascript code to render the Google Chartwrapper + def to_js_chart_wrapper(data, element_id=SecureRandom.uuid) + js = '' + js << "\n" + js + end + + # Generates JavaScript when data is imported from spreadsheet and renders + # the Google Chart/Table in the final HTML output when data is URL of the + # google spreadsheet + # + # @param data [String] URL of the google spreadsheet in the specified + # format: https://developers.google.com/chart/interactive/docs + # /spreadsheets + # Query string can be appended to retrieve the data accordingly + # @param element_id [String] The ID of the DIV element that the Google + # Chart/Table should be rendered in + # @return [String] Javascript code to render the Google Chart/Table when + # data is given as the URL of the google spreadsheet + def to_js_spreadsheet(data, element_id=SecureRandom.uuid) + js = '' + js << "\n" + js + end + + # Generates JavaScript function for rendering the chartwrapper + # + # @param (see #to_js_chart_wrapper) + # @return [String] JS function to render the chartwrapper + def draw_js_chart_wrapper(data, element_id) + js = "\n var wrapper_#{element_id.tr('-', '_')} = null;" + js << "\n function #{chart_function_name(element_id)}() {" + js << if is_a?(GoogleVisualr::DataTable) + "\n \t#{to_js}" + else + "\n \t#{@data_table.to_js}" + end + js << "\n \twrapper_#{element_id.tr('-', '_')} = "\ + 'new google.visualization.ChartWrapper({' + js << extract_chart_wrapper_options(data, element_id) + js << "\n \t});" + js << draw_wrapper(element_id) + js << add_listeners_js("wrapper_#{element_id.tr('-', '_')}") + js << "\n };" + js + end + + # @param data [Array, Daru::DataFrame, Daru::Vector, Daru::View::Table, String] + # Data of GoogleVisualr Chart + # @param element_id [String] The ID of the DIV element that the Google + # ChartEditor should be rendered in + # @return [String] JS function to render the ChartEditor + def draw_js_chart_editor(data, element_id) + js = '' + js << "\n var chartEditor_#{element_id.tr('-', '_')} = null;" + js << draw_js_chart_wrapper(data, element_id) + js << "\n function #{save_chart_function_name(element_id)}(){" + js << "\n \tchartEditor_#{element_id.tr('-', '_')}.getChartWrapper()."\ + "draw(document.getElementById('#{element_id}'));" + js << "\n }" + js << "\n function loadEditor_#{element_id.tr('-', '_')}(){" + js << "\n \tchartEditor_#{element_id.tr('-', '_')}.openDialog("\ + "wrapper_#{element_id.tr('-', '_')}, {});" + js << "\n }" + js + end +end diff --git a/lib/daru/view/adapters/googlecharts/google_visualr.rb b/lib/daru/view/adapters/googlecharts/google_visualr.rb new file mode 100644 index 0000000..6d5b0f4 --- /dev/null +++ b/lib/daru/view/adapters/googlecharts/google_visualr.rb @@ -0,0 +1,27 @@ +require 'securerandom' +require 'erb' +require_relative 'display' +require_relative 'generate_javascript' +require 'daru/view/constants' + +module GoogleVisualr + def self.init_script( + dependent_js=GOOGLECHARTS_DEPENDENCIES_WEB + ) + js = '' + js << "\n" + js + end + + class DataTable + include Display + include GenerateJavascript + end + + class BaseChart + include Display + include GenerateJavascript + end +end diff --git a/lib/daru/view/templates/googlecharts/chart_div.erb b/lib/daru/view/templates/googlecharts/chart_div.erb index fa856dd..9c7769e 100644 --- a/lib/daru/view/templates/googlecharts/chart_div.erb +++ b/lib/daru/view/templates/googlecharts/chart_div.erb @@ -1,3 +1,6 @@ +<% if user_options && user_options[:chart_class].to_s.capitalize == 'Charteditor' %> + +<% end %>
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
abc
" + ], "text/plain": [ - "\"\\n\\n\"" + "\"\\n\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
abc
\"" ] }, "execution_count": 5, @@ -243,7 +234,7 @@ } ], "source": [ - "dt_df.table.to_html" + "dt_df.show_in_iruby" ] }, { @@ -254,7 +245,7 @@ { "data": { "text/plain": [ - "\"\\n\\n\\n \\n \\n \\n \\n \\n \\n
Num1 Num2 Num3
\"" + "\"\\n\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
abc
\"" ] }, "execution_count": 6, @@ -295,23 +286,29 @@ " \n", "$(document).ready(function() {\n", "\n", - " $('#table_id4').DataTable(\n", - " {pageLength: 3}\n", - " );\n", + "\t$('#table_id4').DataTable(\n", + "\t\t{pageLength: 3, data: [[0,1,11,11],[1,2,12,22],[2,3,13,33],[3,4,14,44],[4,5,15,55]]}\n", + "\t);\n", "\n", "});\n", "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
Num1 Num2 Num3
" + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
abc
" ], "text/plain": [ - "\"\\n\\n\\n \\n \\n \\n \\n \\n \\n
Num1 Num2 Num3
\"" + "\"\\n\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
abc
\"" ] }, "execution_count": 7, @@ -323,13 +320,6 @@ "IRuby.html html_code_dt_df" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, diff --git a/spec/dummy_iruby/Google Chart | Line Chart.ipynb b/spec/dummy_iruby/Google Chart | Line Chart.ipynb index 881505d..ce21448 100644 --- a/spec/dummy_iruby/Google Chart | Line Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Line Chart.ipynb @@ -448,19 +448,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -482,19 +483,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -635,19 +637,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -681,22 +684,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -772,19 +773,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 12, @@ -811,19 +813,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -879,22 +882,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 14, @@ -933,19 +934,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 15, @@ -970,19 +972,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 16, @@ -1015,22 +1018,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 17, @@ -1067,19 +1068,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 18, @@ -1104,19 +1106,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 19, @@ -1152,19 +1155,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 20, @@ -1201,19 +1205,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 21, @@ -1256,19 +1261,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 22, diff --git a/spec/dummy_iruby/Google Chart | Area Chart.ipynb b/spec/dummy_iruby/Google Chart | Area Chart.ipynb index 2a3f4b1..ba506f1 100644 --- a/spec/dummy_iruby/Google Chart | Area Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Area Chart.ipynb @@ -356,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -399,19 +397,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -436,19 +435,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -482,19 +482,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -529,19 +530,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, diff --git a/spec/dummy_iruby/Google Chart | Bar Chart.ipynb b/spec/dummy_iruby/Google Chart | Bar Chart.ipynb index 82632c2..c904a25 100644 --- a/spec/dummy_iruby/Google Chart | Bar Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Bar Chart.ipynb @@ -466,22 +466,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -502,19 +500,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -539,19 +538,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -592,22 +592,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -648,19 +646,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -690,22 +689,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -746,19 +743,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -788,22 +786,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 11, @@ -841,19 +837,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 12, @@ -890,22 +887,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -942,19 +937,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 14, @@ -983,22 +979,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 15, @@ -1027,19 +1021,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 16, @@ -1066,19 +1061,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 17, @@ -1106,19 +1102,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 18, @@ -1157,22 +1154,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 19, @@ -1201,19 +1196,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 20, @@ -1243,22 +1239,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 21, @@ -1288,19 +1282,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 22, diff --git a/spec/dummy_iruby/Google Chart | Bubble Chart.ipynb b/spec/dummy_iruby/Google Chart | Bubble Chart.ipynb index e37f381..9a5b60d 100644 --- a/spec/dummy_iruby/Google Chart | Bubble Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Bubble Chart.ipynb @@ -356,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -405,19 +403,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -442,19 +441,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -649,19 +649,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -686,19 +687,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -729,19 +731,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -779,19 +782,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, diff --git a/spec/dummy_iruby/Google Chart | Candlestick Chart.ipynb b/spec/dummy_iruby/Google Chart | Candlestick Chart.ipynb index 66d3ea1..920bfe5 100644 --- a/spec/dummy_iruby/Google Chart | Candlestick Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Candlestick Chart.ipynb @@ -495,19 +495,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -535,19 +536,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, diff --git a/spec/dummy_iruby/Google Chart | Combo Chart.ipynb b/spec/dummy_iruby/Google Chart | Combo Chart.ipynb index aecaaa3..202ce44 100644 --- a/spec/dummy_iruby/Google Chart | Combo Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Combo Chart.ipynb @@ -356,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -401,19 +399,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, diff --git a/spec/dummy_iruby/Google Chart | Data from google spreadsheet.ipynb b/spec/dummy_iruby/Google Chart | Data from google spreadsheet.ipynb index 8380055..7765ea4 100644 --- a/spec/dummy_iruby/Google Chart | Data from google spreadsheet.ipynb +++ b/spec/dummy_iruby/Google Chart | Data from google spreadsheet.ipynb @@ -356,25 +356,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -398,23 +397,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -435,25 +435,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -475,25 +474,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -516,23 +514,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -553,25 +552,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -594,23 +592,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -631,23 +630,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -668,23 +668,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 11, diff --git a/spec/dummy_iruby/Google Chart | Histogram.ipynb b/spec/dummy_iruby/Google Chart | Histogram.ipynb index e9217a7..a0099f0 100644 --- a/spec/dummy_iruby/Google Chart | Histogram.ipynb +++ b/spec/dummy_iruby/Google Chart | Histogram.ipynb @@ -700,22 +700,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -743,19 +741,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -782,19 +781,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -823,19 +823,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -883,19 +884,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -1099,19 +1101,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 11, diff --git a/spec/dummy_iruby/Google Chart | Org Chart.ipynb b/spec/dummy_iruby/Google Chart | Org Chart.ipynb index 5f63ff6..824bcba 100644 --- a/spec/dummy_iruby/Google Chart | Org Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Org Chart.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -398,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -451,19 +407,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, diff --git a/spec/dummy_iruby/Google Chart | Pie Chart.ipynb b/spec/dummy_iruby/Google Chart | Pie Chart.ipynb index c62124a..6a9b250 100644 --- a/spec/dummy_iruby/Google Chart | Pie Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Pie Chart.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -398,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -442,19 +398,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -479,19 +436,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -523,19 +481,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -560,19 +519,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -608,22 +568,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -651,19 +609,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -687,19 +646,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -734,22 +694,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 11, @@ -780,19 +738,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 12, @@ -817,19 +776,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -938,19 +898,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 15, @@ -971,19 +932,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 16, @@ -1125,19 +1087,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 18, diff --git a/spec/dummy_iruby/Google Chart | Stepped Area Chart.ipynb b/spec/dummy_iruby/Google Chart | Stepped Area Chart.ipynb index 9a41c03..e6596c8 100644 --- a/spec/dummy_iruby/Google Chart | Stepped Area Chart.ipynb +++ b/spec/dummy_iruby/Google Chart | Stepped Area Chart.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -398,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -442,19 +398,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -479,19 +436,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -519,19 +477,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -561,22 +520,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -605,19 +562,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -652,19 +610,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, diff --git a/spec/dummy_iruby/Google Chart | Timeline.ipynb b/spec/dummy_iruby/Google Chart | Timeline.ipynb index a556317..7055afd 100644 --- a/spec/dummy_iruby/Google Chart | Timeline.ipynb +++ b/spec/dummy_iruby/Google Chart | Timeline.ipynb @@ -445,19 +445,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -725,19 +726,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -765,22 +767,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 11, @@ -821,19 +821,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 12, @@ -861,19 +862,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -894,19 +896,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 14, @@ -927,22 +930,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 15, @@ -973,19 +974,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 16, @@ -1006,19 +1008,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 17, @@ -1046,22 +1049,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 18, @@ -1093,19 +1094,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 19, @@ -1126,19 +1128,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 20, @@ -1159,19 +1162,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 21, @@ -1197,19 +1201,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 22, @@ -1241,19 +1246,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 23, @@ -1287,19 +1293,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 24, @@ -1320,19 +1327,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 25, @@ -1366,22 +1374,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 26, @@ -1413,19 +1419,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 27, diff --git a/spec/dummy_iruby/Google Chart | Treemap.ipynb b/spec/dummy_iruby/Google Chart | Treemap.ipynb index 8b86f69..c719bf8 100644 --- a/spec/dummy_iruby/Google Chart | Treemap.ipynb +++ b/spec/dummy_iruby/Google Chart | Treemap.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -398,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -466,19 +422,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -503,19 +460,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -553,19 +511,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -610,19 +569,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, diff --git a/spec/dummy_iruby/Google Chart | gauge.ipynb b/spec/dummy_iruby/Google Chart | gauge.ipynb index a2aaa57..cd62196 100644 --- a/spec/dummy_iruby/Google Chart | gauge.ipynb +++ b/spec/dummy_iruby/Google Chart | gauge.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -398,22 +356,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -442,19 +398,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, diff --git a/spec/dummy_iruby/Google Charts | Basics.ipynb b/spec/dummy_iruby/Google Charts | Basics.ipynb index 5d9379c..91eee45 100644 --- a/spec/dummy_iruby/Google Charts | Basics.ipynb +++ b/spec/dummy_iruby/Google Charts | Basics.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -398,7 +356,7 @@ { "data": { "text/plain": [ - "#, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}>>" + "#, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @user_options={}, @data=[]>>" ] }, "execution_count": 3, @@ -438,19 +396,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -834,7 +793,24 @@ { "data": { "text/plain": [ - "#\n", + "#\n", + " 0 1\n", + " 0 0 0\n", + " 1 1 10\n", + " 2 2 23\n", + " 3 3 17\n", + " 4 4 18\n", + " 5 5 9\n", + " 6 6 11\n", + " 7 7 27\n", + " 8 8 33\n", + " 9 9 40\n", + " 10 10 32\n", + " 11 11 35\n", + " 12 12 30\n", + " 13 13 40\n", + " 14 14 42\n", + " ... ... ..., @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @chart=#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @user_options={}, @data=#\n", " 0 1\n", " 0 0 0\n", " 1 1 10\n", @@ -851,7 +827,7 @@ " 12 12 30\n", " 13 13 40\n", " 14 14 42\n", - " ... ... ..., @options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @chart=#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}>>" + " ... ... ...>>" ] }, "execution_count": 7, @@ -871,19 +847,37 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @html_id=\"8bc27337-9c6d-47e0-8df7-97741dcb8883\">" + "#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @user_options={}, @data=#\n", + " 0 1\n", + " 0 0 0\n", + " 1 1 10\n", + " 2 2 23\n", + " 3 3 17\n", + " 4 4 18\n", + " 5 5 9\n", + " 6 6 11\n", + " 7 7 27\n", + " 8 8 33\n", + " 9 9 40\n", + " 10 10 32\n", + " 11 11 35\n", + " 12 12 30\n", + " 13 13 40\n", + " 14 14 42\n", + " ... ... ..., @html_id=\"83083c90-f37c-4f83-a662-77248191f5cd\">" ] }, "execution_count": 8, @@ -904,22 +898,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={}, @html_id=\"8a42cd0f-3083-4c4f-b350-a82749343e61\">" + "#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}, @html_id=\"26599243-bc79-489d-aa5c-4cabc00675b4\">" ] }, "execution_count": 9, @@ -959,22 +951,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={:pageSize=>10}, @html_id=\"6fd6a1c0-4914-4e39-ac70-333d5b71bddc\">" + "#\"number\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={:pageSize=>10}, @html_id=\"05cae6d7-98c9-40f6-99f2-047aa8730a3f\">" ] }, "execution_count": 11, @@ -1029,19 +1019,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -1061,19 +1052,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 14, @@ -1191,13 +1183,19 @@ { "data": { "text/plain": [ - "#\n", + "#\n", + " city population\n", + " 0 New York C 8175000\n", + " 1 Los Angele 3792000\n", + " 2 Chicago, I 2695000\n", + " 3 Houston, T 2099000\n", + " 4 Philadelph 1526000, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @chart=#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @user_options={}, @data=#\n", " city population\n", " 0 New York C 8175000\n", " 1 Los Angele 3792000\n", " 2 Chicago, I 2695000\n", " 3 Houston, T 2099000\n", - " 4 Philadelph 1526000, @options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @chart=#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}>>" + " 4 Philadelph 1526000>>" ] }, "execution_count": 16, @@ -1217,19 +1215,26 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @html_id=\"3e7b265f-220f-4d50-bf47-596d6f9aad80\">" + "#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @user_options={}, @data=#\n", + " city population\n", + " 0 New York C 8175000\n", + " 1 Los Angele 3792000\n", + " 2 Chicago, I 2695000\n", + " 3 Houston, T 2099000\n", + " 4 Philadelph 1526000, @html_id=\"99a64459-528c-4822-b6e7-a031765cb13b\">" ] }, "execution_count": 17, @@ -1249,13 +1254,19 @@ { "data": { "text/plain": [ - "#\n", + "#\n", + " city population\n", + " 0 New York C 8175000\n", + " 1 Los Angele 3792000\n", + " 2 Chicago, I 2695000\n", + " 3 Houston, T 2099000\n", + " 4 Philadelph 1526000, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @chart=#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}, @user_options={}, @data=#\n", " city population\n", " 0 New York C 8175000\n", " 1 Los Angele 3792000\n", " 2 Chicago, I 2695000\n", " 3 Houston, T 2099000\n", - " 4 Philadelph 1526000, @options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @chart=#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={}>>" + " 4 Philadelph 1526000>>" ] }, "execution_count": 18, @@ -1275,19 +1286,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 19, @@ -1357,19 +1369,26 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={\"title\"=>\"Population of Largest U.S. Cities\", \"chartArea\"=>{:width=>\"50%\"}, \"hAxis\"=>{:title=>\"Total Population\", :minValue=>0}, \"vAxis\"=>{:title=>\"City\"}}, @html_id=\"86e7090e-c555-46c3-9112-d1ceb8b90b2e\">" + "#\"string\", :label=>:city}, {:type=>\"number\", :label=>:population}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={}>, @listeners=[], @version=\"1.0\", @language=nil, @material=false, @options={\"title\"=>\"Population of Largest U.S. Cities\", \"chartArea\"=>{:width=>\"50%\"}, \"hAxis\"=>{:title=>\"Total Population\", :minValue=>0}, \"vAxis\"=>{:title=>\"City\"}}, @user_options={}, @data=#\n", + " city population\n", + " 0 New York C 8175000\n", + " 1 Los Angele 3792000\n", + " 2 Chicago, I 2695000\n", + " 3 Houston, T 2099000\n", + " 4 Philadelph 1526000, @html_id=\"70a381ee-1a43-4734-85f1-b21df8c7148e\">" ] }, "execution_count": 22, @@ -1409,19 +1428,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 24, @@ -1720,22 +1740,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 27, @@ -1756,19 +1774,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 28, @@ -1812,19 +1831,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 30, diff --git a/spec/dummy_iruby/Google Charts | ChartEditor.ipynb b/spec/dummy_iruby/Google Charts | ChartEditor.ipynb new file mode 100644 index 0000000..3e24dc8 --- /dev/null +++ b/spec/dummy_iruby/Google Charts | ChartEditor.ipynb @@ -0,0 +1,533 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "Install the spreadsheet gem version ~>1.1.1 for using spreadsheet functions.\n", + "\n", + "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" + ] + }, + { + "data": { + "text/plain": [ + "true" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "require 'daru/view'" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "application/javascript": [ + "\n", + " /* BEGIN google_visualr.js */\n", + "\n", + "if(!window['googleLT_']){window['googleLT_']=(new Date()).getTime();}if (!window['google']) {\n", + "window['google'] = {};\n", + "}\n", + "if (!window['google']['loader']) {\n", + "window['google']['loader'] = {};\n", + "google.loader.ServiceBase = 'https://www.google.com/uds';\n", + "google.loader.GoogleApisBase = 'https://ajax.googleapis.com/ajax';\n", + "google.loader.ApiKey = 'notsupplied';\n", + "google.loader.KeyVerified = true;\n", + "google.loader.LoadFailure = false;\n", + "google.loader.Secure = true;\n", + "google.loader.GoogleLocale = 'www.google.com';\n", + "google.loader.ClientLocation = null;\n", + "google.loader.AdditionalParams = '';\n", + "(function() {function g(a){return a in l?l[a]:l[a]=-1!=navigator.userAgent.toLowerCase().indexOf(a)}var l={};function m(a,b){var c=function(){};c.prototype=b.prototype;a.ca=b.prototype;a.prototype=new c}function n(a,b,c){var d=Array.prototype.slice.call(arguments,2)||[];return function(){return a.apply(b,d.concat(Array.prototype.slice.call(arguments)))}}function p(a){a=Error(a);a.toString=function(){return this.message};return a}\n", + "function q(a,b){a=a.split(/\\./);for(var c=window,d=0;d\\x3c/script>\"):(g(\"safari\")||g(\"konqueror\"))&&window.setTimeout(B,10)),x.push(a)):y(window,\"load\",a)};t(\"google.setOnLoadCallback\",google.ba);\n", + "function y(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent(\"on\"+b,c);else{var d=a[\"on\"+b];a[\"on\"+b]=null!=d?C([c,d]):c}}function C(a){return function(){for(var b=0;b\\x3c/script>'):\"css\"==a&&document.write('')};\n", + "t(\"google.loader.writeLoadTag\",google.loader.f);google.loader.Z=function(a){w=a};t(\"google.loader.rfm\",google.loader.Z);google.loader.aa=function(a){for(var b in a)\"string\"==typeof b&&b&&\":\"==b.charAt(0)&&!v[b]&&(v[b]=new E(b.substring(1),a[b]))};t(\"google.loader.rpl\",google.loader.aa);google.loader.$=function(a){if((a=a.specs)&&a.length)for(var b=0;b\\x3c/script>')},K.Mi=function(b){var c=K.global.document,d=c.createElement(\"script\");d.type=C;d.src=b;d.defer=!1;d.async=!1;c.head.appendChild(d)},\n", + "K.Wl=function(b,c){if(K.tg()){var d=K.global.document;if(!K.Ge&&d.readyState==t){if(/\\bdeps.js$/.test(b))return!1;throw Error('Cannot write \"'+b+'\" after document load');}void 0===c?K.fi?(K.eh=!0,c=\" onreadystatechange='goog.onScriptLoad_(this, \"+ ++K.Sg+\")' \",d.write(n+b+'\"'+c+\">\\x3c/script>\")):K.Ge?K.Mi(b):K.Vl(b):d.write('\n" + ], + "text/plain": [ + "\"\\n\\n\\n
\\n\\n\"" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "bar_basic_options = {\n", + " title: 'Population of Largest U.S. Cities',\n", + " type: :bar,\n", + "}\n", + "bar_basic_chart = Daru::View::Plot.new(df_city_pop, bar_basic_options, chart_class: 'Charteditor')\n", + "bar_basic_chart.show_in_iruby" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Ruby 2.4.1", + "language": "ruby", + "name": "ruby" + }, + "language_info": { + "file_extension": ".rb", + "mimetype": "application/x-ruby", + "name": "ruby", + "version": "2.4.1" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/spec/dummy_iruby/Google Charts | Chartwrapper.ipynb b/spec/dummy_iruby/Google Charts | Chartwrapper.ipynb index 75829bd..c6d1203 100644 --- a/spec/dummy_iruby/Google Charts | Chartwrapper.ipynb +++ b/spec/dummy_iruby/Google Charts | Chartwrapper.ipynb @@ -356,27 +356,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -404,25 +404,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -446,25 +448,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -491,25 +495,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -534,25 +540,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -577,27 +585,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -619,25 +627,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -659,25 +669,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -802,27 +814,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 12, @@ -843,25 +855,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -886,25 +900,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 14, @@ -929,27 +945,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 15, @@ -970,27 +986,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 16, diff --git a/spec/dummy_iruby/Google Charts | Column Charts.ipynb b/spec/dummy_iruby/Google Charts | Column Charts.ipynb index d437943..2159be4 100644 --- a/spec/dummy_iruby/Google Charts | Column Charts.ipynb +++ b/spec/dummy_iruby/Google Charts | Column Charts.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -501,22 +459,25 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>\"Element\"}, {:type=>\"number\", :label=>\"Density\"}], @rows=[[#, #], [#, #], [#, #], [#, #]], @options={:height=>300, :width=>200}, @html_id=\"5afe257d-dcd1-48eb-82a3-9972a701e6df\">" + "#\"string\", :label=>\"Element\"}, {:type=>\"number\", :label=>\"Density\"}], @rows=[[#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={:height=>300, :width=>200}, @data=#\n", + " Element Density\n", + " 0 Copper 8.94\n", + " 1 Silver 10.49\n", + " 2 Gold 19.3\n", + " 3 Platinum 21.45, @user_options={}, @html_id=\"601e0bb6-7e61-4371-bd1a-7ccba4431b25\">" ] }, "execution_count": 4, @@ -537,19 +498,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -707,22 +669,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>\"Genre\"}, {:type=>\"number\", :label=>\"Fantasy & Sci Fi\"}, {:type=>\"number\", :label=>\"Romance\"}, {:type=>\"number\", :label=>\"Mystery/Crime\"}, {:type=>\"number\", :label=>\"General\"}, {:type=>\"number\", :label=>\"Western\"}, {:type=>\"number\", :label=>\"Literature\"}], @rows=[[#, #, #, #, #, #, #], [#, #, #, #, #, #, #], [#, #, #, #, #, #, #]], @options={:height=>300, :width=>700}, @html_id=\"3401febf-0364-4fe3-9a96-120f79617dfe\">" + "#\"string\", :label=>\"Genre\"}, {:type=>\"number\", :label=>\"Fantasy & Sci Fi\"}, {:type=>\"number\", :label=>\"Romance\"}, {:type=>\"number\", :label=>\"Mystery/Crime\"}, {:type=>\"number\", :label=>\"General\"}, {:type=>\"number\", :label=>\"Western\"}, {:type=>\"number\", :label=>\"Literature\"}], @rows=[[#, #, #, #, #, #, #], [#, #, #, #, #, #, #], [#, #, #, #, #, #, #]], @listeners=[], @options={:height=>300, :width=>700}, @data=#\n", + " Genre Fantasy & Romance Mystery/Cr General Western Literature\n", + " 0 2010 10 24 20 32 18 5\n", + " 1 2020 16 22 23 30 16 9\n", + " 2 2030 28 19 29 30 12 13, @user_options={}, @html_id=\"53bd1f56-1eca-4350-808a-6bb2623212c5\">" ] }, "execution_count": 7, @@ -743,19 +707,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -784,19 +749,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -824,19 +790,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -996,22 +963,26 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>\"Galaxy\"}, {:type=>\"number\", :label=>\"Distance\"}, {:type=>\"number\", :label=>\"Brightness\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #]], @options={:height=>300, :width=>700}, @html_id=\"ba115b47-8bc9-4f05-a34a-723334219b09\">" + "#\"string\", :label=>\"Galaxy\"}, {:type=>\"number\", :label=>\"Distance\"}, {:type=>\"number\", :label=>\"Brightness\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #]], @listeners=[], @options={:height=>300, :width=>700}, @data=#\n", + " Galaxy Distance Brightness\n", + " 0 Canis Majo 8000 23.3\n", + " 1 Sagittariu 24000 4.5\n", + " 2 Ursa Major 30000 14.3\n", + " 3 Lg. Magell 50000 0.9\n", + " 4 Bootes I 60000 13.1, @user_options={}, @html_id=\"6bd1fd22-d17f-4915-a8ec-2b116ee16983\">" ] }, "execution_count": 12, @@ -1032,19 +1003,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -1083,19 +1055,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 14, diff --git a/spec/dummy_iruby/Google Charts | Event Handling.ipynb b/spec/dummy_iruby/Google Charts | Event Handling.ipynb index 87f699c..e3c7792 100644 --- a/spec/dummy_iruby/Google Charts | Event Handling.ipynb +++ b/spec/dummy_iruby/Google Charts | Event Handling.ipynb @@ -91,231 +91,231 @@ " /* BEGIN loader.js */\n", "\n", "(function(){var a=\"\\n//# sourceURL=\",k=\"' of type \",n='\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -410,13 +409,14 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -459,13 +459,14 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, diff --git a/spec/dummy_iruby/Google Charts | Geo Charts examples.ipynb b/spec/dummy_iruby/Google Charts | Geo Charts examples.ipynb index aee2ab7..fdfb8f0 100644 --- a/spec/dummy_iruby/Google Charts | Geo Charts examples.ipynb +++ b/spec/dummy_iruby/Google Charts | Geo Charts examples.ipynb @@ -363,19 +363,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -608,19 +609,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -651,22 +653,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>\"Country\"}, {:type=>\"number\", :label=>\"Latitude\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={:pageSize=>5, :height=>350, :width=>350}, @data=#\n", + "#\"string\", :label=>\"Country\"}, {:type=>\"number\", :label=>\"Latitude\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={:pageSize=>5, :height=>350, :width=>350}, @data=#\n", " Country Latitude\n", " 0 Algeria 36\n", " 1 Angola -8\n", @@ -683,7 +683,7 @@ " 12 Comoros -12\n", " 13 Cote d'Ivo 6\n", " 14 Democratic -3\n", - " ... ... ..., @user_options={}, @html_id=\"3f871fcd-a085-42c0-bfd5-c51eebc10dbb\">" + " ... ... ..., @user_options={}, @html_id=\"c706e23c-18ec-416d-93ec-b43f236b3292\">" ] }, "execution_count": 6, @@ -731,19 +731,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, diff --git a/spec/dummy_iruby/Google Charts | Scatter Chart.ipynb b/spec/dummy_iruby/Google Charts | Scatter Chart.ipynb index dfbcd4b..b86fb0a 100644 --- a/spec/dummy_iruby/Google Charts | Scatter Chart.ipynb +++ b/spec/dummy_iruby/Google Charts | Scatter Chart.ipynb @@ -15,48 +15,6 @@ "Install the mechanize gem version ~>2.7.5 for using mechanize functions.\n" ] }, - { - "data": { - "application/javascript": [ - "if(window['d3'] === undefined ||\n", - " window['Nyaplot'] === undefined){\n", - " var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n", - "\n", - "\n", - "\n", - " var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n", - "\n", - " require.config({paths: path, shim:shim});\n", - "\n", - "\n", - "require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n", - "\n", - "\tvar script = d3.select(\"head\")\n", - "\t .append(\"script\")\n", - "\t .attr(\"src\", \"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n", - "\t .attr(\"async\", true);\n", - "\n", - "\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n", - "\n", - "\n", - "\t var event = document.createEvent(\"HTMLEvents\");\n", - "\t event.initEvent(\"load_nyaplot\",false,false);\n", - "\t window.dispatchEvent(event);\n", - "\t console.log('Finished loading Nyaplotjs');\n", - "\n", - "\t};\n", - "\n", - "\n", - "});});\n", - "}\n" - ], - "text/plain": [ - "\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"http://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"http://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\"" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/plain": [ @@ -519,22 +477,27 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"Age\"}, {:type=>\"number\", :label=>\"Weight\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={:pageSize=>5, :height=>200, :width=>100}, @html_id=\"579a2867-a52a-403c-b560-f912e5926a85\">" + "#\"number\", :label=>\"Age\"}, {:type=>\"number\", :label=>\"Weight\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={:pageSize=>5, :height=>200, :width=>100}, @data=#\n", + " Age Weight\n", + " 0 8 12\n", + " 1 4 5.5\n", + " 2 11 14\n", + " 3 4 5\n", + " 4 3 3.5\n", + " 5 6.5 7, @user_options={}, @html_id=\"14b8c044-8c76-47b7-9318-d4139dff6014\">" ] }, "execution_count": 4, @@ -555,19 +518,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -976,22 +940,37 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"Hours Studied\"}, {:type=>\"number\", :label=>\"Final\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @options={:pageSize=>10, :height=>300, :width=>200}, @html_id=\"f17999fd-4a20-47c5-8bfe-b460311d425c\">" + "#\"number\", :label=>\"Hours Studied\"}, {:type=>\"number\", :label=>\"Final\"}], @rows=[[#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #], [#, #]], @listeners=[], @options={:pageSize=>10, :height=>300, :width=>200}, @data=#\n", + " Hours Stud Final\n", + " 0 0 67\n", + " 1 1 88\n", + " 2 2 77\n", + " 3 3 93\n", + " 4 4 85\n", + " 5 5 91\n", + " 6 6 71\n", + " 7 7 78\n", + " 8 8 93\n", + " 9 9 80\n", + " 10 10 82\n", + " 11 0 75\n", + " 12 5 80\n", + " 13 3 90\n", + " 14 1 72\n", + " ... ... ..., @user_options={}, @html_id=\"1c139862-90a0-4208-9b14-407ce47c5146\">" ] }, "execution_count": 7, @@ -1012,19 +991,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -1471,22 +1451,37 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"Student ID\"}, {:type=>\"number\", :label=>\"Hours Studied\"}, {:type=>\"number\", :label=>\"Final\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #]], @options={:pageSize=>10, :height=>300, :width=>300}, @html_id=\"e68527c5-a05b-4c92-bf58-e581546f91e8\">" + "#\"number\", :label=>\"Student ID\"}, {:type=>\"number\", :label=>\"Hours Studied\"}, {:type=>\"number\", :label=>\"Final\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #]], @listeners=[], @options={:pageSize=>10, :height=>300, :width=>300}, @data=#\n", + " Student ID Hours Stud Final\n", + " 0 0 0 67\n", + " 1 1 1 88\n", + " 2 2 2 77\n", + " 3 3 3 93\n", + " 4 4 4 85\n", + " 5 5 5 91\n", + " 6 6 6 71\n", + " 7 7 7 78\n", + " 8 8 8 93\n", + " 9 9 9 80\n", + " 10 10 10 82\n", + " 11 11 0 75\n", + " 12 12 5 80\n", + " 13 13 3 90\n", + " 14 14 1 72\n", + " ... ... ... ..., @user_options={}, @html_id=\"066d0591-6132-4a5d-814b-1905adf50e09\">" ] }, "execution_count": 10, @@ -1507,19 +1502,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 11, diff --git a/spec/dummy_iruby/GoogleChart | DataTables-Formatters.ipynb b/spec/dummy_iruby/GoogleChart | DataTables-Formatters.ipynb index d3b5890..525e148 100644 --- a/spec/dummy_iruby/GoogleChart | DataTables-Formatters.ipynb +++ b/spec/dummy_iruby/GoogleChart | DataTables-Formatters.ipynb @@ -91,231 +91,231 @@ " /* BEGIN loader.js */\n", "\n", "(function(){var a=\"\\n//# sourceURL=\",k=\"' of type \",n='\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 3, @@ -441,13 +439,12 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 4, @@ -516,13 +512,12 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 5, @@ -582,26 +576,24 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 6, @@ -637,24 +629,22 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 7, @@ -686,24 +676,22 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -736,24 +724,22 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, diff --git a/spec/dummy_iruby/GoolgeChart | Datatables.ipynb b/spec/dummy_iruby/GoolgeChart | Datatables.ipynb index 206de29..19af175 100644 --- a/spec/dummy_iruby/GoolgeChart | Datatables.ipynb +++ b/spec/dummy_iruby/GoolgeChart | Datatables.ipynb @@ -472,13 +472,13 @@ { "data": { "text/plain": [ - "#\n", + "#\n", " a b c\n", " one 1 11 11\n", " two 2 12 22\n", " three 3 13 33\n", " four 4 14 44\n", - " five 5 15 55, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"number\", :label=>:a}, {:type=>\"number\", :label=>:b}, {:type=>\"number\", :label=>:c}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #]], @options={}, @data=#\n", + " five 5 15 55, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"number\", :label=>:a}, {:type=>\"number\", :label=>:b}, {:type=>\"number\", :label=>:c}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #], [#, #, #]], @listeners=[], @options={}, @data=#\n", " a b c\n", " one 1 11 11\n", " two 2 12 22\n", @@ -564,22 +564,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 8, @@ -599,7 +597,7 @@ { "data": { "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 9, @@ -619,22 +617,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 10, @@ -754,12 +750,12 @@ { "data": { "text/plain": [ - "#\n", + "#\n", " 0 1 2\n", " 0 Mike {:v=>10000 true\n", " 1 Jim {:v=>8000, false\n", " 2 Alice {:v=>12500 true\n", - " 3 Bob {:v=>7000, true, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"string\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}, {:type=>\"boolean\", :label=>\"2\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #]], @options={}, @data=#\n", + " 3 Bob {:v=>7000, true, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"string\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}, {:type=>\"boolean\", :label=>\"2\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #]], @listeners=[], @options={}, @data=#\n", " 0 1 2\n", " 0 Mike {:v=>10000 true\n", " 1 Jim {:v=>8000, false\n", @@ -784,22 +780,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 13, @@ -848,12 +842,12 @@ { "data": { "text/plain": [ - "#\n", + "#\n", " 0 1 2\n", " 0 Mike {:v=>10000 true\n", " 1 Jim {:v=>8000, false\n", " 2 Alice {:v=>12500 true\n", - " 3 Bob {:v=>7000, true, @options={:showRowNumber=>true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"string\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}, {:type=>\"boolean\", :label=>\"2\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #]], @options={:showRowNumber=>true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @data=#\n", + " 3 Bob {:v=>7000, true, @options={:showRowNumber=>true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"string\", :label=>\"0\"}, {:type=>\"number\", :label=>\"1\"}, {:type=>\"boolean\", :label=>\"2\"}], @rows=[[#, #, #], [#, #, #], [#, #, #], [#, #, #]], @listeners=[], @options={:showRowNumber=>true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @data=#\n", " 0 1 2\n", " 0 Mike {:v=>10000 true\n", " 1 Jim {:v=>8000, false\n", @@ -878,22 +872,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 16, @@ -933,7 +925,7 @@ { "data": { "text/plain": [ - "#true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @data=[], @user_options={}>>" + "#true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @data=[], @user_options={}>>" ] }, "execution_count": 18, @@ -986,22 +978,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 20, @@ -1064,7 +1054,7 @@ { "data": { "text/plain": [ - "#[{:id=>\"A\", :label=>\"NEW A\", :type=>\"string\"}, {:id=>\"B\", :label=>\"B-label\", :type=>\"number\"}, {:id=>\"C\", :label=>\"C-label\", :type=>\"date\"}], :rows=>[{:c=>[{:v=>\"a\"}, {:v=>1.0, :f=>\"One\"}, {:v=>#, :f=>\"2/28/08 12:31 AM\"}]}, {:c=>[{:v=>\"b\"}, {:v=>2.0, :f=>\"Two\"}, {:v=>#, :f=>\"3/30/08 12:31 AM\"}]}, {:c=>[{:v=>\"c\"}, {:v=>3.0, :f=>\"Three\"}, {:v=>#, :f=>\"4/30/08 12:31 AM\"}]}]}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"string\", :label=>\"NEW A\", :id=>\"A\"}, {:type=>\"number\", :label=>\"B-label\", :id=>\"B\"}, {:type=>\"date\", :label=>\"C-label\", :id=>\"C\"}], @rows=[[#, #, #, @type=\"date\", @f=\"2/28/08 12:31 AM\", @p=nil>], [#, #, #, @type=\"date\", @f=\"3/30/08 12:31 AM\", @p=nil>], [#, #, #, @type=\"date\", @f=\"4/30/08 12:31 AM\", @p=nil>]], @options={:cols=>[{:id=>\"A\", :label=>\"NEW A\", :type=>\"string\"}, {:id=>\"B\", :label=>\"B-label\", :type=>\"number\"}, {:id=>\"C\", :label=>\"C-label\", :type=>\"date\"}], :rows=>[{:c=>[{:v=>\"a\"}, {:v=>1.0, :f=>\"One\"}, {:v=>#, :f=>\"2/28/08 12:31 AM\"}]}, {:c=>[{:v=>\"b\"}, {:v=>2.0, :f=>\"Two\"}, {:v=>#, :f=>\"3/30/08 12:31 AM\"}]}, {:c=>[{:v=>\"c\"}, {:v=>3.0, :f=>\"Three\"}, {:v=>#, :f=>\"4/30/08 12:31 AM\"}]}]}, @data=[], @user_options={}>>" + "#[{:id=>\"A\", :label=>\"NEW A\", :type=>\"string\"}, {:id=>\"B\", :label=>\"B-label\", :type=>\"number\"}, {:id=>\"C\", :label=>\"C-label\", :type=>\"date\"}], :rows=>[{:c=>[{:v=>\"a\"}, {:v=>1.0, :f=>\"One\"}, {:v=>#, :f=>\"2/28/08 12:31 AM\"}]}, {:c=>[{:v=>\"b\"}, {:v=>2.0, :f=>\"Two\"}, {:v=>#, :f=>\"3/30/08 12:31 AM\"}]}, {:c=>[{:v=>\"c\"}, {:v=>3.0, :f=>\"Three\"}, {:v=>#, :f=>\"4/30/08 12:31 AM\"}]}]}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"string\", :label=>\"NEW A\", :id=>\"A\"}, {:type=>\"number\", :label=>\"B-label\", :id=>\"B\"}, {:type=>\"date\", :label=>\"C-label\", :id=>\"C\"}], @rows=[[#, #, #, @type=\"date\", @f=\"2/28/08 12:31 AM\", @p=nil>], [#, #, #, @type=\"date\", @f=\"3/30/08 12:31 AM\", @p=nil>], [#, #, #, @type=\"date\", @f=\"4/30/08 12:31 AM\", @p=nil>]], @listeners=[], @options={:cols=>[{:id=>\"A\", :label=>\"NEW A\", :type=>\"string\"}, {:id=>\"B\", :label=>\"B-label\", :type=>\"number\"}, {:id=>\"C\", :label=>\"C-label\", :type=>\"date\"}], :rows=>[{:c=>[{:v=>\"a\"}, {:v=>1.0, :f=>\"One\"}, {:v=>#, :f=>\"2/28/08 12:31 AM\"}]}, {:c=>[{:v=>\"b\"}, {:v=>2.0, :f=>\"Two\"}, {:v=>#, :f=>\"3/30/08 12:31 AM\"}]}, {:c=>[{:v=>\"c\"}, {:v=>3.0, :f=>\"Three\"}, {:v=>#, :f=>\"4/30/08 12:31 AM\"}]}]}, @data=[], @user_options={}>>" ] }, "execution_count": 22, @@ -1084,22 +1074,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 23, @@ -1119,7 +1107,7 @@ { "data": { "text/plain": [ - "#>" + "#>" ] }, "execution_count": 24, @@ -1160,22 +1148,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>\"Employee Name\"}, {:type=>\"date\", :label=>\"Start Date\"}], @rows=[], @options={}, @data=[], @user_options={}, @html_id=\"c08073bf-4276-45ca-9dc3-55c5bcbb7631\">" + "#\"string\", :label=>\"Employee Name\"}, {:type=>\"date\", :label=>\"Start Date\"}], @rows=[], @listeners=[], @options={}, @data=[], @user_options={}, @html_id=\"3a7a38a7-650e-4989-aa8f-e768f7b8c4a1\">" ] }, "execution_count": 26, @@ -1215,7 +1201,7 @@ { "data": { "text/plain": [ - "#" + "#" ] }, "execution_count": 28, @@ -1235,7 +1221,7 @@ { "data": { "text/plain": [ - "#, @type=\"date\">" + "#, @type=\"date\">" ] }, "execution_count": 29, @@ -1265,22 +1251,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"string\", :label=>\"Employee Name\"}, {:type=>\"date\", :label=>\"Start Date\"}], @rows=[[#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">]], @options={}, @data=[], @user_options={}, @html_id=\"a94ffc48-2440-476f-9a47-d78abac50eda\">" + "#\"string\", :label=>\"Employee Name\"}, {:type=>\"date\", :label=>\"Start Date\"}], @rows=[[#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">], [#, #, @type=\"date\">]], @listeners=[], @options={}, @data=[], @user_options={}, @html_id=\"84eba261-2998-434c-a14f-c99a635fccbf\">" ] }, "execution_count": 30, @@ -1367,7 +1351,7 @@ { "data": { "text/plain": [ - "#\n", + "#\n", " 0 43934\n", " 1 52503\n", " 2 57177\n", @@ -1375,7 +1359,7 @@ " 4 97031\n", " 5 119931\n", " 6 137133\n", - " 7 154175, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @options={}, @data=#\n", + " 7 154175, @options={}, @user_options={}, @adapter=Daru::View::Adapter::GooglechartsAdapter, @table=#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @listeners=[], @options={}, @data=#\n", " 0 43934\n", " 1 52503\n", " 2 57177\n", @@ -1404,22 +1388,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @options={}, @data=#\n", + "#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @listeners=[], @options={}, @data=#\n", " 0 43934\n", " 1 52503\n", " 2 57177\n", @@ -1427,7 +1409,7 @@ " 4 97031\n", " 5 119931\n", " 6 137133\n", - " 7 154175, @user_options={}, @html_id=\"0787e3a6-855a-4de3-b746-5955fbeb7a7a\">" + " 7 154175, @user_options={}, @html_id=\"33ef7ce5-bc6e-41b4-ac0a-e65c54f8ca1f\">" ] }, "execution_count": 35, @@ -1488,22 +1470,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @options={:showRowNumber=>true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @data=#\n", + "#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @listeners=[], @options={:showRowNumber=>true, :width=>\"100%\", :height=>\"100%\", :page=>\"enable\", :pageSize=>2, :pagingSymbols=>{:prev=>\"prev\", :next=>\"next\"}, :pagingButtonsConfiguration=>\"auto\"}, @data=#\n", " 0 43934\n", " 1 52503\n", " 2 57177\n", @@ -1511,7 +1491,7 @@ " 4 97031\n", " 5 119931\n", " 6 137133\n", - " 7 154175, @user_options={}, @html_id=\"203a1b04-7bcb-4c81-a971-52c1c23f26b2\">" + " 7 154175, @user_options={}, @html_id=\"6eabc359-4d22-4eae-b5a0-cd7eb0167d53\">" ] }, "execution_count": 38, @@ -1582,22 +1562,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @options={:showRowNumber=>true, :pageSize=>5, :allowHtml=>true, :cssClassNames=>{:headerRow=>\"italic-darkblue-font large-font bold-font\", :tableRow=>\"\", :oddTableRow=>\"beige-background\", :selectedTableRow=>\"orange-background large-font\", :hoverTableRow=>\"\", :headerCell=>\"gold-border\", :tableCell=>\"\", :rowNumberCell=>\"underline-blue-font\"}}, @data=#\n", + "#\"number\", :label=>\"Series\"}], @rows=[[#], [#], [#], [#], [#], [#], [#], [#]], @listeners=[], @options={:showRowNumber=>true, :pageSize=>5, :allowHtml=>true, :cssClassNames=>{:headerRow=>\"italic-darkblue-font large-font bold-font\", :tableRow=>\"\", :oddTableRow=>\"beige-background\", :selectedTableRow=>\"orange-background large-font\", :hoverTableRow=>\"\", :headerCell=>\"gold-border\", :tableCell=>\"\", :rowNumberCell=>\"underline-blue-font\"}}, @data=#\n", " 0 43934\n", " 1 52503\n", " 2 57177\n", @@ -1605,7 +1583,7 @@ " 4 97031\n", " 5 119931\n", " 6 137133\n", - " 7 154175, @user_options={}, @html_id=\"f9ed1f65-b530-4c04-9b2f-06bf629e1f4a\">" + " 7 154175, @user_options={}, @html_id=\"9945ef5a-e582-4be2-8c04-d4c0025c942d\">" ] }, "execution_count": 41, @@ -1635,22 +1613,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 42, @@ -1690,22 +1666,20 @@ { "data": { "text/html": [ - "
\n", + "\n", + "
\n", "\n" ], "text/plain": [ - "\"
\\n\\n\"" + "\"\\n
\\n\\n\"" ] }, "execution_count": 43,