Skip to content

Commit

Permalink
add advanced section that allows data and layout overrides to the plo…
Browse files Browse the repository at this point in the history
…tly.js graphing call.
  • Loading branch information
jneilliii committed Dec 10, 2022
1 parent b332a4d commit e027666
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion octoprint_bedlevelvisualizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def get_settings_defaults(self):
'graph_height': "450px", 'show_prusa_adjustments': False, 'show_additional_mesh_data': False,
'show_mesh_statistics': True,
'bed_offset_left': 0, 'bed_offset_right': 0, 'bed_offset_front': 0, 'bed_offset_back': 0,
'show_reference_plane': False, 'render_orthographic': False, 'graph_type': 'surface'}
'show_reference_plane': False, 'render_orthographic': False, 'graph_type': 'surface',
'advanced': {'data': '{"contours": {"showlines": false}}', 'layout': '{}'}}

def get_settings_version(self):
return 1
Expand Down
4 changes: 4 additions & 0 deletions octoprint_bedlevelvisualizer/static/js/bedlevelvisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ $(function () {
}];
}

// merge advanced overrides into data and layout
$.extend(data[0], JSON.parse(self.settingsViewModel.settings.plugins.bedlevelvisualizer.advanced.data()));
$.extend(layout, JSON.parse(self.settingsViewModel.settings.plugins.bedlevelvisualizer.advanced.layout()));

// graph surface
Plotly.react('bedlevelvisualizergraph', data, layout, config_options).then(self.postPlotHandler);
if (!self.graph_rendered){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<li><a data-toggle="tab" href="#bedlevelvisualizer_stored_data">Data</a></li>
<li><a data-toggle="tab" href="#bedlevelvisualizer_corrections">Corrections</a></li>
<li><a data-toggle="tab" href="#bedlevelvisualizer_custom_commands">Commands</a></li>
<li><a data-toggle="tab" href="#bedlevelvisualizer_advanced">Advanced</a></li>
<li><a data-toggle="tab" href="#bedlevelvisualizer_support">Support</a></li>
</ul>
<div class="tab-content">
Expand Down Expand Up @@ -141,6 +142,15 @@
<input type="text" id="bedlevelvisualizer_date_locale_format" title="Enter the js locale string for date display format for last stored mesh message. If left blank this will default to your browser's date locale settings." data-toggle="tooltip" class="input-small" data-bind="value: settingsViewModel.settings.plugins.bedlevelvisualizer.date_locale_format">
</div>
</div>
<div class="control-group span3">
<div class="control-group">
<input class="input-checkbox" type="checkbox" id="snap_shot"
title="Will average the four quadrants of the bed and render a 4 point reference plane overlaid on graph."
data-toggle="tooltip"
data-bind="checked: settingsViewModel.settings.plugins.bedlevelvisualizer.show_reference_plane"
style="display: inline-block;margin-bottom: 5px;"/> Show Reference Plane
</div>
</div>
</div>
<div class="row-fluid">
<div class="control-group">
Expand Down Expand Up @@ -295,6 +305,17 @@
</div>
</div>

<div id="bedlevelvisualizer_advanced" class="tab-pane">
<div class="control-group">
<label for="bedlevelvisualizer_advanced_data"><i class="icon icon-info-sign" title="Custom plotly.js data parameters to merge with other settings" data-toggle="tooltip"></i> Data Overrides</label>
<textarea class="input-block-level" id="bedlevelvisualizer_advanced_data" rows="15" data-bind="value: settingsViewModel.settings.plugins.bedlevelvisualizer.advanced.data"></textarea>
</div>
<div class="control-group">
<label for="bedlevelvisualizer_advanced_layout"><i class="icon icon-info-sign" title="Custom plotly.js layout parameters to merge with other settings" data-toggle="tooltip"></i> Layout Overrides</label>
<textarea class="input-block-level" id="bedlevelvisualizer_advanced_layout" rows="15" data-bind="value: settingsViewModel.settings.plugins.bedlevelvisualizer.advanced.layout"></textarea>
</div>
</div>

<div id="bedlevelvisualizer_support" class="tab-pane">
<div class="row-fluid">
<label class="well">It is extremely important to enable debug logging, restart OctoPrint, and attempt a probing process prior to submitting a bug report. Include the file <code>plugin_bedlevelvisualizer_debug.log</code> from OctoPrint's logging section by downloading it locally and dragging it into your bug report's comment. Check out the <a href="http://github.com/jneilliii/OctoPrint-BedLevelVisualizer/blob/master/wiki/index.md" target="_blank">wiki</a> for explanation of settings and tips.</label>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "Bed Visualizer"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.1.2rc3"
plugin_version = "1.1.2rc4"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit e027666

Please sign in to comment.