0.5.3 • Published 1 month ago

mc-react-bands v0.5.3

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

React Materials Cloud Band Structure Visualizer

NPM Version

A React component to visualize band structures and density of states (dos) on the Materials Cloud platform.

The BandsVisualizer component (only the folder src/lib) is published as a npm package, which can be installed via npm install mc-react-bands.

In order to use the library, the peer dependencies (see package.json) need to be installed separately in the consuming application. Additionally, the chart.js plugins need to be registered.

Basic usage is the following:

import BandsVisualizer from "mc-react-bands";

import si_bands from "./exampleData/si_bands.json";
import si_dos from "./exampleData/si_dos.json";

// Chart.js plugins need to be registered outside the library
import Chart from "chart.js/auto";
import zoomPlugin from "chartjs-plugin-zoom";
import annotationPlugin from "chartjs-plugin-annotation";
Chart.register(zoomPlugin);
Chart.register(annotationPlugin);

function App() {
  return (
    <BandsVisualizer
      bandsDataList={[si_bands]}
      dosData={si_dos}
    />
  );
}
export default App;

This repository also contains example usage in the src/App.jsx file. src/data contains the data format of the band and dos files.

The core of this app is based on jquery and chart.js.

Related repositories:

Development

For local development, and running the example, just install and run this repository:

npm install
npm run dev

Publishing a new version

To make a new version and publish to npm via GitHub Actions:

npm version major/minor/patch
git push --follow-tags
0.5.3

1 month ago

0.5.0

1 month ago

0.5.2

1 month ago

0.4.3

1 month ago

0.5.1

1 month ago

0.4.1

2 months ago

0.4.0

2 months ago

0.4.2

2 months ago

0.3.7

10 months ago

0.3.6

11 months ago

0.2.3

12 months ago

0.2.2

12 months ago

0.2.1

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago