Skip to content

Commit

Permalink
Removed leaflet
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Jul 15, 2024
1 parent bf7e10b commit c57ac3f
Show file tree
Hide file tree
Showing 66 changed files with 12,814 additions and 13,313 deletions.
4 changes: 0 additions & 4 deletions packages/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@
"@react-three/drei": "^9.84.0",
"@react-three/fiber": "^8.14.2",
"@types/debug": "^4.1.5",
"@types/leaflet": "^1.5.17",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/react-grid-layout": "^1.3.2",
"@types/react-leaflet": "^2.5.2",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/three": "^0.156.0",
Expand All @@ -65,15 +63,13 @@
"debug": "^4.2.0",
"eventemitter3": "^4.0.7",
"keycloak-js": "^11.0.2",
"leaflet": "^1.7.1",
"node-vibrant": "^3.1.6",
"react": "^18.2.0",
"react-components": "workspace:*",
"react-customizable-progressbar": "^1.0.3",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.12",
"react-grid-layout": "^1.3.4",
"react-leaflet": "^2.7.0",
"react-router": "^6.14.1",
"react-router-dom": "^6.14.1",
"rmf-auth": "workspace:*",
Expand Down
4 changes: 1 addition & 3 deletions packages/dashboard/src/components/app-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import {
CircularProgress,
createTheme,
CssBaseline,
GlobalStyles,
Grid,
Snackbar,
} from '@mui/material';
import { ThemeProvider } from '@mui/material/styles';
import React from 'react';
import { rmfDark, rmfDarkLeaflet, rmfLight } from 'react-components';
import { rmfDark, rmfLight } from 'react-components';
import { loadSettings, saveSettings, Settings, ThemeMode } from '../settings';
import { AppController, AppControllerContext, SettingsContext } from './app-contexts';
import AppBar from './appbar';
Expand Down Expand Up @@ -84,7 +83,6 @@ export function AppBase({ children }: React.PropsWithChildren<{}>): JSX.Element
return (
<ThemeProvider theme={theme}>
<CssBaseline />
{settings.themeMode === ThemeMode.RmfDark && <GlobalStyles styles={rmfDarkLeaflet} />}
{openLoadingBackdrop && (
<Backdrop
sx={{ color: '#fff', zIndex: (theme) => theme.zIndex.drawer + 1 }}
Expand Down
21 changes: 0 additions & 21 deletions packages/dashboard/src/components/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,3 @@ body,
margin: 0;
padding: 0;
}

.leaflet-touch .leaflet-bar a {
width: 60px;
height: 60px;
line-height: 60px;
}

.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {
font-size: 44px;
}

.leaflet-touch .leaflet-control-layers-toggle {
width: 60px;
height: 60px;
}

.leaflet-control-layers label {
display: block;
font-size: 2.16em;
}
2 changes: 1 addition & 1 deletion packages/dashboard/src/components/map-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { createMicroApp } from './micro-app';
import { RmfAppContext } from './rmf-app';
import { RobotSummary } from './robots/robot-summary';
import { CameraControl, Door, LayersController, Lifts, RobotThree } from './three-fiber';
import { TrajectoryData } from './trajectories-overlay';
import { TrajectoryData } from '../managers/robot-trajectory-manager';

const debug = Debug('MapApp');

Expand Down
34 changes: 0 additions & 34 deletions packages/dashboard/src/components/trajectories-overlay.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/dashboard/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'leaflet/dist/leaflet.css';
import ReactDOM from 'react-dom/client';
import { LocalizationProvider } from 'react-components';
import { BrowserRouter } from 'react-router-dom';
Expand Down
11 changes: 11 additions & 0 deletions packages/dashboard/src/managers/robot-trajectory-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ export interface TrajectoryResponse {
error?: string;
}

export interface TrajectoryData extends React.PropsWithRef<{}> {
trajectory: Trajectory;
color: string;
conflict?: boolean;
loopAnimation?: boolean;
/**
* default: 1
*/
animationScale?: number;
}

export type Conflict = number[];

export interface RobotTrajectoryManager {
Expand Down
9 changes: 0 additions & 9 deletions packages/dashboard/src/util/css-utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import * as L from 'leaflet';

export function viewBoxFromLeafletBounds(bounds: L.LatLngBoundsExpression): string {
const lbounds = bounds instanceof L.LatLngBounds ? bounds : new L.LatLngBounds(bounds);
const width = lbounds.getEast() - lbounds.getWest();
const height = lbounds.getNorth() - lbounds.getSouth();
return `${lbounds.getWest()} ${-lbounds.getNorth()} ${width} ${height}`;
}

let id = 0;
export function uniqueId(): string {
return (id++).toString();
Expand Down
12 changes: 0 additions & 12 deletions packages/dashboard/src/util/tests/css-utils.test.ts

This file was deleted.

115 changes: 0 additions & 115 deletions packages/react-components/lib/benchmarks/robots.stories.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions packages/react-components/lib/benchmarks/trajectories.stories.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ import React from 'react';
import { render } from '@testing-library/react';
import { CircleShape } from './circle-shape';
import { Euler, Vector3 } from 'three';
import { makeRobotData } from '../test-utils.spec';
import { RobotData } from './robot-three-maker';
import { Canvas } from '@react-three/fiber';

export function makeRobotData(robot: Partial<RobotData> = {}): RobotData {
return {
fleet: 'test_fleet',
name: 'test_robot',
model: 'test_model',
footprint: 1,
color: '#00a000',
...robot,
};
}

describe('CircleShape', () => {
it('should render a circle and a line correctly', () => {
const position = new Vector3(1, 1, 0);
Expand Down
4 changes: 0 additions & 4 deletions packages/react-components/lib/map/constants.ts

This file was deleted.

Loading

0 comments on commit c57ac3f

Please sign in to comment.