mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-17 13:58:00 +08:00
26 lines
667 B
JavaScript
26 lines
667 B
JavaScript
// jshint esversion: 6
|
|
/*****************************************
|
|
******************************************
|
|
Setup SVG & Canvas elements
|
|
******************************************
|
|
******************************************/
|
|
|
|
import * as d3 from "d3";
|
|
|
|
const setupScatterplot = (width, height, margin) => {
|
|
var container = d3.select("#scatterplot");
|
|
|
|
var svg = container
|
|
.append("svg")
|
|
.attr("width", width + margin.left + margin.right)
|
|
.attr("height", height + margin.top + margin.bottom)
|
|
.append("g")
|
|
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
|
|
|
|
return {
|
|
svg
|
|
};
|
|
};
|
|
|
|
export default setupScatterplot;
|