latitude-dev / latitude

Developer-first embedded analytics
https://latitude.so
GNU Lesser General Public License v3.0
673 stars 26 forks source link

Add a function to display parameters reactively in the View #203

Closed csansoon closed 1 month ago

csansoon commented 2 months ago

We need a param function to display parameters in views, like this:

<Input param='name' />

<Text.H1>
  Hello, {param('name')}!
</Text.H1>

To create a function like this, which is 1. autoimported and 2. reactive without needing to add "$", wee can use the same method as we are doing with runQuery, where a vite script creates the import, moves the method call to a script tag and assignes the result to a variable, and finally replaces the original call with a suscription to that variable. After the transformation, it should look like this:

<script>
  import { param } from '...';
  const val = param('name');
</script>

<Input param='name' />

<Text.H1>
  Hello, {$val}!
</Text.H1>
Thawab8 commented 2 months ago

can the charts be clickable for these parameters? this is an example of cross filter: https://appytown.metabase.com/

geclos commented 1 month ago

@Thawab8 moved your request to #250. This issue is not related to charts.