Skip to content

Commit

Permalink
Plotly: minor things: renaming and styling button; display axes in 2D…
Browse files Browse the repository at this point in the history
… views (#318)

* minor things: renaming and styling button; display axes in 2D views

* plotly tab named properly
  • Loading branch information
martin-henz authored Aug 25, 2024
1 parent d6baa34 commit 1cffc78
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/bundles/nbody/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ export { createState, getBodies } from './State';
export { createBodyCenterTransformation, createCoMTransformation, createLambdaTransformation, createPinTransformation, createRotateTransformation, createTimedRotateTransformation } from './Transformation';
export { createUniverse } from './Universe';
export { addVectors, createVector, getX, getY, getZ, multiplyScalar, setX, setY, setZ, subVectors } from './Vector';

4 changes: 2 additions & 2 deletions src/bundles/plotly/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ export const draw_connected_2d = createPlotFunction(
mode: 'lines'
},
{
xaxis: { visible: false },
xaxis: { visible: true },
yaxis: {
visible: false,
visible: true,
scaleanchor: 'x'
}
},
Expand Down
11 changes: 10 additions & 1 deletion src/tabs/Painter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ class Painter extends React.Component<Props, State> {
const divId = `plotDiv${id}`;
return (
<>
<div onClick={() => this.handleOpen(drawnPainter)}>Click here to open Modal</div>
<div onClick={() => this.handleOpen(drawnPainter)}
style={{
cursor: 'pointer',
padding: '5px 10px',
backgroundColor: '#474F5E',
border: '1px solid #aaa',
borderRadius: '4px',
display: 'inline-block'
}}
>Popout plot</div>
<div
id={divId}
ref={() => {
Expand Down
13 changes: 11 additions & 2 deletions src/tabs/Plotly/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ class Plotly extends React.Component<Props, State> {
height: '80vh',
marginBottom: '5vh'
}} key={divId}>
<div onClick={() => this.handleOpen(drawnPlot)}>Click here to open Modal</div>
<div onClick={() => this.handleOpen(drawnPlot)}
style={{
cursor: 'pointer',
padding: '5px 10px',
backgroundColor: '#474F5E',
border: '1px solid #aaa',
borderRadius: '4px',
display: 'inline-block'
}}
>Popout plot</div>
<div
id={divId}
style={{ height: '80vh' }}
Expand All @@ -85,6 +94,6 @@ export default {
return drawnPlots.length > 0;
},
body: (debuggerContext: any) => <Plotly debuggerContext={debuggerContext} />,
label: 'Plotly Test Tab',
label: 'Plotly',
iconName: 'scatter-plot'
};

0 comments on commit 1cffc78

Please sign in to comment.