From f3a94831ffa53fd12ea11f74798da4b7ff03d3ac Mon Sep 17 00:00:00 2001 From: Frank Sauerburger <frank@sauerburger.com> Date: Wed, 23 Dec 2020 17:31:28 +0100 Subject: [PATCH] Fix npm test ci script --- .gitlab-ci.yml | 2 +- uhepp-js/src/components/Graph.jsx | 11 +++++------ .../templates/uhepp_vault/plot_detail.html | 7 ++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 152a522..b93deb4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,6 @@ jstest: stage: test image: node:10 script: - - uhepp-js + - cd uhepp-js - npm i - npm run-script test diff --git a/uhepp-js/src/components/Graph.jsx b/uhepp-js/src/components/Graph.jsx index 970f7e2..f9062e2 100644 --- a/uhepp-js/src/components/Graph.jsx +++ b/uhepp-js/src/components/Graph.jsx @@ -205,7 +205,7 @@ const UheppHist = ({width, height, uhepp}) => { const [showTotal, setShowTotal] = useState(false); const margin = { - top: 60, + top: 0, bottom: 60, left: 80, right: 80, @@ -296,12 +296,11 @@ const UheppHist = ({width, height, uhepp}) => { uhepp.stacks.reverse() return ( - <> - <svg width={width} - height={height} + <div style={{width: '100%', margin: '0 auto'}}> + <svg viewBox={`0 0 ${width} ${height}`} onMouseOut={() => setHighlightedBin(null)} > <style> - rect, line {'{shape-rendering: crispEdges }'} + rect {'{shape-rendering: crispEdges }'} .uhepp-brand {'{font-style: italic; font-weight: bold}'} .uhepp-brand, .uhepp-label {'{font-size: 20px}'} </style> @@ -394,7 +393,7 @@ const UheppHist = ({width, height, uhepp}) => { /> </Group> </svg> - </> + </div> ) } export default UheppHist; diff --git a/uhepp_org/uhepp_vault/templates/uhepp_vault/plot_detail.html b/uhepp_org/uhepp_vault/templates/uhepp_vault/plot_detail.html index 86553a2..d861503 100644 --- a/uhepp_org/uhepp_vault/templates/uhepp_vault/plot_detail.html +++ b/uhepp_org/uhepp_vault/templates/uhepp_vault/plot_detail.html @@ -17,14 +17,15 @@ Loading... <script> uhepp.fe.ReactDOM.render( uhepp.fe.React.createElement(uhepp.fe.Graph, { - width: "600", - height: "500", + width: "555", + height: "400", uhepp: JSON.parse(document.getElementById('plot-data').textContent) }), document.getElementById('app-root') ); </script> -<textarea cols="100" rows="10" readonly>{{ plot.uhepp }}</textarea> + +<!-- <textarea cols="100" rows="10" readonly>{{ plot.uhepp }}</textarea> --> <p> <a class="btn btn-primary" href="{% url 'uhepp_vault:plot-download' plot.uuid %}">Download JSON</a> -- GitLab