Skip to content
Snippets Groups Projects
Unverified Commit 7171e5c4 authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

fix y-axis scatter extend calculation (#22164)

* fix y-axis scatter extend calculation

* add visual test
parent ec96b7f8
No related branches found
No related tags found
No related merge requests found
......@@ -126,13 +126,11 @@ function getXAxisProps(props, datas, warn) {
///------------------------------------------------------------ DIMENSIONS & GROUPS ------------------------------------------------------------///
function getDimensionsAndGroupsForScatterChart(datas) {
const dataset = crossfilter();
datas.map(data => dataset.add(data));
const dataset = crossfilter(datas);
const dimension = dataset.dimension(row => row);
const groups = datas.map(data => {
const dim = crossfilter(data).dimension(row => row);
return [dim.group().reduceSum(d => d[2] || 1)];
return [dim.group().reduceSum(d => d[1] ?? 1)];
});
return { dimension, groups };
......
......@@ -39,4 +39,31 @@ describe("visual tests > visualizations > scatter", () => {
cy.percySnapshot();
});
it("with log axes", () => {
visitQuestionAdhoc({
dataset_query: {
type: "native",
native: {
query: `select 1 x, 1 y
union all select 10 x, 10 y
union all select 100 x, 100 y
union all select 200 x, 200 y
union all select 10000 x, 10000 y`,
},
database: SAMPLE_DB_ID,
},
display: "scatter",
displayIsLocked: true,
visualization_settings: {
"graph.dimensions": ["X"],
"graph.metrics": ["Y"],
"graph.x_axis.scale": "log",
"graph.y_axis.scale": "log",
},
});
cy.percySnapshot();
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment