【发布时间】:2022-12-01 19:01:42
【问题描述】:
Is there a way to rotate the ellipse in PlotlyJS? To draw a circle/ellipse in Plotly, you define the center and the radii in the positive and negative x and y directions. Is there a way to define an angle at which the ellipse is rotated around its center or perhaps defining the 4 outermost points of the ellipse instead perhaps rather than having plotly deducing them through the radii values?
import React from 'react';
import Plot from 'react-plotly.js';
export default function App() {
var layout = {
shapes: [
{
type: 'circle',
xref: 'x',
yref: 'y',
x0: -2,
y0: -1.56,
x1: 2,
y1: 2.09,
opacity: 0.2,
fillcolor: 'red',
line: {
color: 'red'
}
}
],
height: 400,
width: 480,
showlegend: false,
dragmode: 'pan'
}
return (
<Plot
layout={layout}
/>
);
}
【问题讨论】:
标签: javascript reactjs plotly.js