-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Charteditor #96
Added Charteditor #96
Conversation
As it is a continuation of ChartWrapper, I will rebase it after ChartWrapper gets merged. |
Pull Request Test Coverage Report for Build 662
💛 - Coveralls |
Pull Request Test Coverage Report for Build 610
💛 - Coveralls |
@Shekharrajak can you please review this PR? |
@@ -62,7 +62,9 @@ def google_table_version | |||
end | |||
|
|||
def package_name | |||
'table' | |||
return 'table' unless |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChartEditor is going through data_table_iruby.rb
:O . But why ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChartEditor works for both google charts and tables, and code to generate the table is written in data_table_iruby.rb
. charteditor
package is loaded in Google Datatables when chart_class
is set to Charteditor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any example or documentation written, which describes this usecase ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have written the rails examples in demo_daru-view and also in the method documentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write examples in web apps and iruby as well, if haven't.
js << "\n \t\toptions: #{js_parameters(@options)}," | ||
js << "\n \t\tcontainerId: '#{element_id}'," | ||
js << "\n \t\tview: #{extract_option_view}" | ||
js << "\n \twrapper_#{element_id.tr('-', '_')} = "\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same code 2 times ??
def draw_wrapper | ||
return "\n \twrapper.draw();" if | ||
def draw_wrapper(element_id) | ||
return "\n \twrapper_#{element_id.tr('-', '_')}.draw();" if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to know, what if we don't provide element_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use only the wrapper
(without id) then the chart editor will work only on the last chart. That is, edit button (of any chart) will show the dialog box for the last chart only.
user_options[:chart_class].to_s.capitalize == 'Chartwrapper' | ||
'' | ||
js = '' | ||
js << "\n \twrapper_#{element_id.tr('-', '_')}.draw();" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same line at 172 .
@@ -35,6 +35,12 @@ | |||
chart_class: 'ChartWrapper' | |||
) | |||
} | |||
let (:plot_spreadsheet_charteditor) { | |||
Daru::View::Plot.new( | |||
data_spreadsheet, {width: 800, view: {columns: [0, 1]}}, chart_class: 'Charteditor' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line length
@Shekharrajak can you please review this PR also? |
Please resolve conflicts and run all the examples again. |
976405b
to
83749c4
Compare
83749c4
to
3829d87
Compare
@Shekharrajak I have created a new module |
@Shekharrajak I have separated the modules in different files. As the same thing needs to be done with the Export GoogleCharts PR, I will update that one after this gets merged. |
@@ -0,0 +1,148 @@ | |||
module GenerateJavascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be inside GoogleVisualr
module, isn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module GenerateJavascript
is already include
d in BaseChart
and DataTables
class which is in GoogleVisualr
, so, I think it is not required.
@@ -62,7 +62,9 @@ def google_table_version | |||
end | |||
|
|||
def package_name | |||
'table' | |||
return 'table' unless |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write examples in web apps and iruby as well, if haven't.
This PR is opened over the commits of Chartwrapper and is in progress (code, tests, documentation and examples all are incomplete). User needs to set
class_chart
asCharteditor
.Actually, I am facing a problem in this. Charteditor is working fine in rails app but in IRuby notebook, the dialog box is appearing behind the notebook as in the examples here.
I can see it working (that is above the content of jupyter notebook) if I explicitly set the
z-index
of the dialog box (ChartEditor) in developer tools. But that is of no help as I can not change the code of the dialog box. Is there any way I can make this work?Also, I wanted to know why are we generating the googlecharts' code with script and without script in display.rb. We have already defined script tags in the template so we'll definitely be generating the script without the script tags?