Skip to content

Commit 0bad8cf

Browse files
author
jjtimmons
committed
Replace react-sizeme with react-resize-detector
1 parent f5176ce commit 0bad8cf

File tree

14 files changed

+265
-340
lines changed

14 files changed

+265
-340
lines changed

demo/lib/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ interface AppState {
3838
showIndex: boolean;
3939
showSelectionMeta: boolean;
4040
showSidebar: boolean;
41-
translations: {start: number, end: number}[],
41+
translations: { end: number; start: number }[];
4242
viewType: string;
4343
zoom: number;
4444
}
@@ -57,7 +57,7 @@ export default class App extends React.Component<any, AppState> {
5757
showIndex: true,
5858
showSelectionMeta: false,
5959
showSidebar: false,
60-
translations: [{start: 61, end: 910}],
60+
translations: [{ end: 910, start: 61 }],
6161
viewType: "",
6262
zoom: 50,
6363
};
@@ -148,14 +148,14 @@ export default class App extends React.Component<any, AppState> {
148148
annotations={this.state.annotations}
149149
enzymes={this.state.enzymes}
150150
name={this.state.name}
151-
onSelection={selection => this.setState({ selection })}
152151
search={this.state.search}
153152
seq={this.state.seq}
154153
showComplement={this.state.showComplement}
155154
showIndex={this.state.showIndex}
156155
translations={this.state.translations}
157156
viewer={this.state.viewType as "linear" | "circular"}
158157
zoom={{ linear: this.state.zoom }}
158+
onSelection={selection => this.setState({ selection })}
159159
/>
160160
)}
161161
</div>

demo/package-lock.json

Lines changed: 170 additions & 176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"build": "next build && next export",
88
"deploy": "npm update seqviz && npm run build && aws s3 sync ./out s3://lattice-tools-s3/seqviz --profile lattice --delete && aws cloudfront create-invalidation --distribution-id E3NMX6D92LFTAV --paths '/seqviz/*' --profile lattice",
9-
"fix": "prettier ./lib/** --write && eslint lib --ext ts,tsx --fix",
9+
"fix": "prettier ./lib/** ./pages/** --write && eslint lib --ext ts,tsx --fix",
1010
"lint": "prettier ./lib/** --check && eslint lib --ext ts,tsx --quiet",
1111
"start": "open http://localhost:3010/ && next dev -p 3010"
1212
},
@@ -15,10 +15,10 @@
1515
"caniuse-lite": "^1.0.30001390",
1616
"history": "^4.10.1",
1717
"lodash": "^4.17.21",
18-
"next": "^12.2.5",
18+
"next": "^12.3.1",
1919
"next-with-less": "^2.0.5",
20-
"react": "^17.0.2",
21-
"react-dom": "^17.0.2",
20+
"react": "^18.2.0",
21+
"react-dom": "^18.2.0",
2222
"semantic-ui-css": "^2.4.1",
2323
"semantic-ui-react": "^2.1.3",
2424
"typescript": "^4.8.2"

demo/pages/_document.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Head, Html, Main, NextScript } from "next/document";
2+
import Script from "next/script";
3+
import * as React from "react";
4+
5+
export default function Document() {
6+
return (
7+
<Html>
8+
<Head>
9+
<meta name="viewport" content="width=device-width, initial-scale=1" />
10+
<meta name="theme-color" content="#000000" />
11+
12+
<title>seqviz - Sequence Visualizer by Lattice Automation</title>
13+
<link rel="shortcut icon" type="image/x-icon" href="https://tools.latticeautomation.com/seqviz/favicon.ico" />
14+
<meta name="Description" content="DNA Sequence Visualizer by Lattice Automation" />
15+
<meta name="google" content="notranslate" />
16+
17+
{/* <!-- IMPORT SEMANTIC-UI-REACT --> */}
18+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css" />
19+
20+
{/* <!-- Global site tag (gtag.js) - Google Analytics --> */}
21+
<Script async src="https://www.googletagmanager.com/gtag/js?id=UA-135275522-2"></Script>
22+
</Head>
23+
24+
<body>
25+
<Main />
26+
<NextScript />
27+
</body>
28+
</Html>
29+
);
30+
}

demo/pages/index.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,8 @@
11
import dynamic from "next/dynamic";
2-
import Head from "next/head";
32
import * as React from "react";
43

54
const App = dynamic(() => import("../lib/App"), {
65
ssr: false,
76
});
87

9-
export default () => (
10-
<React.Fragment>
11-
<Head>
12-
<meta name="viewport" content="width=device-width, initial-scale=1" />
13-
<meta name="theme-color" content="#000000" />
14-
15-
<title>seqviz - Sequence Visualizer by Lattice Automation</title>
16-
<link rel="shortcut icon" type="image/x-icon" href="https://tools.latticeautomation.com/seqviz/favicon.ico" />
17-
<meta name="Description" content="DNA Sequence Visualizer by Lattice Automation" />
18-
<meta name="google" content="notranslate" />
19-
20-
{/* <!-- IMPORT SEMANTIC-UI-REACT --> */}
21-
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css" />
22-
23-
{/* <!-- Global site tag (gtag.js) - Google Analytics --> */}
24-
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135275522-2"></script>
25-
</Head>
26-
27-
<App />
28-
</React.Fragment>
29-
);
8+
export default () => <App />;

package-lock.json

Lines changed: 17 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"not dead"
4848
],
4949
"dependencies": {
50-
"react-sizeme": "^3.0.0",
50+
"react-resize-detector": "^7.1.2",
5151
"seqparse": "^0.1.9"
5252
},
5353
"devDependencies": {

src/Circular/Circular.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ interface CircularProps {
5656
onUnmount: (id: string) => void;
5757
radius: number;
5858
search: Range[];
59-
selection: SelectionType;
6059
seq: string;
6160
setCentralIndex: (type: "linear" | "circular", update: number) => void;
6261
setSelection: (selection: SelectionType) => void;
@@ -427,4 +426,5 @@ export const Arc = (props: {
427426
);
428427
};
429428

429+
// @ts-ignore
430430
export default withViewerHOCs(Circular);

0 commit comments

Comments
 (0)