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(aggr): field unmatched when fid duplicated #112

Closed
wants to merge 1 commit into from

Conversation

k6sdevbob
Copy link
Contributor

The method channelAggregate() used to search the field (referenced by the key "field" in encoding) in an array so that if there're more than one pills of a same field, e.g.:

[
    { "fid": "foo", "analyticType": "dimension" },
    { "fid": "foo", "analyticType": "measure", "aggName": "sum" }
]

In the case above, any pills with fid "foo" would match the first IViewField, which will make the aggregation ignored, though it's named "sum(foo)".

There's a real case -
image
The data in the vega-lite config looks like -

{
  "data": {
    "values": [
      {"gwc_3": 0, "gwc_3_sum": 0},
      {"gwc_3": 1, "gwc_3_sum": 724},
      {"gwc_3": 2, "gwc_3_sum": 1430},
      // ...
      {"gwc_3": 22, "gwc_3_sum": 16016},
      {"gwc_3": 23, "gwc_3_sum": 16744}
    ]
  }
}

Which is expected to be -
image

@vercel
Copy link

vercel bot commented Jul 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
graphic-walker ✅ Ready (Inspect) Visit Preview Jul 26, 2023 6:37am

@ObservedObserver
Copy link
Member

need refactor

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

Successfully merging this pull request may close these issues.

2 participants