mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-08 05:18:12 +08:00
scale scatterplot point rendering size with overall app size, not scatterplot canvas size (#956)
This commit is contained in:
@@ -52,7 +52,9 @@ function createProjectionTF(viewportWidth, viewportHeight) {
|
|||||||
expressionX,
|
expressionX,
|
||||||
expressionY,
|
expressionY,
|
||||||
|
|
||||||
crossfilter
|
crossfilter,
|
||||||
|
|
||||||
|
responsive: state.responsive
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
class Scatterplot extends React.Component {
|
class Scatterplot extends React.Component {
|
||||||
@@ -345,8 +347,12 @@ class Scatterplot extends React.Component {
|
|||||||
projectionTF
|
projectionTF
|
||||||
) {
|
) {
|
||||||
if (!this.reglCanvas) return;
|
if (!this.reglCanvas) return;
|
||||||
const { universe } = this.props;
|
const { universe, responsive } = this.props;
|
||||||
const { width: cvWidth, height: cvHeight } = this.reglCanvas;
|
// The viewport dimension is used to scale points, so we want to pass
|
||||||
|
// the dimension of the MAIN viewport, not the scatterplot viewport.
|
||||||
|
// Slightly hacky, but we want all points to scale uniformly. Perhaps
|
||||||
|
// this should move to the redux state and be shared?
|
||||||
|
const { width: cvWidth, height: cvHeight } = responsive;
|
||||||
regl.poll();
|
regl.poll();
|
||||||
regl.clear({
|
regl.clear({
|
||||||
depth: 1,
|
depth: 1,
|
||||||
@@ -359,7 +365,10 @@ class Scatterplot extends React.Component {
|
|||||||
projection: projectionTF,
|
projection: projectionTF,
|
||||||
count: this.count,
|
count: this.count,
|
||||||
nPoints: universe.nObs,
|
nPoints: universe.nObs,
|
||||||
minViewportDimension: Math.min(cvWidth || width, cvHeight || height)
|
minViewportDimension: Math.min(
|
||||||
|
cvWidth - globals.leftSidebarWidth || width,
|
||||||
|
cvHeight || height
|
||||||
|
)
|
||||||
});
|
});
|
||||||
regl._gl.flush();
|
regl._gl.flush();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user