From 6a90b589fe8ca2ebb4bbb137ae29512e89ed14b5 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 13 Oct 2020 18:23:32 -0400 Subject: [PATCH] Adjust default coalescing params based on HLA-DRB1 stress test --- esm/components/data_layer/scatter.js | 10 +++++----- esm/helpers/render.js | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/esm/components/data_layer/scatter.js b/esm/components/data_layer/scatter.js index ce827690..190b1692 100644 --- a/esm/components/data_layer/scatter.js +++ b/esm/components/data_layer/scatter.js @@ -19,13 +19,13 @@ const default_layout = { max_points: 800, // Many plots are 800-2400 px wide, so, more than 1 datum per pixel of average region width // Define the "region of interest", like "bottom half of plot"; any points outside this region are taken as is // Values are expressed in terms of data value and will be converted to pixels internally. - x_min: '-Infinity', + x_min: '-Infinity', // JSON doesn't handle some valid JS numbers. Kids, don't get a career in computers. x_max: 'Infinity', y_min: 0, - y_max: 2.0, - // Expressed in units of px apart. For circular points, point area 40 = radius ~3.5. - x_gap: 4, - y_gap: 4, + y_max: 3.0, + // Expressed in units of px apart. For circles, area 40 = radius ~3.5; aim for ~1 diameter distance. + x_gap: 7, + y_gap: 7, }, fill_opacity: 1, y_axis: { diff --git a/esm/helpers/render.js b/esm/helpers/render.js index ac7869fa..2c8f99f8 100644 --- a/esm/helpers/render.js +++ b/esm/helpers/render.js @@ -6,6 +6,10 @@ /** * A very simple function aimed at scatter plots: attempts to coalesce "low-significance" SNPs that are too close to * visually distinguish, thus creating a dataset with fewer points that can be rendered more quickly. + * + * This depends on the strong and explicit assumption that points are ordered (typically in x position), so that + * nearby points can be grouped by iterating over the data in sequence. + * * @param {Object[]} data Plot data, annotated with calculated `xc` and `yc` symbols for x and y coordinates (in px). * @param {Number} x_min The smallest x value of an "insignificant region" rectangle * @param {Number} x_max The largest x value of an "insignificant region" rectangle