evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.13k stars 196 forks source link

Chart Drilldowns #2147

Open ItsMeBrianD opened 2 months ago

ItsMeBrianD commented 2 months ago

@hughess or @archiewood please add more detail

kwongz commented 2 months ago

@hughess @archiewood

I was curious if the idea was for the link prop addition, do we want a link button (maybe below the graph), or the user to click the graph to activate the link?

Haven't looked into it yet, but concerns with the graph being clicked may affect the ability to interact with other graph components

e.g hovering over line image

kwongz commented 2 months ago

Maybe a link button/ or text with chevron in below graph image

hughess commented 2 months ago

@kwongz this would be clicking on the chart itself - e.g., click on a line and it navigates to a page you specify.

Similar to the way links work in DataTable, where there is a link prop which accepts a column.

And the user populates a link in their SQL.

So the dataset might be:

date         |   sales  |   link
2024-01-01   |   1400   |   '/sales-detail/2024-01-01'
2024-01-02   |   2400   |   '/sales-detail/2024-01-02'
2024-01-03   |   1500   |   '/sales-detail/2024-01-03'
2024-01-04   |   1700   |   '/sales-detail/2024-01-04'
2024-01-05   |   1900   |   '/sales-detail/2024-01-05'

In the chart:

<LineChart
   data={sales_data}
   x=date
   y=sales
   link=link
/>