{"modulePath":"github.com/duneanalytics/cli","version":"v0.1.25","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package visualization\n\n## Constants\n\n```go\nconst ChartConfigHelp = `CHART CONFIG (--chart-type and --config)\n--chart-type is column, line, area, scatter, pie, counter, or table, and --config\ndescribes the chart in terms of the query's result columns; config.chart_type must\nequal --chart-type. Dune builds the full visualization options from it. Column names\nmust match the query output exactly; when the query has completed results, Dune\nrejects a config that names other columns. Look at the columns first with\n'dune execution results'. --config takes inline JSON, @path, or @-.\n\n  column/line/area/scatter:\n    {\"chart_type\":\"line\",\"x_axis\":{\"column\":\"day\",\"title\":\"Day\"},\n     \"y_axes\":{\"left\":{\"label_format\":\"0,0\",\"series\":[{\"column\":\"volume\",\"title\":\"Volume\"}]},\n               \"right_enabled\":false,\"right_label_format\":\"\",\"right_series\":[]},\n     \"enable_legend\":true,\"stacked\":false}\n    Optional: x_axis.sort_x, y_axes.left.title/tick_format, group_by_column (one series\n    per distinct value), when_duplicate_x (first, sum, all), normalize_to_percentage.\n    Only line and area charts can use the right axis.\n  pie:\n    {\"chart_type\":\"pie\",\"x_axis_column\":\"token\",\"y_axis_column\":\"volume\",\n     \"y_axis_title\":\"Volume\",\"y_axis_label_format\":\"$0.0a\",\"show_labels\":true}\n  counter:\n    {\"chart_type\":\"counter\",\"column\":\"total\",\"row_num\":1,\"decimal_places\":0,\"prefix\":\"\",\n     \"suffix\":\"\",\"label\":\"Total\",\"color_positive\":false,\"color_negative\":false}\n  table:\n    {\"chart_type\":\"table\",\"columns\":[{\"name\":\"address\",\"title\":\"Address\",\n     \"column_type\":\"normal\",\"data_type\":\"string\",\"align\":\"left\",\"is_hidden\":false,\n     \"color_positive\":false,\"color_negative\":false,\"number_format\":\"0,0\"}]}\n\nNumber formats (Numeral.js): 0, 0,0, 0,0.00, 0.0a, $0.0a, 0%.`\n```\nChartConfigHelp explains the --chart-type and --config flags, which describe a chart the way the Dune MCP's generateVisualization tool does.\n\n## Functions\n\n```go\nfunc AddChartFlags(cmd *cobra.Command)\n```\nAddChartFlags registers --chart-type and --config.\n\n```go\nfunc ChartArgs(cmd *cobra.Command) (map[string]any, error)\n```\nChartArgs returns the chartType and config tool arguments, or nil when --chart-type and --config are not set.\n\n```go\nfunc NewVisualizationCmd() *cobra.Command\n```\n\n","path":"github.com/duneanalytics/cli/cmd/visualization","name":"visualization","synopsis":"","isRedistributable":true}
