diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 152a522b8e21ee3cded60797a3dc447a290d4926..b93deb4ada5ef7921c06df49611fbea903f36a39 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 970f7e2a69c0a624ddd5457e0b7cab27220bb8f4..f9062e2e3004b948ce4e7fad136cb48ebb0ce147 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 86553a27ff22aabb1751c339c455890489f7090f..d861503a782f7b55521d346296f5185ef7c2dacb 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>