Copilot for CanvasXpress

Copilot for CanvasXpress is an integrated feature of the CanvasXpress library designed to help users create effective prompts for configuring parameters accurately. This functionality was instrumental in generating the few-shot examples required to train our LLM model.

When users utilize Copilot, there is no need to request the LLM model to generate visualizations. Instead, CanvasXpress will swiftly generate the configuration parameters needed for the visualizations. If the prompt cannot be validated, CanvasXpress will forward it to the LLM model for processing.

Keep in mind that setting up the correct configuration is not a complicated task. It's simply about translating the parameters into plain English—there's no need to craft it into poetry.

How it works

Copilot can be easily enabled or disabled using the toggle widget in the chat interface. As you start typing, you'll see a set of initial suggestions for how to begin your new sentence. You can simply press the tab key to accept a suggestion. If there are multiple options available, pressing tab will select the first one in the list.

Initial Suggestions

  • Create a
  • Orient the graph
  • Set the title for the
  • Increase the font size of the
  • Decrease the font size of the
  • Change the color of the
  • Set the color of the
  • Color by
  • Shape by
  • Size by
  • Group by
  • Show original data
  • Jitter the data
  • Transform the x-axis to
  • Transform the y-axis to
  • Change the scale of the
  • Hide the legend
  • Show the legend
  • Put the legend on the
  • Rotate the
  • Use the
  • Exclude data where
  • Include data with
  • Filter data where
  • ...

Based on the initial suggestion, Copilot will propose ways to complete the sentence. Several of these suggestions exhibit a well defined structured format.

Example of an Structured Suggestion

  • Create a {graph} of {column} {concatenator}

When you begin typing your suggestion, the copilot will automatically complete the sentence with the available graph types in CanvasXpress, such as bar graph, line graph, scatter plot, and more. Once you select the graph type, the copilot will add the term 'of' and suggest the columns from your dataset. After you finish typing the first column, the copilot will propose a comma, a period, or 'and' to help you concatenate the entries.