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

Conditional settings based on data types do not work in the SDK #49

Open
theduncanclark opened this issue Oct 5, 2018 · 6 comments
Open

Comments

@theduncanclark
Copy link
Contributor

For example if a setting has…

show_if: data.my_binding

… the setting will never show up in the SDK, whereas in the main app the setting will show and hide as designed, based on whether the binding is set.

@theduncanclark
Copy link
Contributor Author

I'd like to bump this as it continues to be very frustrating when developing templates.

@animateddata
Copy link

I've just encountered this one again too!

@peterrcook-canva
Copy link

Conditions such as:

data.points.value: true

seem to work ok in the SDK, but ones based on data types such as:

data.choropleth.value.type: number

work in the main app, but not the SDK.

@peterrcook-canva
Copy link

Another related case that works in published templates, but not the SDK is:

    overrides:
      - tag: discrete
        method: extend
        show_if:
          data.data.color.type: string
      - tag: numeric
        method: extend
        show_if:
          data.data.color.type: number

@h-robertson h-robertson changed the title Conditional settings based on data bindings do not work in the SDK Conditional settings based on data types do not work in the SDK Nov 28, 2023
@maartenzam
Copy link

maartenzam commented Jan 20, 2025

I also ran into this.

On a side note: Peter's example above uses "number" to check the binding type, but in the conditional settings section of the docs, it's "numeric":

show_if:
  - chart_mode: line
  - chart_mode: bar
    data.data.labels.type: numeric

@peterrcook-canva
Copy link

Hi @maartenzam!

Just confirming, as Maarten spotted, the type should be number, not numeric.

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

4 participants