
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
crystvis-js
Advanced tools
A Three.js based crystallographic visualisation tool. It reads multiple file formats and renders them with WebGL to a canvas element, allowing the user to interact with them. A few of the key functionality:
The currently supported file formats are the following:
In order to install crystvis-js, simply use the Node Package Manager:
npm install crystvis-js --save
You can then create a visualizer for your webpage by simply importing and instantiating it:
import CrystVis from 'crystvis-js';
const visualizer = CrystVis('#target-id', 800, 600)
will create an 800x600 canvas with the visualizer inside the element specified by the given selector. To load a model, simply load the contents of your file as a text string and then pass them to the visualizer's loadModels method:
var loaded = visualizer.loadModels(contents);
console.log('Models loaded: ', loaded);
visualizer.displayModel(loaded[0])
If you want to develop for crystvis-js, you should follow these steps:
npm install --production=falseYou're then ready to develop. In particular you can use:
npm test to run with Mocha the suite of tests found in ./testnpm start to start a server that includes the in-browser tests from ./test/test-html as well as the demo from ./demonpm run docs to compile the documentsnpm run deploy-docs to compile the documents and then deploy them to the gh-pages branch of your repositorySome additional steps are necessary when dealing with fonts and shaders. You generally shouldn't worry about these when working with most of the code, but in some special cases it might be necessary to do this.
Fonts in crystvis-js need to be translated to a bitmap format to be usable. In other words, a regular font format (like a TTF file)
must be rendered into a bitmap texture and a table of coordinates designating each letter to then be used in graphical rendering. This operation
relies on the library msdf-bmfont-xml and is executed by running the command npm run build-fonts. The original fonts are found in
the ./fonts folder, and they get rendered to ./lib/assets/fonts. This command needs only to be rerun if the TTF files change.
Shaders are provided as .frag and .vert files. Both shaders and font textures need to baked directly into the JavaScript files in order to be
included in the final build. Since ESBuild (the package used to build crystvis-js) has a hard time dealing with them in the final pass, they get
pre-baked with an additional step that only needs to be repeated whenever either of them changes. This consists of taking "template" JS files (for
shaders it's ./lib/shaders/index.in.js, for fonts ./lib/assets/fonts/bmpfonts.in.js) and rebuilding them into final files with the
assets imported in data URL form. The script to do this is npm run build-resources. This command only needs to be rerun if the fonts were rebuilt, if the shader
code was edited, or if any of the two template files was changed.
FAQs
A Three.js based crystallographic visualisation tool
The npm package crystvis-js receives a total of 20 weekly downloads. As such, crystvis-js popularity was classified as not popular.
We found that crystvis-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.