How to add a feature to GO JS floorplanner sample?

I’m currently building a GO JS floor planner based on this sample (Floor Planner). When the user places walls and they connect to each other, I want to make a room out of the four walls. I want to fill out the area that was shaped by the 4 walls. I know this is in the second-floor planner but I just want to add this feature to the old one and I don’t know TypeScript. Can someone help me, how should I do it?

If the TypeScript version of FloorPlanner has the feature you want, use it rather than reimplement it. TypeScript is just modern JavaScript plus type declarations.

Okay, but I also need a feature that the old version has and the new one doesn’t. In the old version, you can create walls by hitting Ctrl+1, but in the new TypeScript version, you can’t. How can I integrate this feature to the TypeScript version?

What ctrl-1 did in the old FloorPlanner sample was to start the WallBuildingTool.

You can start the WallBuildingTool in the new FloorPlannerTS sample tool by clicking the “Build Walls” button. However, there are two issues.

  1. It appears that that button is broken; we’ll fix it soon. Sorry about that.
  2. You’ll need to add a key event handler to start the tool. Either override CommandHandler.doKeyDown as shown in GoJS Commands -- Northwoods Software or implement it in HTML.

The bug in FloorPlannerTS has been fixed in https://gojs.net/beta/projects/floorplannerTS