Skip to content

Instantly share code, notes, and snippets.

@JenniferFuBook
Last active January 6, 2023 06:05
Show Gist options
  • Save JenniferFuBook/7e957fef761fec694a75fe76940b0e65 to your computer and use it in GitHub Desktop.
Save JenniferFuBook/7e957fef761fec694a75fe76940b0e65 to your computer and use it in GitHub Desktop.
import Plot from 'react-plotly.js';
const layoutObj = {
title: 'Scatter Chart',
width: 800,
height: 600,
};
const dataArray = [
{
type: 'scatter',
y: [1, 2, 1, 4, 3, 6],
mode: 'lines',
},
{
type: 'scatter',
y: [2, 7, 0, 4, 6, 2],
mode: 'markers',
},
];
function App() {
return <Plot layout={layoutObj} data={dataArray} />;
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment