mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-28 03:50:11 +08:00
Prettified Code!
This commit is contained in:
1 parent
4c77c4e7c0
commit
95884a7f95
11 files changed
+23
-25
No files matched your search
@@ -17,11 +17,7 @@
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"@typescript-eslint",
|
||||
"unused-imports"
|
||||
],
|
||||
"plugins": ["react", "@typescript-eslint", "unused-imports"],
|
||||
"rules": {
|
||||
"arrow-body-style": "off",
|
||||
"camelcase": "off",
|
||||
@@ -32,4 +28,4 @@
|
||||
"react/destructuring-assignment": "off",
|
||||
"unused-imports/no-unused-imports-ts": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
import Banner from './Banner';
|
||||
|
||||
export default Banner;
|
||||
export default Banner;
|
||||
@@ -254,7 +254,7 @@ export function RenderControls() {
|
||||
min_resolution,
|
||||
max_resolution,
|
||||
field_of_view,
|
||||
websocket // need to re-render when websocket changes to use the new websocket
|
||||
websocket, // need to re-render when websocket changes to use the new websocket
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@ import { Box, Button, Modal, Typography } from '@mui/material';
|
||||
|
||||
import WebSocketUrlField from '../WebSocketUrlField';
|
||||
|
||||
|
||||
interface LandingModalProps {
|
||||
initial_state: object
|
||||
initial_state: object;
|
||||
}
|
||||
|
||||
export default function LandingModel(props: LandingModalProps) {
|
||||
@@ -37,7 +36,11 @@ export default function LandingModel(props: LandingModalProps) {
|
||||
<Box className="LandingModal-box">
|
||||
<Typography id="modal-modal-title" component="div">
|
||||
Welcome to the Nerfactory Viewer!{' '}
|
||||
<img style={{ height: 37, margin: 'auto' }} src="/favicon.png" alt="The favicon."/>
|
||||
<img
|
||||
style={{ height: 37, margin: 'auto' }}
|
||||
src="/favicon.png"
|
||||
alt="The favicon."
|
||||
/>
|
||||
</Typography>
|
||||
<Typography
|
||||
id="modal-modal-description"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import LandingModel from './LandingModal';
|
||||
|
||||
export default LandingModel;
|
||||
export default LandingModel;
|
||||
@@ -1,3 +1,3 @@
|
||||
import CameraPanel from './CameraPanel';
|
||||
|
||||
export default CameraPanel;
|
||||
export default CameraPanel;
|
||||
@@ -66,11 +66,15 @@ function ListItem(props: ListItemProps) {
|
||||
setValue(!value);
|
||||
}
|
||||
|
||||
return <button type="button" onClick={handleClick}>{name}</button>;
|
||||
return (
|
||||
<button type="button" onClick={handleClick}>
|
||||
{name}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
interface ClickableListProps {
|
||||
sceneTree: object
|
||||
sceneTree: object;
|
||||
}
|
||||
|
||||
function ClickableList(props: ClickableListProps) {
|
||||
@@ -105,7 +109,7 @@ function ClickableList(props: ClickableListProps) {
|
||||
}
|
||||
|
||||
interface BasicTabsProps {
|
||||
sceneTree: object
|
||||
sceneTree: object;
|
||||
}
|
||||
|
||||
export function BasicTabs(props: BasicTabsProps) {
|
||||
|
||||
@@ -4,13 +4,11 @@ import Button from '@mui/material/Button';
|
||||
import { useSelector } from 'react-redux';
|
||||
import WebSocketUrlField from '../../WebSocketUrlField';
|
||||
|
||||
|
||||
interface StatusPanelProps {
|
||||
sceneTree: object
|
||||
sceneTree: object;
|
||||
}
|
||||
|
||||
export default function StatusPanel(props: StatusPanelProps) {
|
||||
|
||||
const sceneTree = props.sceneTree;
|
||||
|
||||
const isWebsocketConnected = useSelector(
|
||||
@@ -30,7 +28,7 @@ export default function StatusPanel(props: StatusPanelProps) {
|
||||
const handleChange = () => {
|
||||
setValue(!value);
|
||||
};
|
||||
const scene_button = value ? "Hide Scene" : "Show Scene";
|
||||
const scene_button = value ? 'Hide Scene' : 'Show Scene';
|
||||
sceneTree.object.visible = value;
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,7 +7,6 @@ import React, { useContext, useEffect, useRef } from 'react';
|
||||
import { WebSocketContext } from '../WebSocket/WebSocket';
|
||||
import WebRtcWindow from '../WebRtcWindow/WebRtcWindow';
|
||||
|
||||
|
||||
const msgpack = require('msgpack-lite');
|
||||
|
||||
function createStats() {
|
||||
@@ -30,7 +29,7 @@ export default function ViewerWindow(props) {
|
||||
(state) => state.renderingState.field_of_view,
|
||||
);
|
||||
const field_of_view_ref = useRef(field_of_view);
|
||||
|
||||
|
||||
const camera = useRef(null);
|
||||
let cameraControls = null;
|
||||
let renderer = null;
|
||||
@@ -128,7 +127,6 @@ export default function ViewerWindow(props) {
|
||||
cameraControls.dampingFactor = 1.0;
|
||||
cameraControls.update();
|
||||
update();
|
||||
|
||||
}, []);
|
||||
|
||||
// updates the field of view inside the ref to avoid rerendering so often
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function WebSocketContextFunction({ children }) {
|
||||
|
||||
connect();
|
||||
ws = {
|
||||
socket
|
||||
socket,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -4,7 +4,6 @@ import { TextField } from '@mui/material';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
export default function WebSocketUrlField() {
|
||||
|
||||
const websocket_url = useSelector(
|
||||
(state) => state.websocketState.websocket_url,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user