Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boxplot visualization fails in d3.js #4237

Open
gpakosz opened this issue Oct 11, 2019 · 2 comments
Open

Boxplot visualization fails in d3.js #4237

gpakosz opened this issue Oct 11, 2019 · 2 comments

Comments

@gpakosz
Copy link

gpakosz commented Oct 11, 2019

Issue Summary

I'm a new Redash user and I'm trying to use the Boxplot visualization.
I can see Redash's UI says it's deprecated but nor the documentation nor CHANGELOG.md mention this deprecation.

When trying to draw a Boxplot for 100 values, it fails with

Error: <g> attribute transform: Expected number, "translate(NaN,0)".
(anonymous) | @ | d3.js:670

Steps to Reproduce

Here's the MonGoDB query, which should work with any document containing a size field of type int.

{
    "collection": "files",
    "query": {
        "broken": {"$exists": false}
    },
    "fields": {
        "_id": 0,
        "size": 1
    },
    "limit": 10
}

Here's the resulting Boxplot:
image

It seems the JavaScript error relates to the value not being centered on in the plot. Not sure why it's happening. Should the query use a specific data type? The documentation for Boxplot is merely a screenshot.

Technical details:

  • Redash Version: Version: 7.0.0+b18042 (4a978bad)
  • Browser/OS: Chrome for macOS Version 77.0.3865.90 (Official Build) (64-bit)
  • How did you install Redash: Docker
@arikfr
Copy link
Member

arikfr commented Oct 15, 2019

Can you share the query results? Preferably in JSON.

@gpakosz
Copy link
Author

gpakosz commented Oct 31, 2019

Hello,

Here's the query, with names redacted:

{
    "collection": "XXX",
    "aggregate": [
        {
            "$match": {
                "broken": {"$exists": false},
                "foo": {"$exists": false}
            }
        },
        {"$limit": 10},
        {"$project": {"_id": 0, "size": 1}}
    ]
}

Here is the output:

27,132
69,598
144,523
56,914
252,933
2,450,583
543,268
248,576
125,029
243,618

Here's the JavaScript error:
image

And the graph plotted:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants