Files
cellxgene/client/src/components/scatterplot/setupScatterplot.js
2018-08-16 10:11:18 -04:00

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;