MorphCharts is a visualization library for creating rich, immersive, and engaging 2D and 3D data visualizations.
You can Try Online, or install and run locally (see Installation, below).
There are 2 principal ways to create charts using this library:
- Provide a JSON specification based on a subset of the VEGA visualization grammar, with extensions to support 3D visualizations.
- Use code to create visualizations directly, with the
Core
library and aRenderer
.
The JSON specification can define data sources and transformations, scales, axes, and visualizations. Data sources can be defined in the following ways:
- Using an inline JSON definition.
- Linking to an external file via a URL.
The Try Online page also supports using local files.
Charts are principally rendered using procedural geometry and path tracing. Supported geometric primitives include rectangles, cuboids, spheres, cylinders, hex prisms, ring segments, and torus segments.
Render pipelines are provided for:
- Ray tracing with global illumination.
- Color, simple normal-based shading with directional and ambient lighting.
- Segment maps, useful for picking and edge detection.
- Normal maps.
- Depth maps.
- Edge outlines.
The ray tracer supports rendering the following material types, which can be defined in the JSON specification:
- Diffuse (Lambertian shading).
- Metal.
- Glass.
- Glossy (combining diffuse and glass properties).
- Emissive light sources.
Materials can be rendered in solid color, or textured.
Visualizations can be generated at arbitrary resolutions. Single images can be created, typically up to 4K (3840x2160px) resolution (depending on hardware). For larger resolutions, multiple image tiles can be created, which can be stitched into an arbitrarily large image.
The repo has the following components:
Core
library used by the other components.Client
web site to demonstrate use of the visualization framework.Renderers
for generating visualizations:WebGPURaytrace
, for web browser rendering on the GPU using WebGPU.
- Visualization grammar
Spec
parser, based on a subset of the VEGA specification format, with extensions to support 3D visualizations.
The project can be installed and run locally using the following steps:
- Clone the repo.
npm install
to install any required dependencies.- Build the project using
npm run build_client
. - Start the web site using
npm run start_client
, which also opens theclient.html
page in the default web browser.