All Projects → Swizec → D3blackbox

Swizec / D3blackbox

A simple React wrapper for any D3 code you want

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to D3blackbox

Carbon Charts
📊 📈⠀Robust dataviz framework implemented using D3 & typescript
Stars: ✭ 287 (+258.75%)
Mutual labels:  d3, d3js
D3 Dot Graph
This module provides D3js compatible library to parse and load files in graphviz DOT (.dot) (graph description language) format.
Stars: ✭ 23 (-71.25%)
Mutual labels:  d3, d3js
Ngx Charts
📊 Declarative Charting Framework for Angular
Stars: ✭ 4,057 (+4971.25%)
Mutual labels:  d3, d3js
billboard
🎤 Lyrics/associated NLP data for Billboard's Top 100, 1950-2015.
Stars: ✭ 53 (-33.75%)
Mutual labels:  d3, d3js
Sankey
D3 Sankey Diagram Generator with self-loops
Stars: ✭ 61 (-23.75%)
Mutual labels:  d3, d3js
game of life-elixir
An implementation of Conway's Game of Life in Elixir
Stars: ✭ 22 (-72.5%)
Mutual labels:  d3, d3js
D3fc
A collection of components that make it easy to build interactive charts with D3
Stars: ✭ 898 (+1022.5%)
Mutual labels:  d3, d3js
align covid
Coronavirus time series aligned by number of cases, not date.
Stars: ✭ 22 (-72.5%)
Mutual labels:  d3, d3js
Dual Scale D3 Bar Chart
This is a demo for creating dual-scaled bar charts using D3.js
Stars: ✭ 49 (-38.75%)
Mutual labels:  d3, d3js
D3 Parliament
A parliament chart based on D3js
Stars: ✭ 44 (-45%)
Mutual labels:  d3, d3js
turkeyvisited
Mark the cities you have visited in Turkey and share the map!
Stars: ✭ 82 (+2.5%)
Mutual labels:  d3, d3js
D3
This is the repository for my course, Learning Data Visualization with D3.js on LinkedIn Learning and Lynda.com.
Stars: ✭ 64 (-20%)
Mutual labels:  d3, d3js
leaflet heatmap
简单的可视化湖州通话数据 假设数据量很大,没法用浏览器直接绘制热力图,把绘制热力图这一步骤放到线下计算分析。使用Apache Spark并行计算数据之后,再使用Apache Spark绘制热力图,然后用leafletjs加载OpenStreetMap图层和热力图图层,以达到良好的交互效果。现在使用Apache Spark实现绘制,可能是Apache Spark不擅长这方面的计算或者是我没有设计好算法,并行计算的速度比不上单机计算。Apache Spark绘制热力图和计算代码在这 https://github.com/yuanzhaokang/ParallelizeHeatmap.git .
Stars: ✭ 13 (-83.75%)
Mutual labels:  d3, d3js
D3 Extended
Extends D3 with some common jQuery functions and more
Stars: ✭ 269 (+236.25%)
Mutual labels:  d3, d3js
d3.geometer
[NOT MAINTAINED] A D3js library for drawing polytopes, angles, coordinates, geometries and more.
Stars: ✭ 18 (-77.5%)
Mutual labels:  d3, d3js
Party Mode
An experimental music visualizer using d3.js and the web audio api.
Stars: ✭ 690 (+762.5%)
Mutual labels:  d3, d3js
real-time-data-viz-d3-crossfilter-websocket-tutorial
Tutorial on real-time data visualization. Python websocket server & d3.js + crossfilter.js frontend
Stars: ✭ 32 (-60%)
Mutual labels:  d3, d3js
d3-cv.js
Render your CV with some d3 goodies.
Stars: ✭ 12 (-85%)
Mutual labels:  d3, d3js
Neo4jd3
Neo4j graph visualization using D3.js
Stars: ✭ 843 (+953.75%)
Mutual labels:  d3, d3js
Vue D3 Workshop
Workshop content material and excercises for Suncoast Developers
Stars: ✭ 63 (-21.25%)
Mutual labels:  d3, d3js

d3blackbox

npm package

Take any D3 example you find in the wild and wrap it in a React component. Great for quick experiments and meeting deadlines. 😛

Meet your deadline in 2 minutes

Check out how it works in a live Codesandbox

  1. Install d3blackbox with npm
$ npm install -s d3blackbox
  1. Find a D3 example you like
  2. Copy its code, put it in a function
  3. Wrap function in D3blackbox
import React from "react";
import D3blackbox from "d3blackbox";
import * as d3 from "d3";

const MyDataviz = D3blackbox(function(anchor, props, state) {
    const svg = d3.select(anchor.current);

    // the rest of your D3 code
});

export default MyDataviz;
  1. Render inside an <svg></svg> element
  2. Enjoy your blackbox D3 component

D3blackbox renders an anchor element and delegates control to your render function. You get an anchor ref, the component's props, and state. Do what you want :)

Great for meeting deadlines and playing around with other people's code. Not recommended for large scale use due to performance constraints. Your render function runs on every component update and redraws the entire DOM subtree. React's rendering engine can't help you.

That's why it's called a sandbox.

What if I don't use D3?

That's okay. D3blackbox lets you delegate control to any rendering library you want. As long as you're okay rendering into a <g></g> element.

You can even use this approach to render Vue apps inside your React apps. 🤨

What if I don't want <g>?

That's okay you weirdo. Use the component argument to specify a different component.

render() {
    return <MyDataviz component="div" />
}

HOCs are so September, do you have hooks?

Yes. Hooks are alpha support and all that, but here's how you can use D3 blackbox as a React hook.

import { useD3 } from "d3blackbox";

function renderSomeD3(anchor) {
    d3.select(anchor);

    // ...
}

const MyD3Component = ({ x, y }) => {
    const refAnchor = useD3(anchor => renderSomeD3(anchor));

    return <g ref={refAnchor} transform={`translate(${x}, ${y})`} />;
};

With love ❤️

Built with love by Swizec
Cheers

Only took me 2 years to get around to opensourcing this 😅

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].