Convert Figma logo to code with AI

microsoft logoSandDance

Visually explore, understand, and present your data.

6,375
524
6,375
97

Top Related Projects

11,196

A visualization grammar.

16,856

Open-source JavaScript charting library behind Plotly and Dash

108,427

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

60,384

Apache ECharts is a powerful, interactive charting and data visualization library for browser

13,142

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries

12,049

WebGL2 powered visualization framework

Quick Overview

SandDance is an open-source data visualization system developed by Microsoft Research. It allows users to create interactive, animated visualizations of large datasets using a variety of chart types and transitions. SandDance is designed to help users explore and understand complex data through intuitive, visually appealing representations.

Pros

  • Highly interactive and engaging visualizations
  • Supports large datasets with smooth performance
  • Offers a wide range of chart types and customization options
  • Seamless integration with popular data analysis tools like Power BI

Cons

  • Steep learning curve for advanced features
  • Limited documentation for some components
  • Requires a modern web browser for optimal performance
  • May be resource-intensive for very large datasets

Code Examples

// Creating a simple bar chart
import * as vega from 'vega';
import * as SandDance from '@msrvida/sanddance-explorer';

const spec = {
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {"url": "data/cars.json"},
  "mark": "bar",
  "encoding": {
    "x": {"field": "Origin", "type": "nominal"},
    "y": {"aggregate": "count", "type": "quantitative"}
  }
};

SandDance.view(spec, { renderer: 'svg' });
// Adding interactivity to a scatter plot
const spec = {
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {"url": "data/cars.json"},
  "mark": "point",
  "encoding": {
    "x": {"field": "Horsepower", "type": "quantitative"},
    "y": {"field": "Miles_per_Gallon", "type": "quantitative"},
    "color": {"field": "Origin", "type": "nominal"},
    "tooltip": [
      {"field": "Name", "type": "nominal"},
      {"field": "Horsepower", "type": "quantitative"},
      {"field": "Miles_per_Gallon", "type": "quantitative"}
    ]
  }
};

SandDance.view(spec, { renderer: 'svg', hover: true });
// Creating an animated transition between chart types
const spec1 = {
  // ... (bar chart specification)
};

const spec2 = {
  // ... (scatter plot specification)
};

SandDance.transition(spec1, spec2, { duration: 1000 });

Getting Started

To get started with SandDance, follow these steps:

  1. Install SandDance via npm:

    npm install @msrvida/sanddance-explorer
    
  2. Import SandDance in your project:

    import * as SandDance from '@msrvida/sanddance-explorer';
    
  3. Create a container element in your HTML:

    <div id="sanddance-container"></div>
    
  4. Initialize SandDance with your data and configuration:

    const explorer = new SandDance.Explorer(document.getElementById('sanddance-container'), {
      data: yourDataArray,
      scheme: 'dark'
    });
    
  5. Start exploring your data with SandDance's interactive visualizations!

Competitor Comparisons

11,196

A visualization grammar.

Pros of Vega

  • More mature and established project with a larger community and ecosystem
  • Offers greater flexibility and customization options for creating complex visualizations
  • Supports a wider range of chart types and data transformations

Cons of Vega

  • Steeper learning curve due to its more comprehensive feature set
  • Requires more code and configuration for basic visualizations
  • Less focus on 3D visualizations compared to SandDance

Code Comparison

SandDance:

const view = await vega.embed('#vis', {
  $schema: 'https://vega.github.io/schema/vega-lite/v4.json',
  data: { values: data },
  mark: 'point',
  encoding: { x: { field: 'x' }, y: { field: 'y' } }
});

Vega:

const spec = {
  $schema: 'https://vega.github.io/schema/vega/v5.json',
  width: 400, height: 200,
  data: [{ name: 'table', values: data }],
  marks: [{ type: 'symbol', from: { data: 'table' },
    encode: { enter: { x: { field: 'x' }, y: { field: 'y' } } }
  }]
};
const view = new vega.View(vega.parse(spec)).render('#vis');

Both libraries use declarative JSON specifications to define visualizations, but Vega requires more detailed configuration for similar results. SandDance focuses on simplicity for 3D visualizations, while Vega offers more control and flexibility for a wider range of chart types.

16,856

Open-source JavaScript charting library behind Plotly and Dash

Pros of Plotly.js

  • Extensive chart types and customization options
  • Large community and ecosystem with numerous extensions
  • Well-documented API with interactive examples

Cons of Plotly.js

  • Steeper learning curve for complex visualizations
  • Larger file size, which may impact page load times
  • Can be resource-intensive for large datasets

Code Comparison

SandDance:

import * as SandDance from "@msrvida/sanddance-react";

const view = new SandDance.Viewer(element);
view.render({
  data: myData,
  chart: "scatterplot",
  columns: { x: "sales", y: "profit" }
});

Plotly.js:

import Plotly from 'plotly.js-dist';

Plotly.newPlot('myDiv', [{
  x: [1, 2, 3, 4],
  y: [10, 15, 13, 17],
  type: 'scatter'
}]);

SandDance focuses on unit visualizations and offers a more declarative API, while Plotly.js provides a wider range of chart types with a more imperative approach. Plotly.js excels in traditional charting scenarios, whereas SandDance shines in exploratory data analysis with its unique unit visualization concept.

108,427

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

Pros of D3

  • Highly flexible and customizable for creating a wide range of data visualizations
  • Large and active community with extensive documentation and examples
  • Powerful data binding and manipulation capabilities

Cons of D3

  • Steeper learning curve, especially for complex visualizations
  • Requires more low-level coding compared to higher-level libraries
  • Performance can be an issue with large datasets or complex animations

Code Comparison

SandDance:

const view = await vega.embed('#vis', {
  $schema: 'https://vega.github.io/schema/vega-lite/v4.json',
  data: { values: data },
  mark: 'point',
  encoding: { x: { field: 'x', type: 'quantitative' }, y: { field: 'y', type: 'quantitative' } }
});

D3:

const svg = d3.select('#vis')
  .append('svg')
  .attr('width', width)
  .attr('height', height);

svg.selectAll('circle')
  .data(data)
  .enter()
  .append('circle')
  .attr('cx', d => xScale(d.x))
  .attr('cy', d => yScale(d.y))
  .attr('r', 5);

SandDance provides a higher-level abstraction for creating visualizations, while D3 offers more granular control over the rendering process. SandDance's code is more declarative, whereas D3 requires more imperative programming to achieve similar results.

60,384

Apache ECharts is a powerful, interactive charting and data visualization library for browser

Pros of ECharts

  • More comprehensive and versatile, offering a wider range of chart types and visualization options
  • Larger community and ecosystem, with extensive documentation and third-party extensions
  • Better performance for handling large datasets and rendering complex visualizations

Cons of ECharts

  • Steeper learning curve due to its extensive API and configuration options
  • Larger file size, which may impact load times for web applications
  • Less focus on specific data exploration and analysis features compared to SandDance

Code Comparison

SandDance:

import * as SandDance from "@msrvida/sanddance-react";

<SandDance.Viewer
  data={myData}
  insight={{
    chart: "scatterplot",
    columns: { x: "sales", y: "profit" }
  }}
/>

ECharts:

import * as echarts from 'echarts';

const chart = echarts.init(document.getElementById('chart'));
chart.setOption({
  xAxis: { type: 'value' },
  yAxis: { type: 'value' },
  series: [{
    type: 'scatter',
    data: myData.map(item => [item.sales, item.profit])
  }]
});
13,142

nivo provides a rich set of dataviz components, built on top of the awesome d3 and React libraries

Pros of nivo

  • Offers a wider variety of chart types and visualizations
  • More customizable and flexible for complex data visualization needs
  • Active development with frequent updates and new features

Cons of nivo

  • Steeper learning curve due to its extensive API and options
  • May require more setup and configuration for basic use cases

Code Comparison

SandDance:

import * as React from 'react';
import { SandDance } from '@msrvida/sanddance-react';

const App = () => (
  <SandDance data={myData} />
);

nivo:

import { ResponsiveLine } from '@nivo/line'

const MyChart = () => (
  <ResponsiveLine
    data={data}
    margin={{ top: 50, right: 110, bottom: 50, left: 60 }}
    xScale={{ type: 'point' }}
    yScale={{ type: 'linear', min: 'auto', max: 'auto', stacked: true, reverse: false }}
  />
)

SandDance provides a simpler API for quick visualizations, while nivo offers more granular control over chart properties and appearance. nivo's code tends to be more verbose but allows for greater customization.

12,049

WebGL2 powered visualization framework

Pros of deck.gl

  • Highly performant for large datasets, capable of rendering millions of data points
  • Extensive ecosystem with many pre-built layers and extensions
  • Strong integration with mapping libraries like Mapbox GL

Cons of deck.gl

  • Steeper learning curve due to its comprehensive API and features
  • Requires more setup and configuration for basic visualizations

Code Comparison

SandDance:

var viewer = new SandDance.Viewer(element);
viewer.render({
    data: myData,
    chart: 'scatterplot',
    columns: { x: 'sales', y: 'profit' }
});

deck.gl:

const layer = new ScatterplotLayer({
    data: myData,
    getPosition: d => [d.sales, d.profit],
    getRadius: 1,
    pickable: true
});
new Deck({ layers: [layer] });

Summary

While SandDance offers a more user-friendly approach for quick data exploration and visualization, deck.gl provides greater flexibility and performance for complex, large-scale data visualizations. SandDance excels in ease of use and rapid prototyping, whereas deck.gl shines in customization and handling massive datasets, particularly in geospatial contexts.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

SandDance

Visually explore, understand, and present your data.

sanddance-animation

By using easy-to-understand views, SandDance helps you find insights about your data, which in turn help you tell stories supported by data, build cases based on evidence, test hypotheses, dig deeper into surface explanations, support decisions for purchases, or relate data into a wider, real world context.

SandDance uses unit visualizations, which apply a one-to-one mapping between rows in your database and marks on the screen. Smooth animated transitions between views help you to maintain context as you interact with your data.

This new version of SandDance has been rebuilt from scratch with the goal of being modular, extensible, and embeddable into your custom applications. We are now on GitHub so that we are open and driven by the community through contributions, feature requests, and discussion.

SandDance was created by the Microsoft Research VIDA Group which explores novel technologies for visualization and immersive data analytics.

Where can I use SandDance?

Component architecture

SandDance is an offering of several JavaScript components:

Publications

Articles & videos

Changelog

  • July 2022 - Major version bump to v4: Now using MorphCharts.
  • June 2020 - Major version bump to v3: Now using Deck.gl@8.
  • December 2019 - Major version bump to v2: Now using Vega@5.
  • August 2019 - Initial release to AppSource (Power BI marketplace).
  • April 2019 - Initial release to GitHub.

Known issues

  • Animations require a WebGL2 enabled browser.

Roadmap

  • PowerBI custom visual based on this new architecture. done!
  • Additional views, such as stacks. done!
  • Code examples and tutorials.
  • Faceting for all chart types. done!
  • Better date handling.

Dependencies

SandDance is created with open source libraries, using Vega for chart layout.

Development

See dev.md

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

NPM DownloadsLast 30 Days