This repository demonstrates how to set up a basic Vitessce application using Vite and React.
- Node.js: Ensure you have Node.js installed. Vitessce has been tested with Node.js versions 16 and 18. (vitessce.io)
-
** This project was created as a Vite React Template project with the following command **:
npm create vite@latest vitessce-demo-gh-pages -- --template react
-
Navigate to the project directory:
cd vitessce-demo-gh-pages
-
Install dependencies:
npm install
-
Install specific React versions compatible with Vitessce:
npm install react@18.0.0 react-dom@18.0.0
Vitessce is compatible with React version 18.0.0. (vitessce.io)
-
Install Vitessce:
npm install vitessce
Start the development server with:
npm run dev
This will start the Vite development server, typically accessible at http://localhost:5173/
.
To embed Vitessce into your React application:
-
Import the Vitessce component:
import { Vitessce } from 'vitessce';
-
Provide a view configuration:
Create a JSON object that defines the layout and data sources for Vitessce. Refer to the Vitessce documentation for details on crafting view configurations.
-
Render the Vitessce component:
<Vitessce config={yourViewConfig} height={800} theme="light" />
Replace
yourViewConfig
with your actual configuration object.
-
React Version: Ensure you're using React version 18.0.0 for compatibility with Vitessce.
-
Vite Version: At the time of writing, the latest version of Vite is
6.3.5
. Ensure your project uses a compatible version. -
Vitessce Documentation: For more detailed information on integrating and configuring Vitessce, visit the official documentation.