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

Fix Histogram widget when there is just one row of data #653

Merged

Conversation

moicalcob
Copy link
Contributor

@moicalcob moicalcob commented Apr 17, 2023

Description

Shortcut: (https://app.shortcut.com/cartoteam/story/292405/ac-7xhfwyml-carto-3-histogram-widget-does-not-render-when-same-number-in-all-of-column)

When we're showing just one row of data into a Histogram widget, we were not showing any bar into the widget due to how the Apache E-charts config was generated. With this PR we'll start checking if we just have one row of data to generate the proper options for the widget.

Type of change

  • Fix

Acceptance

  1. Add a Histogram widget with just one row of data
  2. Check that the row is shown in the widget

Acceptance in CARTO 3

  1. Create a map with a query like the following one:
SELECT 1 as _num, * FROM `cartodb-gcp-solutions-eng-team.tomas_data.lavazza_here`
  1. Add a histogram widget using the _num column
  2. Check that the widget is shown correctly

Basic checklist

  • Good PR name
  • Shortcut link
  • Changelog entry
  • Just one issue per PR
  • GitHub labels
  • Proper status & reviewers
  • Tests
  • Documentation

@moicalcob moicalcob added bug Something isn't working widgets labels Apr 17, 2023
@moicalcob moicalcob requested a review from a team April 17, 2023 09:54
@moicalcob moicalcob self-assigned this Apr 17, 2023
@shortcut-integration
Copy link

@moicalcob moicalcob marked this pull request as ready for review April 17, 2023 09:55
@coveralls
Copy link
Collaborator

coveralls commented Apr 17, 2023

Pull Request Test Coverage Report for Build 4799931815

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.06%) to 71.281%

Totals Coverage Status
Change from base Build 4797420017: -0.06%
Covered Lines: 1951
Relevant Lines: 2515

💛 - Coveralls

@VictorVelarde VictorVelarde requested a review from eamador April 18, 2023 14:47
@@ -200,9 +207,9 @@ function HistogramWidgetUI({
return {
type: 'rect',
shape: {
x: x + (isFirst ? 0 : 1),
x: isUniqueDataRow ? x / 10 : x + (isFirst ? 0 : 1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, why 10 value here?

@VictorVelarde VictorVelarde merged commit 8b1293e into master Apr 25, 2023
@VictorVelarde
Copy link
Contributor

Thx @moicalcob, we'll ship it in next 2.0.2, this week

@VictorVelarde VictorVelarde deleted the bug/sc-292405/ac-7xhfwyml-carto-3-histogram-widget-does branch April 25, 2023 16:32
@zbigg zbigg mentioned this pull request Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants