Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Reflex2468 committed Apr 20, 2022
1 parent c89a133 commit a85f0dc
Show file tree
Hide file tree
Showing 3 changed files with 1,901 additions and 82 deletions.
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -10,8 +10,10 @@
},
"dependencies": {
"next": "12.1.5",
"plotly.js": "^2.11.1",
"react": "18.0.0",
"react-dom": "18.0.0"
"react-dom": "18.0.0",
"react-plotly.js": "^2.5.1"
},
"devDependencies": {
"eslint": "8.13.0",
Expand Down
87 changes: 23 additions & 64 deletions pages/index.js
@@ -1,69 +1,28 @@
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import {Suspense} from "react";

export default function Home() {
return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>

<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>

<p className={styles.description}>
Get started by editing{' '}
<code className={styles.code}>pages/index.js</code>
</p>

<div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}>
<h2>Documentation &rarr;</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>
import dynamic from "next/dynamic";

<a href="https://nextjs.org/learn" className={styles.card}>
<h2>Learn &rarr;</h2>
<p>Learn about Next.js in an interactive course with quizzes!</p>
</a>
const Plot = dynamic(
() => import('react-plotly.js'),
{ suspense: true }
);

<a
href="https://github.com/vercel/next.js/tree/canary/examples"
className={styles.card}
>
<h2>Examples &rarr;</h2>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
>
<h2>Deploy &rarr;</h2>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>

<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span>
</a>
</footer>
</div>
export default function Home() {
return (
<Suspense fallback={<p>Loading...</p>}>
<Plot
data={[
{
x: [1, 2, 3],
y: [2, 6, 3],
type: 'scatter',
mode: 'lines+markers',
marker: {color: 'red'},
},
{type: 'bar', x: [1, 2, 3], y: [2, 5, 3]},
]}
layout={ {width: 320, height: 240, title: 'A Fancy Plot'} }
/>
</Suspense>
)
}

0 comments on commit a85f0dc

Please sign in to comment.