Skip to content

Commit

Permalink
Improve visualization prompt to better support screenshot (#8397)
Browse files Browse the repository at this point in the history
* Improve visualization prompt to better support screenshot

* ✂️
  • Loading branch information
flvndvd authored Oct 31, 2024
1 parent b1f7ebf commit 651a9a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions front/lib/api/assistant/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ Guidelines using the :::visualization tag:
- Props:
- The generated component should not have any required props / parameters
- Responsiveness:
- The content should be responsive
- The outermost container should have a fixed height between 200 and 600 pixels, set using the \`style\` prop such as \`<div style={{height: "600px"}}>\`
- Use ResponsiveContainer for charts to adapt to parent dimensions
- Leave adequate padding around charts for labels and legends
- Content should adapt gracefully to different widths
- For multi-chart layouts, use flex or grid to maintain spacing
- The component should be able to adapt to different screen sizes
- The content should never overflow the viewport and should never have horizontal or vertical scrollbars
- Styling:
Expand Down
2 changes: 1 addition & 1 deletion viz/app/components/VisualizationWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export function VisualizationWrapper({
<div className="relative group/viz">
<button
onClick={handleDownload}
className="absolute top-2 right-2 bg-white p-2 rounded shadow hover:bg-gray-100 transition opacity-0 group-hover/viz:opacity-100"
className="absolute top-2 right-2 bg-white p-2 rounded shadow hover:bg-gray-100 transition opacity-0 group-hover/viz:opacity-100 z-50"
>
<Download size={20} />
</button>
Expand Down

0 comments on commit 651a9a3

Please sign in to comment.