[Python] How to use a hidden key for cross-filtering across multiple charts in Observable Plot?

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a dashboard using Observable Plot and I want to implement cross-filtering across multiple bar charts. The issue I'm facing is that the key I want to use to filter across charts (e.g., KEY) should not appear on the x or y axes — I want it to be used internally just for linking/filtering data between plots. here is the code I have tried:

    params:
    brush_main: { select: crossfilter }

    - plot:
    - mark: rectY
    data: { from: Data, filterBy: $brush_main }
    x: Yearmonth
    y: { sum: Purchase_order_value_local }
    ...
    - select: intervalX
    x: Yearmonth
    key: D08_ZF_KY_TEST


    My problem is:

    I don’t want to use Yearmonth or Supplier as the key to connect the plots.

    Instead, I want to use a hidden column (KEY) that exists in all datasets as the internal crossfilter key.

    When I try this, I get errors like:

    Error: Unrecognized param type: intervalX
    TypeError: Cannot destructure property 'type' of 'scaleTransform(...)' as it is null.



    My question is:

    How can I define a selection/filter (like intervalX or crossfilter) that operates on a hidden key (not rendered in x or y axes) to enable cross-filtering across multiple charts?

    Any ideas or workarounds would be greatly appreciated!

    Thanks in advance

    Continue reading...

Compartilhe esta Página