From 56a691e3077fa322e40425eac25fc91cc37accfc Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Thu, 19 Apr 2018 11:02:10 -0700 Subject: [PATCH] dead canvas code cleanup --- src/components/scatterplot/scatterplot.js | 23 +------------------ .../scatterplot/setupScatterplot.js | 14 ----------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/components/scatterplot/scatterplot.js b/src/components/scatterplot/scatterplot.js index 3063542d..55626069 100644 --- a/src/components/scatterplot/scatterplot.js +++ b/src/components/scatterplot/scatterplot.js @@ -64,7 +64,6 @@ class Scatterplot extends React.Component { componentDidMount() { const { svg - // ctx } = setupScatterplot( width, height, @@ -72,7 +71,6 @@ class Scatterplot extends React.Component { ); this.setState({ svg - // ctx }) const camera = _camera(this.reglCanvas, {scale: true, rotate: false}); @@ -129,22 +127,6 @@ class Scatterplot extends React.Component { this.drawAxesSVG(this.state.xScale, this.state.yScale); } - // if ( - // this.state.xScale && - // this.state.yScale - // ) { - // drawScatterplotCanvas( - // this.state.ctx, - // this.state.xScale, - // this.state.yScale, - // this.props.currentCellSelection, - // this.props.opacityForDeselectedCells, - // this.props.expression, - // this.props.scatterplotXXaccessor, - // this.props.scatterplotYYaccessor, - // ) - // } - if ( this.state.regl && this.state.pointBuffer && @@ -211,9 +193,6 @@ class Scatterplot extends React.Component { this.state.pointBuffer(positions) this.state.colorBuffer(colors) this.state.sizeBuffer(sizes) - // this.state.pointBuffer(generatePoints(count)) - // this.state.colorBuffer(generateColors(count)) - // this.state.sizeBuffer(generateSizes(count)) this.count = positions.length } } @@ -304,7 +283,7 @@ class Scatterplot extends React.Component { width={width} height={height} style={{ - marginLeft: margin.left - 5, + marginLeft: margin.left - 7, marginTop: margin.top }} ref={(canvas) => { this.reglCanvas = canvas}}/> diff --git a/src/components/scatterplot/setupScatterplot.js b/src/components/scatterplot/setupScatterplot.js index 67e7b96e..6f6e3f94 100644 --- a/src/components/scatterplot/setupScatterplot.js +++ b/src/components/scatterplot/setupScatterplot.js @@ -18,23 +18,9 @@ const setupScatterplot = ( .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - // var canvas = container.append("canvas") - // .attr("width", width * devicePixelRatio) - // .attr("height", height * devicePixelRatio) - // .style("width", width + "px") - // .style("height", height + "px") - // .style("margin-left", margin.left + 1 + "px") /* magic number: this seems to be visually correct when it is equal to the amount axis is translated by plus or minus... a little? */ - // .style("margin-top", margin.top + "px") - // - // var ctx = canvas.node().getContext("2d"); - // ctx.globalCompositeOperation = 'darken'; - // ctx.globalAlpha = 0.15; - // ctx.lineWidth = 1.5; - // ctx.scale(devicePixelRatio, devicePixelRatio); return { svg, - // ctx, } }