Skip to content

Commit

Permalink
fix #6419 optionally show plot resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep committed Jan 4, 2024
1 parent 5b7a4b8 commit bc60193
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion sirepo/package_data/static/html/plot3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
<rect class="mouse-rect-x mouse-zoom" data-interactive-overlay="" data-report-id="reportId" data-focus-points="[focusPointX]" ng-attr-y="{{ canvasSize.height }}" ng-attr-width="{{ canvasSize.width }}" ng-attr-height="{{ bottomPanelHeight }}" style="pointer-events: all; fill: none;"></rect>
</g>
</svg></div>
<div style="display: flex; justify-content: flex-end">{{width}}x{{height}}</div>
<div data-ng-show="showPlotSize()" style="display: flex; justify-content: flex-end">plot resolution: {{width}}x{{height}}</div>


<div data-animation-buttons=""></div>
</div>
4 changes: 4 additions & 0 deletions sirepo/package_data/static/js/sirepo-plotting.js
Original file line number Diff line number Diff line change
Expand Up @@ -3173,6 +3173,10 @@ SIREPO.app.directive('plot3d', function(appState, focusPointService, layoutServi
resizefocusPointText();
};

$scope.showPlotSize = () => {
return appState.models[$scope.modelName].showPlotSize == '1';
};

$scope.$on(SIREPO.PLOTTING_LINE_CSV_EVENT, function(evt, axisName) {
var title = $($scope.element).closest('.panel-body')
.parent().parent().find('.sr-panel-heading').text();
Expand Down
4 changes: 3 additions & 1 deletion sirepo/package_data/static/json/srw-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@
"horizontalOffset": ["Horizontal Center Position [mm]", "Float", 0],
"verticalOffset": ["Vertical Center Position [mm]", "Float", 0],
"useDetector": ["Use Detector", "Boolean", "0"],
"showPlotSize": ["Show Result Dimensions on Plot", "Boolean", "0"],
"d_x": ["Horizontal Center Position [m]", "Float", 0],
"d_rx": ["Horizontal Detector Range [m]", "Float", 0.01],
"d_nx": ["Horizontal Pixel Count", "Integer", 1024],
Expand Down Expand Up @@ -1168,7 +1169,8 @@
"d_ny",
"d_y"
]]
]
],
"showPlotSize"
]],
["Other", [
"colorMap",
Expand Down
1 change: 1 addition & 0 deletions sirepo/sim_data/srw.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SimData(sirepo.sim_data.SimDataBase):
"plotScale",
"rotateAngle",
"rotateReshape",
"showPlotSize",
"useIntensityLimits",
"usePlotRange",
"verticalOffset",
Expand Down

0 comments on commit bc60193

Please sign in to comment.