Skip to content

Commit

Permalink
Redo Typescript migration (#133)
Browse files Browse the repository at this point in the history
* Migrate base types
* Migrate geodata
* Migrate map-equipments
* Fix luma.gl typesdef
* Migrate map layers
* Migrate network-map
* Update demo
* fix comments
* Fix license header
* mark class overrides

Signed-off-by: Tristan Chuine <[email protected]>
Co-authored-by: Arnaud Marant <[email protected]>
  • Loading branch information
Tristan-WorkGH and amarant authored Jan 13, 2025
1 parent 0191784 commit 10efc22
Show file tree
Hide file tree
Showing 23 changed files with 1,812 additions and 1,004 deletions.
12 changes: 6 additions & 6 deletions demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

import { useEffect, useRef } from 'react';
import { createTheme, StyledEngineProvider, ThemeProvider } from '@mui/material/styles';
import { GeoData, NetworkMap, NetworkMapRef } from '../../src';
import { Equipment } from '../../src/components/network-map-viewer/network/map-equipments';
import { addNadToDemo, addSldToDemo } from './diagram-viewers/add-diagrams';
import DemoMapEquipments from './map-viewer/demo-map-equipments';
import { GeoData, type MapEquipment, MapEquipments, NetworkMap, type NetworkMapRef } from '../../src';

import { addNadToDemo, addSldToDemo } from './diagram-viewers/add-diagrams';
import sposdata from './map-viewer/data/spos.json';
import lposdata from './map-viewer/data/lpos.json';
import smapdata from './map-viewer/data/smap.json';
Expand All @@ -29,7 +27,7 @@ export default function App() {
}, []);

//called after a click (right mouse click) on an equipment (line or substation)
function showEquipmentMenu(equipment: Equipment, x: number, y: number, type: string) {
function showEquipmentMenu(equipment: MapEquipment, x: number, y: number, type: string) {
console.log('# Show equipment menu: ' + JSON.stringify(equipment) + ', type: ' + type);
}

Expand Down Expand Up @@ -58,7 +56,9 @@ export default function App() {
geoData.setSubstationPositions(sposdata);
geoData.setLinePositions(lposdata);

const mapEquipments = new DemoMapEquipments(smapdata, lmapdata);
const mapEquipments = new MapEquipments();
mapEquipments.updateSubstations(smapdata, true);
mapEquipments.updateLines(lmapdata, true);

useEffect(() => {
const handleContextmenu = (e: MouseEvent) => {
Expand Down
23 changes: 0 additions & 23 deletions demo/src/map-viewer/demo-map-equipments.ts

This file was deleted.

Loading

0 comments on commit 10efc22

Please sign in to comment.