Files
cellxgene/client/src/components/scatterplot/setupScatterplot.js
T
Bruce Martin f9f43c42c0 more lint - components (#336)
* more lint

* fix typo introduced in delinting

* more lint

* remove dead code

* lint fixes

* lint
2018-10-17 07:17:51 -07:00

26 lines
661 B
JavaScript

// jshint esversion: 6
/*****************************************
******************************************
Setup SVG & Canvas elements
******************************************
******************************************/
import * as d3 from "d3";
const setupScatterplot = (width, height, margin) => {
const container = d3.select("#scatterplot");
const 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;