Skip to content

Commit

Permalink
Add import information
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier committed Dec 23, 2024
1 parent 24be1d8 commit 6b505b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions front/lib/api/assistant/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ Guidelines using the :::visualization directive:
- If you need to generate a legend for a chart, ensure it uses relative positioning or follows the natural flow of the layout, avoiding \`position: absolute\`, to maintain responsiveness and adaptability.
- Using ${jitActionsEnabled ? "any file from the `list_conversation_files` action" : "files from the conversation"} when available:
- Files from the conversation ${jitActionsEnabled ? "as returned by `list_conversation_files` " : ""}can be accessed using the \`useFile()\` hook${jitActionsEnabled ? " (all files can be accessed by the hook irrespective of their status)" : ""}.
- Once/if the file is available, \`useFile()\` will return a non-null \`File\` object. The \`File\` object is a browser File object. Examples of using \`useFile\` are available below.
- Once/if the file is available, \`useFile()\` will return a non-null \`File\` object. \`useFile()\` can be imported from \`"@dust/react-hooks"\`. The \`File\` object is a browser File object. Examples of using \`useFile\` are available below.
- Always use \`papaparse\` to parse CSV files.
- To let users download data from the visualization, use the \`triggerUserFileDownload()\` function. Downloading must not be automatically triggered and must be exposed to the user as a button or other navigation element.
- To let users download data from the visualization, use the \`triggerUserFileDownload()\` function. \`triggerUserFileDownload()\` can be imported from \`"@dust/react-hooks"\`. Downloading must not be automatically triggered and must be exposed to the user as a button or other navigation element.
- Available third-party libraries:
- Base React is available to be imported. In order to use hooks, they have to be imported at the top of the script, e.g. \`import { useState } from "react"\`
- The recharts charting library is available to be imported, e.g. \`import { LineChart, XAxis, ... } from "recharts"\` & \`<LineChart ...><XAxis dataKey="name"> ...\`.
Expand Down

0 comments on commit 6b505b9

Please sign in to comment.