Kitware / light-viz

Scientific Visualization application for tailored post-processing relying on a ParaViewWeb backend.
https://kitware.github.io/light-viz/
BSD 3-Clause "New" or "Revised" License
20 stars 7 forks source link

npm ERR! Maximum call stack size exceeded #73

Open kmilo9999 opened 5 years ago

kmilo9999 commented 5 years ago

Hello,

I was trying to modify the dependencies of this project to:

package.json

   ..
   ..
   "kw-web-suite": "6.1.0", <------ previous value 5.0.1
   "paraviewweb": "3.2.2", <------ previous value 3.1.1
   ..
   ..

but I am getting the following error:

   npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
   npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
   npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
   npm ERR! Maximum call stack size exceeded

   npm ERR! A complete log of this run can be found in:

I would like to mix the multi view example with light-viz, and it seems it would work fine if somehow updating this two libraries is possible.

Thanks

jourdain commented 5 years ago

Update ParaViewWeb but skip kw-web-suite since the change is a breaking one (major 5->6). That means the build system changed a lot while it should not prevent your from building the project.

kmilo9999 commented 5 years ago

Thanks for the hint. It builds!! However, I tried to load one of the models using the ViewDataSet component in multi view mode and it didnt work.

So, I am following the same architecture as in the multi view example, meaning that after the connection is done, retrieve the views Ids from the server and then render the component (or application to be more precise). ViewDataSet receives the views Ids as props and stores them into a member variable. In the componentWillMount() I commented the call to loadDataset to not to load the model when initializing the component and have full control of the "rendering order". then I added an extra method that handles the right click event:

       loadGeometry()
       {
          loadDataset(this.props.match.params.datasetId, 'RenderView1', (dataset) =>
               this.setState({
                    dataset,
               })
             );
      } 

and in the rendering method I added:

     <button onClick={()=> this.loadGeometry() }>Load Geometry</button>&nbsp; 
      <VtkRenderer
                 key={this.viewsIds[0]}
                 className={style.dualViewDataset}
                 connection={getConnection()}
                 client={getClient()}
                 viewId={this.viewsIds[0]}
              />

In the python all I did was adding an extra parameter to the loadDataset method

        def loadDataset(self, datasetName, viewName):

and on every call to simple.Show() I added an extra parameter which is the view as it follows.

       view = simple.FindView(viewName)
       simple.Show(self.context,view)

I'm doing the same process in the multi view example (which has kw-web-suite 6.1.0 and paraviewweb 3.2.2 ) and it works correctly, as in it loads the model.

So, what I really want is to use the widgets of views in light-viz into the multi view mode example, that is the reason I tried to move my changes from one project to the other. Doing the opposite (moving the widgets to the multi view example) lets me run install, but it throws me this error when building:

   ERROR in ./node_modules/paraviewweb/svg/kitware.svg
   Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type.
  | <?xml version="1.0" encoding="utf-8"?>
  | <!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
  | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1   /DTD/svg11.dtd">
 @ ./node_modules/paraviewweb/src/React/Widgets/SvgIconWidget/index.js 16:15-53
 @ ./src/widgets/TogglePanel/index.js

I checked the path "./node_modules/paraviewweb/svg/kitware.svg" and it does exists. At this point I'm out of ideas. Not sure what that error means. I'd appreciate any guidance at the moment.

Thanks a lot.

jourdain commented 5 years ago

Meaningful error: You may need an appropriate loader to handle this file type. (*.svg)

Way to solve it: Learn how Webpack works. Then use existing code/example to ease the process.

What I can't do: Keep telling you how to fix things when most of the issue is related to JavaScript and Web technology. Nothing to do with ParaViewWeb or Kitware products...

kmilo9999 commented 5 years ago

Ok, Thanks.

You didnt have to rude you know. We are just learning. Everyone started from zero at one point.

Thanks for the help though

jourdain commented 5 years ago

I'm not trying to be rude, I'm just pointing out that the issue tracker on ParaViewWeb or LightViz are not meant for general JavaScript / Webpack question. I agree that everyone has to start from zero at some point. But a Google search could have helped you in many of your previous post.