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

[BUG] Unrecognized scheme name: elastic when rendering vega charts #3582

Closed
Tracked by #2880
ohltyler opened this issue Mar 10, 2023 · 9 comments · Fixed by #3663
Closed
Tracked by #2880

[BUG] Unrecognized scheme name: elastic when rendering vega charts #3582

ohltyler opened this issue Mar 10, 2023 · 9 comments · Fixed by #3663
Assignees
Labels
bug Something isn't working OUI Issues that require migration to OUI v2.7.0

Comments

@ohltyler
Copy link
Member

Describe the bug

I'm seeing some issue when rendering vega charts:

unrecognized scheme name: 'elastic'

It seems the color scheme reference (which is 'elastic' by default in the VegaParser), is now broken. I see vega version bump was done on 2/7, and with other changes to EUI/OUI, I wonder if some combination is what's now causing the issue. Needs further investigation.

To Reproduce
Steps to reproduce the behavior:

  1. Create a vega chart
  2. Try to render it

Expected behavior
It renders

OpenSearch Version
3.0.0

Dashboards Version
3.0.0

@ohltyler ohltyler added bug Something isn't working untriaged labels Mar 10, 2023
@joshuarrrr joshuarrrr self-assigned this Mar 10, 2023
@joshuarrrr
Copy link
Member

@ohltyler I wasn't able to reproduce:

  1. I pulled latest main of OpenSearch Dashboards
  2. I ran yarn osd clean and yarn osd bootstrap
  3. I started the developer instance (yarn start), then loaded each of the sample datasets.
  4. I went created a new Vega visualization
  5. It rendered as expected, with no error messages

Screen Shot 2023-03-14 at 6 21 12 PM

@joshuarrrr joshuarrrr added needs more info Requires more information from poster and removed untriaged labels Mar 15, 2023
@ohltyler
Copy link
Member Author

ohltyler commented Mar 21, 2023

@joshuarrrr thanks for the further investigation - I'll take a deeper look at my env again. I was originally running into this on branches based off of feature/feature-anywhere branch which had recently rebased with main and had the latest vega changes pulled in.

@ohltyler
Copy link
Member Author

I've confirmed it's related to something in the feature branch, when rendering regular line charts with vega instead of vislib. Let me triage and add to the feature anywhere meta issue.

@lezzago
Copy link
Member

lezzago commented Mar 22, 2023

@joshuarrrr, I was able to reproduce this on a clean main branch.

Try using this configuration:

{
  $schema: https://vega.github.io/schema/vega-lite/v5.json
  data: {
    values: [
      {
        col-0-2: 1679432400000
        col-1-1: 1
      }
      {
        col-0-2: 1679434200000
        col-1-1: 5
      }
      {
        col-0-2: 1679436000000
        col-1-1: 2
      }
      {
        col-0-2: 1679437800000
        col-1-1: 1
      }
      {
        col-0-2: 1679439600000
        col-1-1: 3
      }
      {
        col-0-2: 1679441400000
        col-1-1: 3
      }
      {
        col-0-2: 1679445000000
        col-1-1: 4
      }
    ]
  }

  layer: [
    {
      mark: {
        type: line
        interpolate: linear
        strokeWidth: 2
        point: true
      }
      encoding: {
        x: {
          axis: {
            title: order_date per 30 minutes
            grid: false
          }
          field: col-0-2
          type: temporal
          scale: {
            domain: [
              1679432553582
              1679518953582
            ]
          }
        }
        y: {
          axis: {
            title: Count
            orient: left
            labels: true
            labelAngle: 0
          }
          field: col-1-1
          type: quantitative
        }
        color: {
          datum: Count
        }
      }
    }
  ]
}

With my current research, I believe the issue is on this piece:

color: {
    datum: Count
}

@joshuarrrr
Copy link
Member

@lezzago In that sample spec, the

            domain: [
              1679432553582
              1679518953582
            ]

causes the x-axis bounds to be undefined

@lezzago
Copy link
Member

lezzago commented Mar 22, 2023

If you remove that, you would still get the scheme name error.

{
  $schema: https://vega.github.io/schema/vega-lite/v5.json
  data: {
    values: [
      {
        col-0-2: 1679432400000
        col-1-1: 1
      }
      {
        col-0-2: 1679434200000
        col-1-1: 5
      }
      {
        col-0-2: 1679436000000
        col-1-1: 2
      }
      {
        col-0-2: 1679437800000
        col-1-1: 1
      }
      {
        col-0-2: 1679439600000
        col-1-1: 3
      }
      {
        col-0-2: 1679441400000
        col-1-1: 3
      }
      {
        col-0-2: 1679445000000
        col-1-1: 4
      }
    ]
  }

  layer: [
    {
      mark: {
        type: line
        interpolate: linear
        strokeWidth: 2
        point: true
      }
      encoding: {
        x: {
          axis: {
            title: order_date per 30 minutes
            grid: false
          }
          field: col-0-2
          type: temporal
        }
        y: {
          axis: {
            title: Count
            orient: left
            labels: true
            labelAngle: 0
          }
          field: col-1-1
          type: quantitative
        }
        color: {
          datum: Count
        }
      }
    }
  ]
}

@ohltyler
Copy link
Member Author

@joshuarrrr
Copy link
Member

Yep - I was about to post the same thing. It may be that we need to make sure we actually define vega.scheme elsewhere rather than in src/plugins/vis_type_vega/public/vega_view/vega_base_view.js

joshuarrrr added a commit to joshuarrrr/OpenSearch-Dashboards that referenced this issue Mar 22, 2023
rather than relying on vega.scheme. Also update vega.scheme name

Fixes opensearch-project#3582

Signed-off-by: Josh Romero <rmerqg@amazon.com>
@joshuarrrr
Copy link
Member

joshuarrrr commented Mar 22, 2023

Here's a quick-fix PR - in theory using a schema is nice, but in practice, it seems like this was the only usage, and it's easy enough to just do it in-place to avoid bugs like this. #3663

@ohltyler @lezzago - would either of you be able to add a regression test case for this?

@joshuarrrr joshuarrrr added v2.7.0 and removed v2.8.0 labels Mar 27, 2023
joshuarrrr added a commit that referenced this issue Mar 30, 2023
…3663)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes #3582

Signed-off-by: Josh Romero <rmerqg@amazon.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Mar 30, 2023
…3663)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes #3582

Signed-off-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit e194bc5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Mar 30, 2023
…3663)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes #3582

Signed-off-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit e194bc5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
joshuarrrr pushed a commit that referenced this issue Apr 4, 2023
…3663) (#3743)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes #3582


(cherry picked from commit e194bc5)

Signed-off-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vagimeli pushed a commit to vagimeli/OpenSearch-Dashboards that referenced this issue Apr 4, 2023
…pensearch-project#3663)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes opensearch-project#3582

Signed-off-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: vagimeli <vagimeli@amazon.com>
joshuarrrr pushed a commit that referenced this issue Apr 5, 2023
…3663) (#3744)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes #3582


(cherry picked from commit e194bc5)

Signed-off-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this issue Apr 24, 2023
…pensearch-project#3663)

rather than relying on vega.scheme. Also update vega.scheme name

Fixes opensearch-project#3582

Signed-off-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: David Sinclair <david@sinclair.tech>
@seanneumann seanneumann added the OUI Issues that require migration to OUI label May 19, 2023
@seanneumann seanneumann moved this to Done in Look & Feel May 19, 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 OUI Issues that require migration to OUI v2.7.0
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants