Commit d45c490b by Alexander Kryklia

plot now not required

parent 9b500a15
...@@ -73,17 +73,19 @@ class GraphicalSliderToolModule(XModule): ...@@ -73,17 +73,19 @@ class GraphicalSliderToolModule(XModule):
plot_div = '<div class="{element_class}_plot" id="{element_id}_plot" \ plot_div = '<div class="{element_class}_plot" id="{element_id}_plot" \
style="{style}"></div>' style="{style}"></div>'
# extract css style from plot # extract css style from plot
plot_def = re.search(r'\$plot[^\$]*\$', html_string).group() plot_def = re.search(r'\$plot[^\$]*\$', html_string)
style = re.search(r'(?=.*style\=[\"\'](.*)[\"\'])', plot_def) if plot_def:
if style: plot_def = plot_def.group()
style = style.groups()[0] style = re.search(r'(?=.*style\=[\"\'](.*)[\"\'])', plot_def)
else: # no style parameter if style:
style = '' style = style.groups()[0]
replacement = plot_div.format(element_class=self.html_class, else: # no style parameter
element_id=self.html_id, style = ''
style=style) replacement = plot_div.format(element_class=self.html_class,
html_string = re.sub(r'\$plot[^\$]*\$', replacement, html_string, element_id=self.html_id,
flags=re.UNICODE) style=style)
html_string = re.sub(r'\$plot[^\$]*\$', replacement, html_string,
flags=re.UNICODE)
# get variables # get variables
if json.loads(self.configuration_json)['root'].get('parameters'): if json.loads(self.configuration_json)['root'].get('parameters'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment