tspvis icon indicating copy to clipboard operation
tspvis copied to clipboard

How do I run this code locally?

Open VinayakTekade opened this issue 2 years ago • 8 comments

Hello, I'm a beginner at this. Could you please explain to me how do I run this code locally?

VinayakTekade avatar Jan 26 '22 10:01 VinayakTekade

Sure! First you'll need to install node js if you haven't. I recommend nvm.

Then, from a command line, the following steps should help. I have not tested on windows, but it should work.

npm install
npm run develop

It is built using GatsbyJS, so their docs might help as well.

Please let me know how it goes.

jhackshaw avatar Jan 31 '22 03:01 jhackshaw

When I run npm run develop after installing the dependencies. I'm getting these errors. image

It seems like a file named page-data.json is missing and causing these errors. What shall I do to fix it?

VinayakTekade avatar Jan 31 '22 06:01 VinayakTekade

I do need to do some dependency upgrades, but there are a number of breaking changes in the gatsby dependencies. I just cloned the repo from scratch and it's working, can you give your node version and OS?

jhackshaw avatar Jan 31 '22 17:01 jhackshaw

Hi @jhackshaw I'm on Windows 11 21H2 Build 22000.675 and the node version is v16.15.0.

VinayakTekade avatar May 21 '22 07:05 VinayakTekade

Hi @jhackshaw I'm also facing the same issue as @VinayakTekade. could you please help me here. I'm using Win 10 and my node version is 16.14.2.

Sudarshan-Navale avatar May 24 '22 14:05 Sudarshan-Navale

@VinayakTekade It's all about deck.gl. You need to update the version and register layers in props, not in children. It works for me

Rajabov-Guru avatar Dec 12 '22 14:12 Rajabov-Guru

Using the advice on this thread, which unfortunately didn't actually give the code (why?), or suggested a pull request, I tried to figure it out myself, though I am not that familiar with React myself (it may be that I got something wrong and not aware of it). I was able to get it to work. Here are the changes I made, for anyone else interested in the future:

I updated the deck.gl package to the latest version (currently 8.9.21).

In src/components/MapPlot.jsx I changed:

      <DeckGL viewState={viewport}>
        <PathLayer
          id="path-layer"
          data={plotPaths}
          getPath={d => d.path}
          getColor={d => d.color}
          pickable={true}
          widthMinPixels={4}
          widthMaxPixels={8}
        />
        <ScatterplotLayer
          id="scatter-layer"
          data={plotPoints}
          pickable={true}
          opacity={0.8}
          getFillColor={p => p.color}
          radiusMinPixels={6}
          raduisMaxPixels={8}
        />
      </DeckGL>

To:

      <DeckGL viewState={viewport} layers={[
        new PathLayer({
          id: "path-layer",
          data: plotPaths,
          getPath: d => d.path,
          getColor: d => d.color,
          pickable: true,
          widthMinPixels: 4,
          widthMaxPixels: 8,
        }),
        new ScatterplotLayer({
          id: "scatter-layer",
          data: plotPoints,
          pickable: true,
          opacity: 0.8,
          getFillColor: p => p.color,
          radiusMinPixels: 6,
          radiusMaxPixels: 8
        })
      ]}>

(raduisMaxPixels looked like a typo, so I changed it to radiusMaxPixels).

If this makes sense as a patch, it may be a good idea to integrate it into the code, so this problem wouldn't be an issue for anyone. I'll test it a bit to see if it works fine and may send a pull request in the future.

rotemdan avatar Jul 16 '23 06:07 rotemdan

Hey @rotemdan , this is fantastic thanks for taking a look! I would absolutely be willing to review a pull request with these changes.

jhackshaw avatar Aug 02 '23 23:08 jhackshaw