Giter Club home page Giter Club logo

crystvis-js's People

Contributors

dependabot[bot] avatar higgs-bosoff avatar stur86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crystvis-js's Issues

Build fails with crystvis as a dependency

I'm getting an error when trying to build the Galaxy plugin for crystvis version 0.2.1 (using yarn if that matters). Looks like lib/shaders/index.js is missing or isn't being built.

$ yarn build
yarn run v1.22.10
$ parcel build src/crystvis.js -d static
๐Ÿšจ  /home/qci88181/muon-galaxy/config/plugins/visualizations/crystvis/node_modules/crystvis-js/lib/primitives/atoms.js:14:25: Cannot resolve dependency '../shaders/index.js' at '/home/qci88181/muon-galaxy/config/plugins/visualizations/crystvis/node_modules/crystvis-js/lib/shaders/index.js'
  12 |     unitCircle
  13 | } from './geometries.js';
> 14 | import * as Shaders from '../shaders/index.js';
     |                         ^
  15 |
  16 | // Basic materials
  17 | const _phong = new THREE.MeshPhongMaterial({});
error Command failed with exit code 1.

CIF files not loaded with expected name if filename is given

The test "should load new models in the visualiser" on the HTML test page is failing:

AssertionError: expected [ Array(5) ] to deeply equal [ Array(5) ] at Context.<anonymous> (test-html/testbuild.js:295432:65)

The expected array is ['1501936', 'I', 'magres', 'xyz', 'xyz_1'], but the output array is ["cif_[object Object]", "cif_[object Object]_1", "magres", "xyz", "xyz_1"].

This seems to be a twofold problem: the prefix "cif" is added to the name (like other formats), and the CIF loader doesn't lift out the model name correctly. In lib/formats/cif.js:

// contents = data for "1501936" model, filename = "cif"

let structs = Atoms.readCif(contents); // {1501936: Atoms6}

if (filename) {
    structs = _.mapKeys(structs, (k) => (filename + '_' + k)); // {cif_[object Object]: Atoms6}
}

The mocha test "should load properly a CIF file" does not fail as no filename is passed to the loader.

Breaking changes to BoxGeometry in three 0.125+

Release Three 0.125 changed the BoxGeometry class so it no longer has a vertices attribute - this affects the BoxMesh class here. There might be other breaking changes too.

The line linked above is breaking when I try to load a file into the renderer through Galaxy (reverting to three 0.124 fixes it). This doesn't seem to break the demo or tests, though, which is odd as they also call BoxMesh.

Demo errors when loading CIF files

When loading CHA.cif or org.cif from the test files on the demo page:

Uncaught TypeError: Cannot read property 'find' of null
    at FileReader.reader.onload

Relates to this line.

The H2O.xyz file works fine so I assume this is a CIF issue.

Fails to read Magres files with >100 atoms

When loading a Magres file with >100 atoms, the ms lines end up being like;

ms H100          2.0431056083497484E+01         -5.5892879764485039E+00          1.2418129913251554E+00         -4.0897852040395684E+00          2.9708843218858465E+01         -3.8875121992744055E+00         -1.1586267278454099E+00          5.0678781904684089E-01          2.4711193494436703E+01

e.g. the H and 100 are in the same block. In the following code (lines 150-155 in formats/magres.js), it splits the block by whitespace

        for (let i = 0; i < block.length; ++i) {
            let l = block[i];
            let lspl = _.trim(l).split(/\s+/);
            // Is it a 'units' line?
            if (lspl[0] == 'units') {
                let tag = lspl[1];

but for atoms where the atom label and number have concatenated this will only have 8 members and so the parseOneAtomLine will throw a Input matrix is not symmetric error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.