dead canvas code cleanup

This commit is contained in:
Colin Megill
2018-04-19 11:02:10 -07:00
parent d9af0c5e51
commit 56a691e307
2 changed files with 1 additions and 36 deletions
+1 -22
View File
@@ -64,7 +64,6 @@ class Scatterplot extends React.Component {
componentDidMount() { componentDidMount() {
const { const {
svg svg
// ctx
} = setupScatterplot( } = setupScatterplot(
width, width,
height, height,
@@ -72,7 +71,6 @@ class Scatterplot extends React.Component {
); );
this.setState({ this.setState({
svg svg
// ctx
}) })
const camera = _camera(this.reglCanvas, {scale: true, rotate: false}); 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); 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 ( if (
this.state.regl && this.state.regl &&
this.state.pointBuffer && this.state.pointBuffer &&
@@ -211,9 +193,6 @@ class Scatterplot extends React.Component {
this.state.pointBuffer(positions) this.state.pointBuffer(positions)
this.state.colorBuffer(colors) this.state.colorBuffer(colors)
this.state.sizeBuffer(sizes) this.state.sizeBuffer(sizes)
// this.state.pointBuffer(generatePoints(count))
// this.state.colorBuffer(generateColors(count))
// this.state.sizeBuffer(generateSizes(count))
this.count = positions.length this.count = positions.length
} }
} }
@@ -304,7 +283,7 @@ class Scatterplot extends React.Component {
width={width} width={width}
height={height} height={height}
style={{ style={{
marginLeft: margin.left - 5, marginLeft: margin.left - 7,
marginTop: margin.top marginTop: margin.top
}} }}
ref={(canvas) => { this.reglCanvas = canvas}}/> ref={(canvas) => { this.reglCanvas = canvas}}/>
@@ -18,23 +18,9 @@ const setupScatterplot = (
.append("g") .append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); .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 { return {
svg, svg,
// ctx,
} }
} }